You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(desktop): key sidebar git-watch off agent activity, not every row
DashboardSidebarWorkspaceStatusProvider called watchGit for every sidebar
row to keep diff-stat caches warm. Verified live against real data in
#6848: opening the dashboard alone (no workspace opened) caused 79 of 90
non-archived workspaces to become watched, since the sidebar is normally
mounted for the whole session — the load and terminal-lag scenario #6729
set out to fix, reintroduced through a different subscriber.
An idle workspace's git state can't change without user interaction, so its
diff count doesn't need to stay live — it only needs to be correct the next
time it's opened, which useDiffStats' normal query fetch already handles.
Non-active rows don't render a diff count today anyway (only the active
row does, per the existing `entries` memo), so losing liveness for an idle
row costs a first-open loading flash, not a wrong number on screen.
Now only workspaces with a currently running/blocked/attention-needing
agent (working/permission/review/failed — any non-idle PaneStatus) or the
active workspace hold live git-watch interest. The signal is already
computed here (bindingRowsByIndex + deriveTerminalAgentStatus, the same
data driving the status dot) — no new plumbing. The full lifecycle-listener
pass (agent:lifecycle/terminal:lifecycle/git:changed) still covers every
row regardless, since that's what detects a row transitioning into
activity in the first place; only the watchGit/unwatchGit calls — the ones
with real host-side cost — are now gated.
Split into two effects so the (still full-coverage, cheap) listener
registration doesn't churn every time an unrelated workspace's terminal
status flips: one for listeners (unchanged, keyed on the full target list),
one for git-watch diffing (new, keyed on a fingerprint-stabilized
"currently worth watching" set), plus the existing final-unmount cleanup.
Verified: typecheck and biome clean; no automated test exists for this
component (none did before this change either). Logic re-reviewed by hand
against the exact structure verified live via CDP against real production
data in #6848, but not independently re-verified live in this follow-up —
happy to spin up a fresh dev session and confirm the watched-workspace
count actually drops if useful before merge.
Follow-up to #6848 / #6729.
Claude-Session: https://claude.ai/code/session_01NmLFihnhebmL9bbbojGYCR
Copy file name to clipboardExpand all lines: apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/providers/DashboardSidebarWorkspaceStatusProvider/DashboardSidebarWorkspaceStatusProvider.tsx
0 commit comments