Repository navigation
Conversation
With the sidebar switch on, main writes the Recent/Smart stamps and the unread flag on every agent transition and announced each one as worktrees:changed. The window answered with a full repo listing and merge, re-rendering every mounted card and menu; under agent churn those stacked into 50-140 ms frames while scrolling. The window now takes the stamps off main's sidebar feed, which already carries them; paired clients still get the re-list event.
…e listings Re-applies main's last installed stamps whenever a listing replaces the window's records (worktrees, detected listing, folder workspaces), holds the window's own unanswered unread write, and keeps waking the folder git-upgrade watch on a folder stamp.
9 tasks done
Contributor
Author
|
Replaced by the planned workspace-records change, where the window reads these fields from main's feed instead of copying them. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ELI5
When an agent starts or finishes, the app updates that workspace's "last active" time and unread dot. With the new sidebar switch on, each of those small updates made the window reload the whole list of workspaces for that project. While you scroll the sidebar with agents running, those reloads pile up and the list freezes for a tenth of a second at a time. Now the window picks up those updates from the sidebar feed it already reads, so nothing gets reloaded.
What Changed
worktrees:changed. The window then re-listed that project's workspaces over IPC, merged the result and replacedworktreesByRepo. That re-rendered the list, every mounted card and its context menu, and the file explorer rows, on top of the sidebar-feed re-plan the same write already triggers.notifySortStampsChanged(with the switch on) announces stamp writes to paired clients only, through the existingnotifyWorktreesChangedForRemoteClients/notifyReposChangedForRemoteClients. A folder stamp still wakes the folder git-upgrade watch. The newsrc/renderer/src/lib/sidebar-feed-sort-stamps.tskeeps main's last installed workspace rows. It writes theirisUnread/recentAt/smartTier/smartAtonto the window's own records: worktrees, the detected listing and folder workspaces. It re-applies them, idempotently, after every feed install and whenever a listing replaces those records, so a listing that read main before a stamp is corrected as it lands. A row with the window's own unanswered unread write keeps the window's value until main shows it. It is installed once at renderer start and starts the feed itself, because the dock badge, palettes and cleanup views read these records even when no list is mounted.Why
The feed already carries the stamps, and main bumps it on every metadata write. Taking the stamps from the feed follows the switch's direction (main owns the sidebar inputs) and needs no new IPC.
Making only the cards read stamps from feed rows was considered. It leaves stale every other reader of the window's records: the unread badge count, the activity unread count, the jump palette's Recent order and workspace cleanup. Patching the record covers all of them.
invalidateResolvedWorktreeCache()on stamp writes is kept. It only drops the 1 s merged snapshot; git results come from the 30 s scan cache, so it starts nogit worktree list(measured below). Paired clients re-list through that snapshot right after the event, so dropping the invalidation would hand them a snapshot without the stamp.Linked Issue
N/A (internal, sidebar switch follow-up)
Visual Proof
N/A: no visual change. The fix removes scroll stutter, measured as frame times below.
Testing
Hidden window (
ORCA_BACKGROUND_LAUNCH=1), driven over CDP. Fixture: 134 workspaces, 67 fake agents, a hook driver flipping working/done every 2 s. The sidebar scrolls 24 px per frame for 20 s. Runs were interleaved, 4 per build on the same profile. The display runs at 120 Hz, so a normal frame is 8.3 ms.git worktree listspawns during the 20 s window were 0 on both builds, and 0 in a 60 s window on both. About 20 spawns at each launch, the same on both.A third build that also dropped the cache invalidation matched this PR (0–2 frames over 50 ms), so the invalidation does not cost frames either.
New tests:
orca-runtime-sort-stamps.test.ts(fails on the base: the window notifier was called) andsidebar-feed-sort-stamps.test.ts. 569 related node-project tests pass;pnpm tcpasses.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Notes
Separate follow-up, not in this PR: the
revealOwnerselector inright-sidebar/file-explorer-row-context-menu.tsxbuilds a new object on every store change, so every file explorer row re-renders on any write, with the switch on or off.