Skip to content

feat(app): align the desktop shell with a navigation rail - #435

Merged
oxwen11 merged 10 commits into
mainfrom
feat/desktop-shell-rail
Oct 6, 2026
Merged

oxwen11 merged 10 commits into
mainfrom
feat/desktop-shell-rail

Conversation

@oxwen11

@oxwen11 oxwen11 commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Requirement

Desktop shell should match the agreed Codex-like layout: icon rail outside one shared panel, page-owned sidebars, and titlebar controls aligned with the macOS traffic lights.

Expected behavior

  • The rail stays outside a single bordered panel. Collapsing the sidebar does not move that frame.
  • Scheduled, Pull requests, Plugins, and Settings replace the session list in the inner sidebar. Other routes keep Recent and Projects.
  • macOS traffic lights sit 15px from the top and left. The sidebar and content-panel toggles share the titlebar row, size, and open/close icons.
  • Draft composer stays vertically centered. Session content width is unchanged.

Changes and risks

  • Pages portal sidebar content into the shell. Routes opt in with staticData.pageSidebar.
  • macOS window chrome comes from apps/desktop/src/shared/macos-window-chrome.ts and is required on the macOS Platform variant.
  • No stored data or wire contract changes. Vendored packages/ui components are not edited.

Verification

  • Browser tests: app-shell, app-rail, page-sidebar, packages-page, shell-columns.
  • pnpm --filter @getpie/app exec tsc --noEmit and @getpie/desktop typecheck passed.
  • Desktop dev window was driven with native accessibility, not Codex CDP. Screenshots attached.
  • Not verified: video, schedule create/run, content-panel docked/maximized, non-macOS desktop, mobile sheet color.

topbar-pressed

topbar-closed

topbar-after

after

after

Put the icon rail outside one shared panel, let each page own its sidebar, and keep the macOS traffic lights and toggles on one titlebar line.
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 3af4337.

iamdin added 2 commits October 5, 2026 12:31
Move the sidebar match helper out of the component module, and point e2e at the sidebar New chat link and New task button.
@pkg-pr-new

pkg-pr-new Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
npx https://pkg.pr.new/oxwen11/pie/@getpie/cli@435

commit: 3af4337

@oxwen11

oxwen11 commented Oct 5, 2026

Copy link
Copy Markdown
Owner Author

审查阻塞(head 126e4520a0357cb0469e2cddf84a30cec86dde79,base main d06b4aee)

1. 必需 Check 失败:run 37341870212。本 PR 新增的 app-rail.test.tsx 中,用键盘 focus "New chat" 链接后 tooltip 一直没有出现(getByText('New chat') 找不到元素)。需要先查清这是 focus tooltip 的真实缺陷还是测试时序问题,再修根因。不要放宽断言,也不要只重跑。

2. Web 上导轨的 "Toggle sidebar" tooltip 失效:app-rail.tsx:28 写的是 <TooltipTrigger render={<ShellSidebarToggle />} />。ShellSidebarToggle(shell-sidebar-toggle.tsx:8)不接收 props 和 ref,所以 Base UI 注入的 hover/focus handler、ref、aria-describedby 全部丢失。结果是在 md 及以上宽度的 Web 上,hover 或 focus 这个按钮都不会出现 tooltip。这违反 ui-components.md 中"保留调用方 props/refs"的要求。测试是按 macOS 平台挂载的,那种情况下这个按钮不渲染,所以没覆盖到。

非阻塞,建议顺手处理或说明:

  • Web 的 content-panel toggle 从 top-1 end-5 改成了 top-0 end-4,与 session header 预留的 size-9 位置差约 5px。
  • 手机宽度下,Scheduled 侧栏的搜索和筛选是 portal 内的局部 state。Sheet 关闭时会卸载,所以每次都会重置。
  • Desktop 窗口窄于 md 时,ShellSidebarToggle 的 aria-pressed 读的是桌面端 open,点击却切换 openMobile,而且 CardPanelHeader 里还会再出现一个 SidebarTrigger。

作者修复后会从 CI 重新开始,然后做 Web 和 Desktop 的独立验证。验证路径包括:rail 与面板边框、各页面侧栏的替换与恢复、前进后退、窄宽度 Sheet、macOS 红绿灯与拖拽区域、content panel 的停靠与最大化。

