Skip to content

fix(desktop): prevent collapsed workbar flash - #3794

Open
hqhq1025 wants to merge 1 commit into
apache:mainfrom
hqhq1025:codex/fix-workbar-first-send-flash
Open

fix(desktop): prevent collapsed workbar flash#3794
hqhq1025 wants to merge 1 commit into
apache:mainfrom
hqhq1025:codex/fix-workbar-first-send-flash

Conversation

@hqhq1025

Copy link
Copy Markdown
Contributor

Summary

  • Keep the lazy Workbar fallback aligned with the resolved surface visibility state.
  • Do not render a right-side loading panel when the Workbar is collapsed during the first send.
  • Preserve loading feedback for genuinely open right and bottom panels.
  • Add Electron regression coverage that records transient panel visibility across DOM mutations.

Verification

  • Red test on origin/main: the new Electron test observed visibleRightWorkbar === true during the first send.
  • npm --workspace @maka/ui run build
  • npx tsc -p apps/desktop/tsconfig.renderer.json --noEmit --pretty false
  • npx biome lint apps/desktop/src/renderer/features/workbar/ui/workbar-host.tsx apps/desktop/e2e/session-workbar.spec.ts
  • npm --workspace @maka/desktop run build:renderer
  • node --test apps/desktop/dist/main/__tests__/workbar-boundary.test.js apps/desktop/dist/main/__tests__/workbar-model.test.js (14/14 passed)
  • The targeted Electron regression passed three consecutive runs.
  • Before/after screenshots are attached in the visual evidence comment below.

Root cause

Creating the first session mounts WorkbarHost while the lazy WorkbarSurface is still resolving. The old Suspense fallback always rendered a visible 480 px right panel, even when rightCollapsed was true. Once the real surface loaded, its collapsed state hid that panel, producing the brief flash. The fallback now derives its rendered placements from the same hidden, rightCollapsed, and bottomOpen state as the resolved surface.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex investigated the render path, implemented the fix and regression test, and ran the verification described above.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@hqhq1025

Copy link
Copy Markdown
Contributor Author

Visual evidence

Same viewport, first-send state, and fixture backend.

Before

The collapsed Workbar Suspense fallback temporarily occupies the right side.

Before: right Workbar loading panel flashes during first send

After

The collapsed Workbar remains absent while the lazy surface resolves.

After: main chat remains full width during first send

@hqhq1025

Copy link
Copy Markdown
Contributor Author

CI note: the current failure occurs before the desktop build and is inherited from main: packages/runtime-host/src/__tests__/execution-host-queue.test.ts still calls the removed queryTurn, stopTurn, and startTurn helpers. The focused fix is already open as #3792. This Workbar PR does not duplicate that unrelated runtime-host change; CI should be rerun after #3792 lands.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed this head and found a blocking issue.

[P1] Claimed queue-test migration not present — build fails

execution-host-queue.test.ts:248/249/271 still references queryTurn/stopTurn/startTurn missing on RuntimeHostConnection. Hosted test is red.

简体中文存在测试迁移缺失阻断。

Make the lazy Workbar fallback mirror the resolved surface visibility so creating a session cannot briefly open a collapsed panel. Add Electron coverage that records transient right-panel visibility during the first send.

Generated-by: Codex
@hqhq1025
hqhq1025 force-pushed the codex/fix-workbar-first-send-flash branch from 9114804 to 5f38f4e Compare August 25, 2026 13:15
@hqhq1025

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after #3796 merged. This removes the inherited Runtime Host compile failure noted in the earlier review; no unrelated queue-test migration is needed in this Workbar PR.

Local verification on 5f38f4e4c:

  • clean npm ci
  • full Desktop workspace dependency build
  • full Desktop build
  • Electron regression: a collapsed workbar never flashes during the first send (1 passed)
  • git diff --check origin/main...HEAD

Please re-review the refreshed head.

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update on 5f38f4e:

The prior P1 (queue-test still references removed RuntimeHostConnection methods) is now closed. The new head has rebased onto main with #3796's fix, execution-host-queue.test.ts no longer references queryTurn/startTurn/stopTurn (grep 0), and hosted test is now pass (run 32852297860).

The workbar-host fallback logic remains correct (no P0-P3) and is now merge-ready pending human decision.

简体中文该头 P1 已随 rebase 闭合。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants