Repository navigation
feat(site): replace agents right panel pills with fixed tabs and sub-layers - #29692
Closed
tracyjohnsonux wants to merge 8 commits into
Closed
tracyjohnsonux wants to merge 8 commits into
tracyjohnsonux wants to merge 8 commits into
Conversation
…layers The right panel strip is now a fixed set of underline tabs (Summary, Git, Terminal, Browser, Desktop, Workspace, Debug) that appear when relevant and are never closed. Terminals and app or port previews move into chip strips inside the Terminal and Workspace tabs, replacing the add-tab dropdown and the per-tab close controls.
…inals The Workspace tab now shows a selector whose menu lists every app with a checkbox for the ones open as previews, plus the ports submenu. The Terminal tab keeps chips while they fit on one row and collapses into the same selector once they do not; with no terminals it shows only an Add a terminal button.
The tab list clips vertical overflow, so the trigger's 1px negative margin pushed the underline out of view. Move the overlap to the list wrapper.
…a fade A gradient overlay either hid the header border or let the underline of a scrolled-off active tab show through. Mask the tab list itself so labels and underlines fade together while the header border stays untouched.
…s terminal The Workspace tab now shows an open button when nothing is open, chips with an add control while they fit on one row, and a selector with a close button once they do not. It is hidden entirely when the agent exposes no visible apps and no port forwarding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Agents right panel used small pill tabs with an attached
xand a split+ / vcontrol that mixed "new terminal" with a checkbox menu for Browser, Desktop, and Debug. Every terminal, app preview, and port preview was its own top-level tab, so the strip grew without bound in a 360 to 480px panel, and the 24px pills were hard to hit and had no keyboard tab navigation.The strip is now a fixed set of underline tabs built on the shared
Tabsprimitive: Summary, Git, Terminal, Browser, Desktop, Workspace, and Debug. Tabs appear when their content is available (same gating as before) and are never closed by the user. Each group tab owns its own sub-layer:Terminal 1 x | Terminal 2 x | +) while they fit on one row, and a selector dropdown listing the terminals plus "New terminal" and "Close" actions once they do not. A hidden copy of the chip row measures the fit so the strip flips back to chips when a terminal closes or the panel widens.Each group remembers its active item per chat, and a badge on Git, Terminal, or Workspace shows the count only when there are two or more entries to choose between.
Tab bodies mount on first selection and stay mounted, so the Browser iframe is not loaded on every chat open (the reason #28370 hid those tabs behind the menu). Persisted terminal, app, and port tabs are reused as chips; a stored top-level tab id from the old strip maps onto the group that now holds it.
RightPanelAddTabControland the singleton show/hide state are removed.TabsTriggermerges a passedclassNameinstead of replacing its base classes; no existing caller passed one.Storybook:
SidebarTabView,TerminalTabPanel, andWorkspaceTabPanelstories cover the strip, chips, the collapsed terminal selector, empty states, overflow at 360px, and the workspace selector menu.Implementation plan
Agents right panel: static tabs with sub-layers
Goal
Replace the pill-based, user-managed tab strip in the Agents right panel with a
fixed set of underline-style tabs. Dynamic content (terminals, app previews,
port previews) moves into a sub-layer inside its parent tab, so the top strip
never grows and needs no close controls or add-tab dropdown.
Top strip, fixed order:
Debugis appended as a seventh tab only when debug logging is enabled for thechat (it is a developer setting, not a workspace capability).
Decisions and defaults
These resolve the open questions from the discussion. Each is a reversible
default; flag any you want changed.
agent-browserapp; Debug when debug logging is enabled. A chat without a workspace therefore shows only Summary and Git. Tabs that are shown are never closeable.inert) so iframes and xterm canvases keep state. Preserves the #28370 goal of not loading the browser iframe on every chat load.[Terminal 1 x] [Terminal 2 x] [+]above the terminal. The built-in terminal (reconnect token = chat id) isTerminal 1. Unlabeled terminals are numbered densely and renumber on close, as today. Command apps (Claude Code, Codex, ...) open here as a chip labelled with the app name, deduped bysourceAppId.+and the empty-state button are disabled when the workspace is not running.[File browser x] [code-server x] [+], mirroring Terminal.+opens a menu listing embeddable apps, command apps, external apps, and forwarded ports (moved out of the old add-tab dropdown). With nothing open, the tab body shows that same list so the first click reveals what is available. Opening an embeddable app or port adds a closeable preview chip and activates it. Command apps open as a Terminal chip and switch to the Terminal tab. External apps open in a new browser tab. Reopening an already open app or port activates the existing chip.agents.right-panel-tabs.<chat>entries are reused as-is:terminalkinds feed the Terminal sub-layer,workspace_appandportkinds feed the Workspace sub-layer.agents.right-panel-singleton-tabs.<chat>and the default-terminal-hidden flag are no longer read; a persisted top tab id that points at a removed or sub-level tab falls back to Summary.DesktopPanelContext.onOpenDesktopjust activates the Desktop tab.Tabs/TabsList/TabsTriggerprimitives fromsite/src/components/Tabs(roving focus, arrow keys, single Tab stop) with a taller hit area than the current 24px pills. Sub-layer chips are at least 28px tall with a hover/active close control.Files
Delete:
components/RightPanel/RightPanelAddTabControl.tsxand its stories. Its appand port listing logic moves into the Workspace launcher.
Change:
components/ChatsSidebar/tabs/SidebarTabView.tsx: underline tabs on theshared primitive, no per-tab close, no
addTabControl, badge slot kept,close-panel button on all sizes, scroll active tab into view.
utils/rightPanelTabs.ts: remove singleton tab ids and their guards; addthe static tab id list and helpers to split
UserRightPanelTab[]intoterminal and workspace sub-tabs.
utils/rightPanelTabStorage.ts: remove singleton and default-terminal-hiddenstorage; add per-chat active sub-tab persistence.
components/ChatsSidebar/tabs/getEffectiveTabId.ts: reused as-is for thesub-layers.
AgentChatPageView.tsx: build the fixed tab list, route open/close handlersto the sub-layers, drop singleton visibility state.
Add:
components/RightPanel/SubTabStrip.tsx: shared chip strip (label, optionalclose, optional trailing action) used by Terminal and Workspace.
components/RightPanel/TerminalTabPanel.tsx: chip strip, terminal panels,empty state,
+handling.components/RightPanel/WorkspaceTabPanel.tsx: preview chips,+menu,and the empty-state list of apps and ports built from the current dropdown
items (
AppLink,PortsMenuItemdata viausePortsData).components/RightPanel/RightPanelEmptyState.tsx: small shared empty state.Tests
Extend existing coverage where it exists, add Vitest +
userEventtests fornew interaction outcomes, stories only for visual components:
utils/rightPanelTabs.test.ts: static tab list, sub-tab partitioning,validation still drops stale app/port tabs.
utils/sidebarTabStorage.test.ts(and a new storage test if needed):active sub-tab persistence, legacy keys ignored, stale top tab id falls back.
TerminalTabPanel.test.tsx:+adds a numbered chip and activates it whenready, closing renumbers, closing the last chip shows the empty state,
+disabled when the workspace is not running, command app dedupe.WorkspaceTabPanel.test.tsx: opening an app or port adds and activates achip, reopening activates the existing chip, closing returns to the
launcher.
SidebarTabViewstories updated for the underline style, badges, and theexpanded/close-button states;
RightPanelAddTabControlstories removed.Verification
pnpm --dir site testfor the touched directories.pnpm --dir site lint,pnpm --dir site check(types),pnpm --dir site format../scripts/develop.sh: attached and unattached chats,stopped workspace, chat with and without
agent-browser, narrow viewportoverflow, expanded mode, reload persistence of open chips and active tabs.
Design notes
Workspace lands on the chip the user left. This keeps the common
"bounce between a terminal and a preview" flow at one click per switch
instead of two.
stay compact (24px) and the strip is always present in Terminal so
+has astable home.
Out of scope
measured; dogfood currently has no per-panel signal).
and port menus.
Generated by Coder Agents on behalf of @tracyjohnsonux.