iamdin and others added 3 commits October 5, 2026 12:58
Escape dismisses a tooltip without a pointer leave, so hover must enter again. The sidebar toggle now forwards trigger props and uses the mobile open state below the sheet breakpoint.
@oxwen11

oxwen11 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

审查与独立验证记录:通过

审查:只改 UI 和 Electron window chrome,不涉及 IPC、信任边界、持久化或契约。Platform 改为 union,唯一的构造方 desktop-host.ts 已同步更新。

独立验证

在 reviewer 自己的 worktree 中检出该 head,pnpm install --frozen-lockfile,用 Turbo 构建。Web 和 Desktop 各用隔离的 PIE_HOME、端口和 profile。

浏览器测试:components/layout 6 个文件 13 个测试通过;packages / schedules / pull-request / routes 共 4 个文件 8 个测试通过。

Web,1280px

  • rail(宽 52)在唯一带边框的 shell-panel 外。
  • 折叠侧栏前后,frame 都是 52,4 1224×792,没有移动。
  • hover rail 上的侧栏开关,出现 "Toggle sidebar" tooltip。
  • Scheduled、Pull requests、Plugins、Settings 分别用各自的页面侧栏替换 Recent/Projects;回到 Draft 后恢复 Projects。
  • 快速切换路由,再连续后退/前进 6 次,没有出现 error boundary。

Web,700px

  • rail 隐藏,只剩一个侧栏开关;打开 sheet 时 aria-pressed 从 false 变为 true。
  • Scheduled 中输入搜索 nightly、选中 Active,关闭 sheet 再打开,两者都保留。

Desktop,macOS,1200px

  • 标题栏高 44px,侧栏开关位于 x=88、y=6,大小 32px。
  • 在 session 路由上,content-panel 开关与侧栏开关同一行、同样大小。
  • 折叠侧栏后,frame 仍为 52,44 1144×752。
  • Scheduled、Pull requests、Plugins、Settings 的页面侧栏与 Web 一致。
  • 用真实模型建了一个 Session(隔离的 PIE_HOME、Pi 默认模型),打开 content panel:停靠时宽 448,最大化后为 310,45 885×750,都在 frame 内。
  • 标题栏 header 和侧栏标题行有 -webkit-app-region: drag,其中的按钮是 no-drag。

Desktop,700px 窗口:rail 隐藏,只剩一个开关;aria-pressed 随 sheet 开合在 false/true 间切换。

缺口(不阻塞)

  • 原生红绿灯位置通过 CDP 截不到。代码和单测确认了 trafficLightPosition {x:15,y:15};渲染侧测得标题栏高 44、开关起点 88,与常量推导一致。
  • 没有非 macOS 的 Desktop。
  • 没测 Schedule 的创建和运行,因为本 PR 不改这部分逻辑。

证据处理:Plugins 页面会展示操作者本机安装的 Pi 包,截图未附,录像中对应的几秒已剪掉。

结论:通过,按 head guard 合并。若 head 或 base 发生变化,从 CI 重新开始。#421 改了相同的文件,本 PR 合并后需要在那边解决冲突。

01-web-draft-expanded

02-web-draft-collapsed-frame-unchanged

03-web-toggle-tooltip

04-web-page-scheduled

12-narrow-sheet-search-typed

13-narrow-sheet-reopened-state-kept

01-desktop-draft-expanded

02-desktop-collapsed

05-desktop-session-panel-docked

06-desktop-panel-maximized

11-desktop-narrow-closed

12-desktop-narrow-sheet-open

web-1280-shell.webm
web-narrow-sheet.webm
desktop-shell.webm
desktop-narrow.webm

@oxwen11
oxwen11 merged commit 3e27258 into main Oct 6, 2026
6 checks passed
@oxwen11
oxwen11 deleted the feat/desktop-shell-rail branch October 6, 2026 02:32
@oxwen11

oxwen11 commented Oct 6, 2026

Copy link
Copy Markdown
Owner Author

已合并:3e27258c7db84e24b214bb81b64fe8bd431dd388(squash,head guard 3af4337c),依据上方记录。

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