Skip to content

feat(webui): align the sidebar with the reference (webui-parity 47) - #92

Merged
fengzhi09 merged 3 commits into
mainfrom
feat/sidebar-alignment
Sep 29, 2026
Merged

fengzhi09 merged 3 commits into
mainfrom
feat/sidebar-alignment

Conversation

@fengzhi09

Copy link
Copy Markdown
Collaborator

Ticket: .tickets/webui-parity/47-sidebar-alignment.md

左侧边栏对齐:折叠宽 64px + 过渡、开关浮层、小节头去按钮、Expandable 展开动画、空态/错误态、导航激活态接线、?session= 深链(改用 query 语法的理由:恢复管线只解析 searchParams 且保留 hash,fragment 会双语法互扰——验收 agent 独立复核成立)。

验收结论:PASS(独立验收 agent)

  • 门禁独立复跑全绿:webapp:typecheck、typecheck、test:webapp 1272/1272、webapp:build、test:webui 2031(0 fail)。
  • 实机:折叠往返 240↔64 + 0.18s 过渡、toolbar 折叠补偿 142px、开关浮层 aria-expanded 翻转、空态卡片、错误态 role=alert 透出原因、深链冷加载恢复、反向差距三项实测保留(拖拽钳制 400/240、900 视口自动折叠、折叠态持久化)、reveal 56→62。
  • 红线:data-testid 仅新增未改名;diff 零 server 文件;SESSION_VISIBLE_LIMIT=6 保留。
  • 测试:27 例表驱动 + tripwire 实跑;S1 双向钉防回退。

已知限制(已文档化)

  • light 主题下 selected/hover 令牌上游同值(tokens.css),区分仅 dark 主题成立——上游令牌事实,另立小工单在令牌层修。
  • 待拍板项(第三层)与参照组合未走的项未做,工单已如实分层登记。

s39-dev added 2 commits September 29, 2026 10:38
Layer 1 (ticket must-dos):
- S1: selected session/subagent rows paint with the selected token while
  hover keeps the hover token, restoring the lost "which session am I in"
  signal (distinguishable in dark; the light tokens are equal upstream)
- N2: nav rows get a real active signal — pure rule in lib/sidebar-nav.ts,
  driven by the tree-column surface (page passes activeNavSurface) and the
  engine's active session id; the collapsed icon rail lights up too
- S2: the projects section header is a plain 28px div — the focusable
  button with no onClick is gone
- S5: project/directory/subagent disclosures animate through the
  reference's grid-template-rows 0fr->1fr motion (.webui-expandable-motion,
  180ms + 140ms opacity); children stay mounted, inert + aria-hidden while
  closed; reduced-motion drops the transition but keeps the state
- S3/S4: empty state gets the reference card face; the error state is a
  role="alert" that names the live failure reason (sidebar.loadError)
- C3: the rail toggle's aria-label flips 展开导航栏/收起导航栏 per state
- C1/C5: rail width 52 -> 64px with the reference's 180ms cubic-bezier;
  collapsed background goes transparent
- C6: the toolbar column gains pl-[142px] while collapsed so the session
  title keeps its horizontal position

Layer 2 (structural alignment):
- S8: session and subagent rows are <a> deep links over the app's own
  ?session= grammar (lib/url-restore.ts#sessionHref) — plain clicks route
  through switchSession as before; modified clicks open a restorable URL.
  The reference's #session= fragment grammar is deliberately NOT copied:
  the restore pipeline parses the query string and preserves fragments
- C2: the collapse toggle moves outside the sidebar onto a
  pointer-events-none overlay (32px button, floats right of the rail when
  collapsed)
- C4 (kept): the collapsed form stays the icon rail — the reference's
  emptied strip hides every affordance and its own rail-mode user-menu
  branch never executes there
- S6 (verified, not added): "click selects a project" has no backend
  contract to drive it

Reverse-parity kept: drag-resize 240-400, <980px auto-collapse, collapsed
persistence (same webui:ui-state key, no new storage). GET /api/session-tree
stays read-only.

Docs: bilingual sidebar sections and anchor-table rows in webui.md and
webui.zh-CN.md. Tests: webapp/test/sidebar-nav-active.test.ts (27 cases:
pure-function decisions + static-source wiring tripwires).
…ection (parity 47 follow-up)

Acceptance P4 follow-up: the sidebar section in both documents claimed the
selected and hover tokens "differ". They do by name, but upstream's light
theme resolves both --bg_interaction_tertiary_selected and
--bg_interaction_tertiary_hover to --opacity_black_1_4, so the visual
distinction holds only in the dark theme (opacity_white_0_4 vs _0_8). Both
locales now state that boundary and that it is the upstream token set's
current state, not a regression from ticket 47.
@fengzhi09
fengzhi09 force-pushed the feat/sidebar-alignment branch from 132cb7a to b48b0bd Compare September 29, 2026 02:42
@fengzhi09
fengzhi09 merged commit a739fa7 into main Sep 29, 2026
4 of 8 checks passed
@fengzhi09
fengzhi09 deleted the feat/sidebar-alignment branch September 29, 2026 12:45
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.

1 participant