Skip to content

[bugfix] desktop: share the title bar across workspace modes - #671

Merged
FayeSpica merged 2 commits into
ThinkFlowLab:mainfrom
FayeSpica:fix/desktop-workspace-chrome
Dec 4, 2026
Merged

FayeSpica merged 2 commits into
ThinkFlowLab:mainfrom
FayeSpica:fix/desktop-workspace-chrome

Conversation

@FayeSpica

@FayeSpica FayeSpica commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Keep the project sidebar, new-project control, and title spacing consistent across Chat and Canvas in the desktop app. Preserve the sidebar state when switching modes.
  • Give the macOS dock gutter the canvas background and show the Canvas chat launcher when the assistant is closed. Use the panel header to collapse an open assistant.
  • Verify sidebar persistence by opening it through the UI and reloading without setting its preference in the test harness.

Linked issue

No tracked issue. This follows the two reported desktop layout defects.

Test plan

  • The full node tests/browser/workspace_modes.mjs check passed in headless Google Chrome against an isolated API with the assistant fixture. It covers both UI languages, title and sidebar placement, reload, and collapsing and reopening chat. Chromium Headless Shell runs stalled at the existing web upload file chooser before the desktop assertions.
  • The committed desktop assertions fail on the base at the missing Chat sidebar toggle and pass on the candidate. Suppressing the sidebar preference write makes the updated test fail after reload. A focused visual reproduction also records the transparent gutter and duplicate launcher on the base, and the aligned title on the candidate.
  • Local npm run check:i18n, npm exec --no -- tsc --noEmit, and node --check apps/desktop/scripts/smoke-window.mjs.
  • All eight npm test --prefix apps/desktop checks passed with the packaged Python runtime available.
  • Release checks, Desktop checks, CodeQL, and the DSH scope check are left to GitHub. Full packaged first-run smoke and native Windows UI were not run locally. Browser assistant replies use a fixture, and no real provider calls were made.

Visual evidence

Open a project with the desktop sidebar closed and the assistant docked on the right, then switch from Canvas to Chat. These captures use the real React workspace at 1291 × 907 with a macOS desktop bridge fixture and a colored backdrop. Base 9f24de145389dab2186944d6fcc79acee5492dad and capture revision 71c3f6b352ea2f68f565cbe7eb88abbb4dc7b252. The follow-up commit b015d18d724cfc7c425094d7e86865b444e33019 changes only the browser regression.

View Before After
Canvas dock Colored gutter and duplicate launcher Canvas background and one collapse control
Chat title bar Missing project controls and shifted title Project controls and aligned title

The recording shows opening the sidebar, switching modes, closing and reopening the assistant, and reloading with the sidebar still open. Workspace switch recording

Bilingual UI

Existing Chinese and English labels are reused.

Independent pre-review

The independent pre-review scored 93/100 with no publication blockers.

  • Reviewed base 9f24de145389dab2186944d6fcc79acee5492dad
  • Reviewed head b015d18d724cfc7c425094d7e86865b444e33019
  • Native Windows UI and full packaged first-run smoke were outside local validation. The proposed head requires its own GitHub checks.

## summary

- Keep project navigation and title spacing consistent between Chat and
  Canvas, including the current sidebar state.
- Paint the macOS workspace behind the dock and show the canvas chat
  launcher when the panel is closed.
- Cover the desktop layout, mode switch, and chat controls in the
  workspace browser check.
@FayeSpica FayeSpica added area:canvas Canvas, nodes and direct manipulation area:desktop Desktop integration / 桌面集成 type:bug Something is broken labels Dec 4, 2026 — with ChatGPT Codex Connector

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

WITHHOLD 71c3f6b · no linked issue

下载看了 4 张前后截图,也完整解码并抽看了 12.84 秒录屏:macOS bridge fixture 下,Chat 的项目控件恢复,Canvas 右侧露底和重复按钮消失,录屏可见切换后的侧栏。不是实机 Electron 验收。测试里的 reload 仍会重设侧栏偏好,建议让实际点击写入偏好再刷新。

Ran: 核对 4 个变更文件、截图/录屏及 exact-head CI。Desktop checks 已通过,Release checks 仍在跑。Not run: 本地浏览器、原生 Windows UI、打包首次启动。

当前证据暂定 93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3;均满分 3)。

Dot,代表 @david6666666;非表决。

await page.reload();
await page.locator('.cw-workspace[data-workspace-mode="agent"][aria-busy="false"]').waitFor();
assert.equal(await page.locator(".od-project-sidebar").count(), 0);
assert.equal(await sidebarToggle.getAttribute("aria-expanded"), "true");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

这个 reload() 会再次执行上面的 addInitScript,把侧栏直接设成 open;即使真实的保存逻辑坏了,这里也会绿。能否让 init script 只装 bridge,用按钮打开侧栏后再 reload?这样能测到真实偏好是否被保存。

## summary

Open the project sidebar using the desktop control. Verify that it stays
open after reload without seeding the saved preference in the test.

@david6666666 david6666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PASS b015d18 · no linked issue

上一轮指出的测试空洞已修:现在用真实按钮打开侧栏再 reload,init script 不再预写偏好。增量仅改测试,原先核验的 4 张截图、12.84 秒录屏仍可佐证同一生产代码;新 SHA 的 Release、Desktop、CodeQL 和 DSH 都已通过。没有新的 actionable finding;仍未独立运行原生 Windows UI 或首次安装。

93/100(范围 3,正确性 3,验证 2,主张证据 3,简洁性 3;均满分 3)。

Dot,代表 @david6666666;非表决。Coordinator:由仓库指定维护者接手,本次未投票。

@FayeSpica
FayeSpica merged commit 461f31e into ThinkFlowLab:main Dec 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation area:desktop Desktop integration / 桌面集成 type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants