fix(assistant-panel): replace collapsed knob with a persistent icon rail#1762
Conversation
|
Reviewed the diff plus the surrounding The rail (issue #123) — 👍 solid
This part looks ready. Session-panel width follow-up — one real correctness gap
|
The floating reopen button for the collapsed left panel was clipped almost in half by the viewport edge and used low-contrast neutral tokens, making it hard to find. Swap it for an always-fully-visible 56px icon rail (Assistant / All sessions / Comments, Slack-nav style) that opens the panel directly on the clicked tab, and carry the unread-comments badge through to the collapsed state.
… toggles The session panel's persisted size was a percentage of the content panel (canvas + session panel), not the viewport. Collapsing the left panel to the rail grew the content panel's absolute width, so the session panel kept the same percentage but a different pixel width, and vice versa on expand. Reinterpret the stored size as a percentage of the full viewport and convert to/from the content-panel-relative percentage react-resizable-panels needs at render, resize, and drag-persist time, so the chat panel's pixel width no longer drifts when the left rail toggles or is dragged.
Each rail button already shows a visible text label under its icon, so the Tooltip just repeated it. aria-label stays for accessibility.
14166d2 to
b5e4fb1
Compare
…tion (#1829) The #1762 merge left two `unreadCommentsCount` declarations in App.tsx: a stale block computing it from an undefined `activeComments` array (a leftover from a pre-refactor version of the file, also referencing an unimported `BoardComment` type) and the current store-selector version (`makeUnreadCommentCountSelector`). The stale block broke agor-ui typecheck and the App.rerender test import on main. Delete the stale `activeComments`-based block; keep the store-derived value, which the icon-rail render sites already consume. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Fixes https://github.com/preset-io/agor-cloud/issues/123 ("Agent tab: the expand affordance is hard to see"). Note: that issue was filed against
agor-cloud, but the panel it describes lives in this repo (agor/apps/agor-ui) — the fix is here.left: 0+translateX(-50%)) and used low-contrast neutral tokens that blended into the canvas background.AssistantPanelRail: a persistent, always-fully-visible 56px icon rail shown while the panel is collapsed, with one stacked icon+label button per tab (Assistant, Sessions, Comments — Slack-nav style). Clicking a button expands the panel directly onto that tab.AppHeader's "Show comments tab" button already has.AppHeader's "Show comments tab" button is left as-is — it's still a useful global comments shortcut regardless of panel state.Before:

After:
Test plan
pnpm lint(apps/agor-ui) — cleanpnpm typecheck(apps/agor-ui) — cleanpnpm test(apps/agor-ui) — 665 tests passing, including new coverage: rail renders all 3 buttons, each button opens the correct tab, unread badge shows/hides correctlyFollow-up: session panel width jump
Manual testing of this PR found that collapsing/expanding the left rail also resized the right session panel (its stored size was a percentage of the content panel, which grows/shrinks with the left panel, rather than of the full viewport). Fixed in a follow-up commit: the session panel's persisted size is now viewport-relative and converted to/from the content-panel-relative percentage
react-resizable-panelsneeds. Verified with Playwright against the live dev environment: session panel width stayed within ~1px (Playwright layout rounding) across collapse, expand, and dragging the left panel's own resize handle — all previously produced a large, evident jump.