Repository navigation
fix(sidebar): Hide sleeping keeps a paired server's active workspaces (dark) - #30624
Conversation
…rt (dark) With ORCA_SIDEBAR_INPUTS=main, main's activity domain now lists a paired server's rows: their terminals and agents as the server's worktree.ps reports them, plus the browser and chat tabs this desktop's saved session holds there. A server out of contact keeps live terminals unverifiable. Switch-off builds are unchanged.
Review: a strict field on paired rows could drop a whole row for an older reader; the activity domain already carries it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
ELI5
"Hide sleeping" hides workspaces with nothing running. When the desktop is connected to a paired Orca server, the server runs the terminals in its own workspaces. With the sidebar-inputs build switch on, the desktop's main process decided "sleeping" from its own records only, so it never saw those terminals, nor the browser tabs the desktop had open there, and it hid workspaces that were in use. Now it asks the owner: the server's own report says which of its workspaces have live terminals or agents, and the desktop adds the browser and chat tabs it holds there. Switch-off builds (every shipped build) are unchanged.
What Changed
All runtime changes run only with
ORCA_SIDEBAR_INPUTS=main(found by #30461, listed as a must-fix before the flip).worktree.psrows already carryliveTerminalCount,unverifiableTerminalCount,statusandworkingMode.normalizePairedServerRownow turns those intoactivity: { terminal, agent }. Older servers that omit them report nothing, so their rows read as before.activityfeed domain now lists paired-server workspaces too (buildPairedServerActivityFacts). It combines the server's report with the browser and native-chat tabs from this desktop's saved session for that server. This is the same rule the phone's server catalog already applies (stampDesktopSidebarView). This host's own rows win an id both list, like the review domain.unverifiable, which keeps the row shown (docs/reference/ssh-execution-boundary.md).pairedServerRowsdomain, so other-version readers see the same rows as before and a terminal-count change does not resend rows.getWorkspaceSessionTabActivitysplits the existing session reader into browser and chat sets.getWorkspaceSessionTabActivityIdsstill returns the same union, so its switch-off callers are unchanged.Known differences, switch-on only:
Why
The server owns its terminals, so it is the one that should report their liveness. Its rows already said this, and the phone already used it. Reusing that report avoids a second channel. The other option was to sync the desktop's server-side tabs into main's own activity producer. That would duplicate state the server already reports, and it would still miss terminals other clients opened.
Linked Issue
Follow-up to #30461 (must-fix before the sidebar flip).
Visual Proof
N/A: dark behind a build switch that is off in every shipped build. Behaviour is proven by the switch-on e2e below.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
New
paired-server-activity-facts.test.ts: terminals, unverifiable counts, agents, the out-of-contact downgrade, desktop browser tabs, and older servers.Parity suite (
sidebar-list-parity.test.tsx) has two new "Hide sleeping" scenarios: a desktop terminal in a server workspace, and a desktop browser tab in a server workspace. The window, the window reading main's feed, and the phone all agree. Negative control: with the paired-server facts removed from the feed, both scenarios fail.e2e, switch-on build, hidden window (
ORCA_BACKGROUND_LAUNCH=1):paired-mobile-desktop-mirror-workspace-visibilityfails before the fix, at its Hide-sleeping browser-tab step, and passes after.sidebar-desktop-reads-mainpasses.pnpm tc, related unit suites (46 files, 431 tests), oxlint, anti-slop audit,check:code-quality:changed, focus-read ratchet, max-lines ratchet.Review
An Opus review found no correctness bugs. Applied: keep the new field off the published rows and make it tolerant (
.catch), and note the other-client terminal difference in the parity suite's known gaps.Agent skill upstream boundary
Notes
SSH: a paired server reached through an SSH host is not in contact here and keeps its last rows as unverifiable. Folder workspaces: these match through the same
folder:key on both sides. Mixed versions: the published feed rows are unchanged, and the activity domain only gains entries.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)