Repository navigation
Sidebar: land the switch-on fixes from the flip branch on main, switch still off - #31466
Conversation
…lip) The fixes found while the sidebar ran from main's feed, without turning that on: ORCA_SIDEBAR_INPUTS_IS_MAIN stays false, and none of flip-a's stop-gaps come along. - Main stops counting a closed tab's terminal once it was asked to stop and no pane shows it; a failed or refused stop takes the request back, and a host out of contact stays unverifiable. - Main fetches a paired server's rows with the transport's normal bound, so a server slower than 5 s still lists. - A deferred unread raise flips the folder row it was decided for, and a read while the owner check is out cancels it. - Phone: no worktree.ps flash before the feed; a host's last installed feed stands in while a fresh read is out; it highlights its own last-opened workspace and a fold never scrolls; projects file under their project group with the desktop's indent; the collapse spinner shows only after 500 ms; "Reopen to update" keeps the rows on screen. - e2e helpers and journeys for the switch-on suite.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments: 1
src/renderer/src/store/slices/workspace-attention/workspace-unread-flag.ts: 1
49-56: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueThe
readsByWorkspacemap grows without bound.The map gets one entry per workspace ID and never removes entries. Workspaces are deleted over a long session, so stale IDs stay in the map. Each entry is small, so the impact is low. Delete the entry when the workspace is removed, or when no raise is pending.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f49b5482-f517-479a-801f-eaa572dbf0ab
📒 Files selected for processing: 53
mobile/src/components/WorktreeListRow.tsxmobile/src/hooks/use-active-worktree-scroll.test.tsxmobile/src/hooks/use-active-worktree-scroll.tsmobile/src/host-screen/host-list-first-frame.test.tsxmobile/src/host-screen/host-screen-secondary-styles.tsmobile/src/host-screen/host-sidebar-feed-sections.test.tsmobile/src/host-screen/host-sidebar-feed-sections.tsmobile/src/host-screen/host-workspace-list-reopen.test.tsxmobile/src/host-screen/host-workspace-list.tsxmobile/src/host-screen/use-host-list-sections.tsmobile/src/host-screen/use-host-screen-controller.tsmobile/src/host-screen/use-host-sidebar-feed.tsmobile/src/host-screen/use-host-worktree-actions.tsmobile/src/host-screen/use-slow-pending-keys.test.tsxmobile/src/host-screen/use-slow-pending-keys.tsmobile/src/mobile-web-shell/use-page-host-snapshot.test.tsxmobile/src/session/use-mobile-session-keyboard-state.test.tsxmobile/src/session/use-mobile-session-keyboard-state.tsmobile/src/storage/mirrored-storage-keys.tsmobile/src/worktree/host-list-highlight.tsmobile/src/worktree/host-workspace-list-states.tsxmobile/src/worktree/last-visited-worktree-by-host.test.tsmobile/src/worktree/last-visited-worktree-by-host.tsmobile/src/worktree/last-visited-worktree-repo.test.tsmobile/src/worktree/last-visited-worktree-repo.tsmobile/src/worktree/project-group-indent.test.tsmobile/src/worktree/project-group-indent.tsmobile/src/worktree/use-last-visited-worktree-on-host.test.tsxmobile/src/worktree/use-last-visited-worktree-on-host.tsmobile/src/worktree/workspace-list-types.tssrc/main/ipc/pty/ipc/renderer-kill.tssrc/main/ipc/pty/runtime/kill-legacy-relay-bridged.test.tssrc/main/ipc/pty/runtime/kill.tssrc/main/runtime/mobile-desktop-relay/mobile-relay-host-catalog.test.tssrc/main/runtime/sidebar-inputs/orca-runtime-closed-tab-retention.test.tssrc/main/runtime/sidebar-inputs/orca-runtime-workspace-activity-facts.tssrc/main/runtime/sidebar-inputs/paired-server-rows-producer.test.tssrc/main/runtime/sidebar-inputs/paired-server-rows-producer.tssrc/main/runtime/terminal/layout/terminal-input-floor.tssrc/renderer/src/components/sidebar/sidebar-list-parity-catalog.test-fixture.tssrc/renderer/src/components/sidebar/sidebar-list-parity.test-fixture.tssrc/renderer/src/store/slices/workspace-attention/workspace-attention-slice.tssrc/renderer/src/store/slices/workspace-attention/workspace-unread-flag-host-raises.test.tssrc/renderer/src/store/slices/workspace-attention/workspace-unread-flag.tssrc/renderer/src/store/slices/worktrees/listing/owner-host-sidebar-inputs.tstests/e2e/helpers/phone-feed-list.tstests/e2e/helpers/sidebar-setup-prompt.tstests/e2e/helpers/slept-workspace-probe.tstests/e2e/sidebar-desktop-reads-main.spec.tstests/e2e/sidebar-phone-feed-list.spec.tstests/e2e/sidebar-sort-stamps.spec.tstests/e2e/ssh-orcad-phone-feed-list.spec.tstests/e2e/worktree-lineage-toggle-shortcut.spec.ts
💤 Files with no reviewable changes: 1
- mobile/src/worktree/last-visited-worktree-repo.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…d prune pending unread raises - A stop-and-wait that throws takes its stop request back, like one that fails. - A final stop the legacy relay still owes stays marked, since the relay retries it. - Pending unread raises are tracked only while one waits, so the map no longer grows. - The paired-server fallback poll test gives its third fetch a reply and asserts live.
ELI5
We have a not-yet-switched-on version of the sidebar where the app's background process (main) owns the workspace list, and both the desktop window and the phone just draw what main publishes. While testing that version with the switch on, we found and fixed a set of bugs on a test branch (#30790, "flip-a"). This PR brings those fixes to main without turning the switch on and without the temporary stop-gaps that branch used. Shipped builds behave as before.
What Changed
Nothing changes for users of a normal build:
ORCA_SIDEBAR_INPUTS_IS_MAINstaysfalse. Every product change below is either behind that switch or is a main-side fix that is correct either way. With the switch on (aORCA_SIDEBAR_INPUTS=mainbuild):unverifiable, never gone.worktree.pslist before the feed arrives. A host's last installed feed stands in while a fresh read is out.Runs with the switch off
Three changes are not behind the switch:
kill.tsstopAndWaitPtyFromRuntimeController,renderer-kill.ts). So if the terminal exits on its own later, the exit is labeled by its real cause, not "operator closed". One exception: a final stop the legacy relay still owes keeps its request, because the relay retries it.use-active-worktree-scroll.ts). It follows the same rule as the highlight: the phone tracks only its own last-opened workspace.byHostentry, written by read-merge-write. Older readers ignore the new field and are unaffected.Keep / drop, by flip-a commit (
git log --first-parent origin/main..origin/sidebar-flip-a)owner-host-sidebar-inputs.ts) and phone "Reopen" keeps rows on screensidebarSession.sleptWorkspaces)orca-runtime-closed-tab-retention.test.tsclearPtyStopRequest, failed-stop handling, and tests). Dropped: renderer removal hold and thesidebar-pending-overlay.tssplit, which existed only for that holduse-startup-ready-feed.ts(via merge e320b7e)Why
The sidebar design ("one owner per fact", P0) lands each piece on main on its own and inert. Bridges never land on main; each one is replaced in the later PR that removes its need. Reconstructing from flip-a's net diff, minus the dropped pieces, gives one reviewable change instead of replaying merge history. The flip itself stays a one-line PR at the end.
Linked Issue
N/A (internal sidebar refactor; follows the approved design).
Visual Proof
N/A. Shipped builds are unchanged (switch off). The switch-on behaviour is covered by the e2e suite below.
Testing
pnpm tc: pass (rerun after the review fixes; touched unit tests 147 files / 1455 tests and 11 files / 109 tests pass).Unit, node project,
--maxWorkers=2: 63 files / 597 tests touched by this diff or by flip-a's diff, all pass. These include main's restored switch-off tests and the window goldens.Mobile
vitest run: 1074 files / 11063 tests pass.Static gate (all pr.yml static-analysis steps, mobile typecheck and ratchet): 39/39 pass.
Switch-on e2e, full suite (
ORCA_SIDEBAR_INPUTS=main,ORCA_BACKGROUND_LAUNCH=1, 2 workers, hidden windows, shared busy Mac):6dbe87e65 failures are shared by both runs (load-sensitive terminal, perf and timing specs). Four failed only on this PR: file-explorer IME, golden core flow, manual worktree order persistence, and markdown find. All four pass on rerun, 30/30 (
--workers=1 --repeat-each=2). Six failed only on flip-a. No test was tied to a dropped bridge, so the pass count does not drop.I manually tested these changes locally (switch-on e2e, hidden launch)
Automated tests added/updated
Review
Agent skill upstream boundary
Notes
unverifiableeven after a stop request.Checklist
N/Avisual proof with reason