Repository navigation
feat(sidebar): New tab with agent… in a workspace row's menu - #3838
Conversation
It opens the New tab dialog aimed at that workspace without switching to it first (#3772). Left out on a watching device and on a PC that is not connected.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
Two reviewers at this head: Claude (Opus) CLEAR with no findings, Codex Terra CLEAR. A workspace row's menu offers "New tab with agent…", which opens the new-tab dialog for that workspace on its own PC. The item is hidden on a watching device and on a disconnected PC. The Opus reviewer put Left, MEDIUM (Codex, traced): reloading the page with the dialog open reopens it for the selected workspace, not the row's (the address records only |
…der workspaces is on (#3845) Fixes #3771. Proposed by @sergiorademacher, thank you. ## Change With Settings → Appearance → **Agents under workspaces** on, a workspace row with agents under it is now a fold, as a project row is in the Codex app and T3 Code: - A click, Enter or Space on the row folds or unfolds what hangs under it and opens nothing; the agent rows are what open panes. On a phone the drawer stays open, so one can fold a way to the workspace wanted. Left folds and Right unfolds, and the row carries `aria-expanded`. - A workspace with no agent under it opens as before, and with the setting off every row behaves exactly as today (the browser regressions that click `.workspace-select` run with it off). - One fold per row: a repository's row with worktrees folds its agents together with its worktrees, through the worktree fold's own face button, menu item (Collapse / Expand), state and storage. Any other row's menu gets the same Collapse / Expand item for its agents. - Folded, the row keeps what it already shows: the selected agent's place (`has-selected-agent`), the rolled-up state (a waiting agent shows there) and a `+N` count of what is put away. - Agent folds are kept per PC on this device as one list (`ovis:workspace-agents-folded:<machineId>`), pruned to the roster at each change. Everything starts unfolded. - Under the filter, a match among a folded row's agents holds them open for the filter's time, as worktree folds do. - **New tab with agent…** from a folded row's menu (#3838, merged) unfolds the row first, as opening a worktree from the menu unfolds its group, so the new agent is in sight (the last point of #3772). Not in this PR: the optional Collapse all / Expand all palette actions. ## Screenshots (demo data) The PCs list with the tree on: before (`main`), and after one tap or click on `checkout-api`. Its two agents and the worktree that is not selected are put away (`+3`); the selected worktree and its agent stay, and the row says one agent is waiting. | | Before | After (folded) | |---|---|---| | Phone 390, dark | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-before-390-dark.png" width="220"> | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-after-390-dark.png" width="220"> | | Phone 390, light | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-before-390-light.png" width="220"> | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-after-390-light.png" width="220"> | | Desktop 1280, dark | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-before-1280-dark.png" width="220"> | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-after-1280-dark.png" width="220"> | | Desktop 1280, light | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-before-1280-light.png" width="220"> | <img src="https://raw.githubusercontent.com/devswha/ovis/0a45ac790cee7e7da692925d67075eefc0ba1d04/3771-after-1280-light.png" width="220"> | ## Tests - `src/components/Sidebar.agentTree.test.tsx` (3 new cases): a click folds a row's agents and opens nothing, the folded row keeps `has-selected-agent`, the waiting state and `+2`, the fold is stored and survives a new render, and Left, Right, Enter and Space fold and unfold; a row with no agent and every row with the setting off open their pane as before; a filter match opens a folded row for its time, and a change prunes the stored list to the roster. - `src/components/Sidebar.appLayout.test.tsx` (new case): the menu's Collapse / Expand for a row's agents, New tab with agent… from a folded row unfolds it, and a repository's row keeps a single fold item. - `scripts/sidebar-agent-tree-demo-regression.ts`: a real tap on a phone and a click on a desktop, dark and light, fold `checkout-api` (agents gone, `aria-expanded` false, `+3`, the selection unchanged, the phone's drawer still open), a reload keeps the fold, and Right unfolds. ## Validation - `bun run check fast`: exit 0 (workflow syntax, generated types and themes, typecheck, build; unit tests 17248 pass, 0 fail, 54 skip; on `main` with #3838 merged). - `bun scripts/sidebar-agent-tree-demo-regression.ts`: 4 of 4 pass (desktop and phone, dark and light). It is the only browser script that turns the tree on. - Not run: the other sidebar browser scripts (they run with the tree off, where nothing changes), a real phone.
Fixes #3772. Requested by @sergiorademacher, thank you.
Change
A workspace row's menu in the sidebar (its ⋯, right-click and the context-menu key; the sheet on a phone) now offers New tab with agent…, second after Pin workspace. It opens the same New tab dialog as the tab row's own New tab with agent…, aimed at that workspace (
actions.openNewTab({ machineId, workspaceId }), as the split view's tab strips already call it), without switching to it first.Screenshots (demo data)
The menu on
checkout-api: before (main) and after; then the dialog it opens.The dialog it opens:

Tests
src/components/Sidebar.appLayout.test.tsx(new case): on a connected PC the row's menu listsnew-tabafter the pin, running it callsopenNewTabwith that row's PC and workspace, and a watching device's menu has none. The offline cases already in the file keep their lists, so they cover the disconnected PC.ui-regression,workspace-rows-regression,sidebar-activity-demo-regression,workspace-touch-reorder-demo-regression(the phone sheet, opened by touch) andsession-history-browser-qa.Validation
bun run check fast: exit 0 (workflow syntax, generated types and themes, typecheck, build; unit tests 17241 pass, 0 fail, 54 skip).workspace-rows-regression,sidebar-activity-demo-regression,workspace-touch-reorder-demo-regression,session-history-browser-qaandui-regression(underbun run check run), all pass.ui-regressionran with a temporary folder outside the home folder, as its folder step needs.mainand of this branch, a 390 px touch context and a 1440 px window.