Repository navigation
feat(sidebar): main produces this host's workspace rows, checked against the window (dark) - #30184
Conversation
…t the window (dark)
…saves; prove it on the real cache
…idating the shared cache
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
ELI5
The workspace list on the desktop and the phone will soon be built from one set of inputs that Orca's background process ("main") hands out. Main already had most of them. It did not have the plain list of this computer's own workspaces as the sidebar reads them: name, branch, pin, archive, unread, status, comment, links. This PR adds that list. Nothing uses it yet, and only a special build contains it: shipped builds compile it out.
What Changed
Before: main had no read of this host's workspace rows for the sidebar. The closest thing,
worktree.ps, mixes the rows with fields it re-fills on every poll (terminal counts, last output, preview, status, agents).After (only in an
ORCA_SIDEBAR_INPUTS=mainbuild; switch-off builds behave exactly as main):host|id), the same form the frozen sort order and paired-server rows use. A paired server's rows stay in their own domain.lastActivityAtandsortOrder. Only sorting reads them, and the temporal domain publishes the frozen order. Smart sort also rewrites every row'ssortOrderon each settle, so carrying it would turn every settle into a whole-list change.buildWorkspaceRows(insrc/shared/sidebar-list/workspace-rows.ts) builds the rows on both sides: main over the listing thatworktree.psreads, the window over its own store.getWorktreePsis pulled out unchanged intovisibleResolvedWorktreeSnapshot, soworktree.psand the rows share it.ProducerRevision. The revision moves on catalog events (worktreesChanged,reposChanged) and on store saves that may touch metadata.onStateWritten(dirtyDomains), is called from the one place saves are scheduled.worktree.psand the temporal owner read exactly what they did before.sidebarInputs.workspaceRowsinSIDEBAR_INPUT_METHODS.workspacesdomain in the phone feed (sidebarInputs.read).sshHosts).Why
buildRuntimeWorktreePsSummaries. Summaries fold the GitHub PR cache intolinkedPR, and that cache announces no change. They also drop a folder workspace's host id. And the window would need its own second mapping to compare against them. Projecting theWorktreerecords both sides already hold, with one function, removes that mapping.Linked Issue
N/A (internal series; sidebar B-lite plan, producer P4f).
Visual Proof
N/A: no visible change. Everything is compiled out of shipped builds, and nothing reads the new rows yet.
Testing
Unit:
workspacesdomain and a one-row delta after a pin.Switch on, hidden app (
ORCA_BACKGROUND_LAUNCH=1), new spectests/e2e/sidebar-workspace-rows.spec.ts:connected.Shadow: 0 mismatches in every domain across the 10 sidebar shadow specs, each run twice (20 passed):
sidebar-creation-registry,sidebar-folder-keyboard-navigation,sidebar-measured-row-scroll,sidebar-review-facts,sidebar-agent-row-identity;sidebar-inputs-feed,paired-server-rows-shadow,paired-mobile-desktop-mirror-workspace-visibility.sidebar-folder-keyboard-navigationused to plant names and statuses straight into the window's store. It now writes the statuses through the real metadata writes, so main and the window both see them.Positive control (not committed): a planted flip of every row's unread state in main was recorded as
workspace-rowsmismatches in both new tests.Switch-off bundles (
out/from origin/main and from this branch) differ only in:workspaceRows = nullfield;The rest is minifier renames.
Gates:
pnpm tc,check:code-quality:changed, the focus-read ratchet, oxlint, the max-lines and runtime-Electron ratchets, and the RPC catalog check.src/main/runtime/rpcfolder fail only onnode:sqlitebeing missing in this test runtime, plus one paired-runtime tunnel test that times out the same way on an older checkout.Platforms: macOS.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Two Opus passes: one on the full diff, one on the fix delta. Applied:
Agent skill upstream boundary
Notes
workspaceLineageByChildKey). The folder card's PR display and the context menu read it, but the shared builder does not. It joins the rows, or gets its own field, with the phone switch.terminalPlatformis keyed by repo id only, as inworktree.ps. When one repo id is registered on two hosts, the last host's platform wins.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)