Skip to content

feat(ui): session tabs on the board - #3080

Open
kasiazjc wants to merge 5 commits into
mainfrom
feature-session-tabs
Open

kasiazjc wants to merge 5 commits into
mainfrom
feature-session-tabs

Conversation

@kasiazjc

@kasiazjc kasiazjc commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Every session you open on a board becomes a tab in today's session panel until you close it.

  • One session looks exactly like today. The tab bar appears only with a second open session.
  • Opening a session adds a tab at the end and selects it; an already open one just gets selected. /s/<id> still points at the selected tab, so links, back and forward work as before.
  • A tab is the agent icon, the session name (ellipsis, full name and status in the tooltip), a status icon and a close ×.
  • Tabs fit at 200px, then stretch to share the whole row up to 280px each (Chrome style), with "N more" pinned at the right end. The panel is not widened. Tabs that do not fit go into a neutral "N more" dropdown ("More tabs" list with each status). An amber Badge count sits on it only when hidden tabs need you. The selected tab always stays visible.
  • Close: tab × or the header × ("Close tab. The agent keeps running.") closes the tab and selects its neighbour; the last one closes the panel as today. Close other tabs is in the header ⋯ menu (2+ tabs) and on right-click.
  • Hide panel (2+ tabs) collapses to a neutral "N open" edge button on the canvas, with the same badge rule and a "Show sessions" tooltip. Clicking it, or opening any session from the board, brings the tabs back.
  • Mobile (shared SessionPanel, no fork): one session full screen as today. With 2+ open, the header gets an "N open" button that opens an "Open sessions" bottom sheet with each session's status and a close ×. Back to the board keeps them open.
  • Persistence: open tabs and the selected tab per user per board in localStorage (useUserLocalStorage, same as panel:right:size).

Status is never colour alone: Needs you (ExclamationCircleFilled, warning), Running (spinning LoadingOutlined), Completed, not read yet (CheckCircleFilled, primary; reuses ready_for_prompt via isUnreadResult), Failed (CloseCircleFilled, error), Idle (no icon). Every action is a visible button or menu item.

Why

Today opening a second session replaces the first, so following several agents means hunting for them on the board again. Spec: agor://kb/product-prds/session-tabs/impl-spec-2026-10-13.md. Prototype: https://agor.sandbox.preset.zone/ui/a/01a130accd27727a85f19d98/fullscreen

How

  • hooks/useSessionTabs.ts: per-board tab state (pure open/close/close-others helpers plus a shallow store subscription for the open sessions).
  • components/SessionTabs/: antd Tabs (editable-card) tab bar with the "N more" Dropdown and Hide panel, the shared "N open" button, and the mobile sheet (Drawer placement="bottom").
  • App.tsx: the selected session opens a tab; tab bar sits above the existing SessionPanel in the session slot; edge button on the canvas when tabs are hidden; archiving the selected session selects its neighbour.
  • SessionPanel.tsx: optional onCloseOtherTabs (adds the ⋯ item, header × becomes "Close tab") and headerExtra (mobile switcher). Still one mounted SessionPanel; drafts survive switching (fix: persist prompt drafts to localStorage to survive board switches #897).

Does not touch panel sizing (#2794) or ejecting sessions to the canvas (#1713).

Screenshots

All 17 screenshots (1440 with and without the left panel, 1920, 390; light and dark; one session, 2 tabs, 6 tabs with "4 more" and a needs-you badge, tooltips, right-click, ⋯ menu, close, hide panel and edge button, mobile switcher and sheet): https://agor.sandbox.preset.zone/ui/a/01a135e5c4b4728394af07ec/fullscreen

Test env: http://10.33.92.175:13935

Testing

  • hooks/useSessionTabs.test.ts: open, no duplicates, close selects the right then left neighbour, last tab, close others.
  • components/SessionTabs/SessionTabs.test.tsx: status mapping, needs-you copy (singular/plural), overflow keeps order and the selected tab, tab width stretches between 200 and 280px, "N more" badge, close and hide, mobile sheet.
  • SessionPanel.test.tsx: Close tab and "Close other tabs" with 2+ tabs; menu unchanged with one.
  • Existing App and mobile SessionPage suites pass. Biome, frontend colour plugin check and agor-ui typecheck pass.
  • Manually in the env with headless Chromium at 1440 (left panel open and collapsed), 1920 and 390, light and dark.

Not in this PR (follow-ups)

  • Restoring a mid-history scroll position per tab. Switching tabs keeps the draft; the conversation re-opens pinned to the latest message.
  • Board-card "open" indicators and board card menu items.
  • Server-synced tabs (desktop and mobile on different devices), cross-board tabs.
  • Drag to reorder.

🤖 Generated with Claude Code

kasiazjc and others added 2 commits October 21, 2026 12:44
Every session opened on a board becomes a tab in the existing session
panel until it is closed. One session looks exactly like today; a tab
bar appears with the second. Tabs that do not fit go into a neutral
"N more" dropdown with an amber count for sessions that need you. Hide
panel collapses to an "N open" edge button. On mobile the session header
gets an "N open" switcher that opens an "Open sessions" sheet.

Open tabs and the selected tab persist per user per board in
localStorage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compute how many tabs fit at 200px, then stretch the fitting tabs to
share the whole row up to 280px each, so "N more" no longer sits after
an empty gap. Tab status reuses getSessionStatusTone, and the mobile
sheet uses Drawer size instead of the deprecated height.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kgabryje
kgabryje force-pushed the feature-session-tabs branch from 80a867c to 8d90ea1 Compare October 21, 2026 13:03
kgabryje and others added 2 commits October 21, 2026 13:26
- Persisted tabs are never pruned by what the client has loaded. Missing or
  moved-board sessions are filtered for display only; a close picks its
  neighbour from the shown tabs, and selectedId stays in ids or null.
  Archive and delete events drop the tab explicitly.
- useSessionTabs takes { onSelect, onCloseLast } and owns close and
  close-others navigation for desktop and mobile. Closing replaces the URL,
  so Back does not reopen a closed tab.
- App subscribes only to the shown tab ids; the tab bar, edge button and
  mobile switcher subscribe to the live sessions themselves.
- Mobile switching clears read and attention flags like the other open paths.
- SessionTabs.onHide is optional; SessionPanel takes an explicit closesTab;
  the mobile sheet is height-bounded and scrolls; "N open" has an aria-label.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Closing a tab decided whether to navigate from the saved selectedId,
which storage sync shares across windows on the board. With two windows
showing A and B, closing A in the first left its panel and URL on the
closed session. Navigation now follows the window's displayed session.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
useSessionTabs now subscribes to sessions patched/removed events to drop
archived and deleted tabs, so the test's mocked service needs on and
removeListener like the other UI test mocks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kgabryje
kgabryje marked this pull request as ready for review October 22, 2026 14:53

This branch has not been deployed

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

Labels

ai-reviewed-claude-opus-5-5 Reviewed by Claude Opus 5.5 ai-reviewed-gpt-6-1-sol AI adversarial review passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants