Repository navigation
feat(sidebar): filter the workspace list by card status (#13996) - #14633
brennanb2025 wants to merge 4 commits into
Conversation
📝 WalkthroughWalkthroughThe change adds workspace status filtering to the sidebar. It extends UI state, persistence, hydration, and RPC filter fields. It normalizes selected status IDs against the status catalog. It filters visible worktrees, Kanban items, and activation targets. It adds localized sidebar controls, filter counts, clear-filter handling, and active-worktree visibility behavior. Tests cover selection logic, persistence sanitization, visibility results, and active-worktree retention. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
21e0997 to
f0bc2be
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a311570-6aee-467a-bfb5-bece29e517f7
📒 Files selected for processing (20)
src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.tssrc/renderer/src/app-shell/use-persisted-ui-writer.tssrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.tssrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsxsrc/renderer/src/components/sidebar/default-branch-visible-under-hide-sleeping.test.tssrc/renderer/src/components/sidebar/sidebar-filter-state.test.tssrc/renderer/src/components/sidebar/sidebar-filter-state.tssrc/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktrees-status-filter.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-filters.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/store/slices/ui.tssrc/shared/constants.tssrc/shared/persisted-ui-state-types.tssrc/shared/workspace-status-filter-sanitize.test.tssrc/shared/workspace-statuses.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 0 remain after this review.
| "SidebarWorkspaceStatusFilterSection": { | ||
| "status": "Status", | ||
| "allStatuses": "All statuses", | ||
| "selectedStatusesCount": "{{value0}} statuses" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Handle the singular status count.
When one status is selected, this string renders 1 statuses. Use the existing localization pluralization convention, or provide a singular form for 1 status.
| /** | ||
| * Drop selected filter ids that no longer exist in the catalog, and collapse a | ||
| * full selection back to "all". | ||
| * | ||
| * Why collapse: a selection naming every status filters nothing but still reads | ||
| * as an active filter in the badge and Clear Filters. Why prune: a filter for a | ||
| * since-deleted custom status would otherwise match no workspace and empty the | ||
| * sidebar with no visible cause. | ||
| * | ||
| * Returns the same array identity when nothing changed so the debounced | ||
| * persisted-UI writer isn't woken by a no-op normalization. | ||
| */ |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Condense this documentation block.
Keep one short comment that states the normalization contract. Remove the implementation walkthrough and repeated rationale.
As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”
Source: Coding guidelines
$electron validation — all six acceptance points exercised, one dropped guard foundDriven with Playwright over CDP against an isolated dev instance of this branch (own Fixture: one project, six workspaces — 1–3. Control renders, lists the catalog, and empty selection shows everythingThe Note the section renders here even though this profile has one project and no host controls — that is the widened 2. Selecting one status filters the listTicking Three of four selected — label 4. Selecting ALL statuses collapses to none — the rule that distinguishes this PRClicking the fourth and final status ( Every per-status box unchecks, 5. Deselecting the last status collapses — the checkbox is never disabledWith Clicking that live checkbox again returns 6. Reveal still surfaces a workspace the filter hidesFilter On activation the filter clears and every row returns, with Extra: the two stale-id traps holdPersisted to disk — Catalog edit prunes the filter — deleting One finding: the active workspace can delete its own row
This PR keeps only
The terminal header still reads This is not a general filter hazard — it is specific to status. You cannot change a workspace's repo, host, or detached-HEAD state from its own row, so no existing filter can be flipped against the row that flipped it. Also worth recording in the supersession table: Gates re-run on this branchThe lint gate was proven live rather than assumed — oxlint is silent when clean, so I appended No |
Fixed: the active workspace no longer deletes its own rowPushed
forcedVisibleWorktreeIds: [args.agentSendTargetWorktreeId, activeWorktreeId].filter(
(id): id is string => id != null
)with the id read only while a status filter is set: const activeWorktreeId = useAppStore((s) =>
filterWorkspaceStatuses?.length ? s.activeWorktreeId : null
)Why gated rather than unconditional. #13971 pinned the active row for every filter. Gating on the status filter keeps this fix to the regression it repairs: status is the only filter dimension a user can flip from the row itself, so no other filter can be turned against the row that turned it. Pinning unconditionally would have quietly widened Proven red firstThe test fails without the one-line change. Reverting only the That is the same shape as the live repro. With the term restored, 4 passed. The other three cases are scope guards: a non-active workspace on an excluded status is still filtered out, and with no status filter set the active workspace is not pinned. Re-verified live, on a clean mountRe-ran the original repro on the same dev instance after a full renderer reload (fresh fiber tree, not a hot update). Same three facts as the failing case, different outcome: The filter badge still reads Six workspaces, two rows. The pin is workspace-specific, not a filter bypass. One note for the record: adding a Gates, re-run after the fix
then reset back off the test merge and pushed the branch un-merged. Nothing in main's 20 new commits touches the sidebar listing path. The supersession table in the PR body now records both differences from #13971 explicitly — the pin (adopted) and the unfiltered jump palette (deliberate, with the reasoning), so neither has to be inferred from a diff. |
Follow-up
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts (1)
90-124: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winScope the active-worktree pin to the status filter.
Line 91 adds the active worktree to
forcedVisibleWorktreeIds. The shared visibility function restores generic forced IDs after every filter. An active worktree can therefore bypass repository, host, sleeping, and hide filters whenever a status filter is active.Keep
agentSendTargetWorktreeIdon the generic forced-visible path. RestoreactiveWorktreeIdimmediately after status filtering so all unrelated filters still apply. Add a regression case with a non-empty status filter andfilterRepoIds: ['repo-other']; it must return no worktrees.
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts (1)
58-63: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the active-workspace rationale.
Keep only the non-obvious status-filter reason. The six-line comment is not brief.
As per coding guidelines: “Comments must be concise, non-obvious, and brief—prefer one line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e2303cc7-bd2e-44c5-ad29-347ba958bb3a
📒 Files selected for processing (2)
src/renderer/src/components/sidebar/worktree-list/listing/active-workspace-survives-status-filter.test.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 2 remain after this review.
Add a multi-select "Status" row to the sidebar workspace options menu, mirroring the Hosts/Projects sections. Empty selection shows every status, matching the multi-select workspace-status filter already shipped on the Agent Dashboard (#11042). The predicate lives in the shared computeVisibleWorktreeIds pipeline, so it applies in every grouping mode and to the Workspace Board, and Cmd+1-9 numbering cannot diverge from the rendered card order. Selections are validated against the live status catalog on hydrate and on every catalog edit, so a deleted custom status cannot silently empty the sidebar. Revealing a workspace whose status is filtered out clears the filter, matching the existing repo-filter rule. Extract SidebarFilterState / sidebarHasActiveFilters / ClearFilterActions into sidebar-filter-state.ts to keep visible-worktrees.ts under max-lines.
… filtered out "Move to Status" sits on the workspace row itself, so restatusing the workspace you are working in deleted its row while its panes stayed open, with nothing on screen explaining why — the only recovery was reopening the menu and changing the filter. Restores the active-workspace pin from #13971. Status is the only filter dimension reachable from the row, so no other filter can be turned against the row that turned it; the pin is therefore gated on a status filter being active rather than applied unconditionally, which keeps every other filter's behavior unchanged. activateAndRevealWorktree already covers activating *into* a filtered-out workspace; this covers filtering *out* the already-active one.
…ng is pinned Hoists the pinned-id array out of the call so both sources read as peers — either, both or neither may be set — and restores the original contract of passing undefined rather than an empty array when nothing is pinned. No behavior change: computeVisibleWorktreeIds guards on length > 0.
…ktrees under the line cap Main split visible-worktrees.ts three ways while this branch was open; adding the status pass on top put it back over max-lines. Same predicate, its own module, no lint suppression.
6a0ae10 to
dd55de5
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Rebased onto current
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/visible-worktree-status-filter.ts (1)
8-20: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the block comment.
filterWorktreesByWorkspaceStatushas a correct implementation, but Lines [8-20] contain a multi-paragraph explanation. Keep the contract and one non-obvious constraint in a brief comment. As per coding guidelines, TypeScript comments must be concise and brief, with one line preferred.Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0d725c0e-80d2-4025-abc5-35b5eff3e2cc
📒 Files selected for processing (23)
src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.tssrc/renderer/src/app-shell/use-persisted-ui-writer.tssrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.tssrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsxsrc/renderer/src/components/sidebar/sidebar-filter-actions.tssrc/renderer/src/components/sidebar/sidebar-filter-state.test.tssrc/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktree-kinds.tssrc/renderer/src/components/sidebar/visible-worktree-status-filter.tssrc/renderer/src/components/sidebar/visible-worktrees-status-filter.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/components/sidebar/worktree-list/listing/active-workspace-survives-status-filter.test.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-filters.tssrc/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.test.tsxsrc/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/store/slices/ui.tssrc/shared/constants.tssrc/shared/persisted-ui-state-types.tssrc/shared/workspace-status-filter-sanitize.test.tssrc/shared/workspace-statuses.ts
🚧 Files skipped from review as they are similar to previous changes (18)
- src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.ts
- src/renderer/src/i18n/locales/en.json
- src/shared/constants.ts
- src/shared/workspace-status-filter-sanitize.test.ts
- src/renderer/src/app-shell/use-persisted-ui-writer.ts
- src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.ts
- src/shared/persisted-ui-state-types.ts
- src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts
- src/renderer/src/lib/worktree-activation.ts
- src/shared/workspace-statuses.ts
- src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts
- src/renderer/src/components/sidebar/worktree-list/listing/active-workspace-survives-status-filter.test.ts
- src/renderer/src/components/sidebar/visible-worktrees-status-filter.test.ts
- src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
- src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsx
- src/renderer/src/store/slices/ui.ts
- src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts
- src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
Included review availability: Your plan includes up to 10 reviews per rolling hour; 3 remain after this review.
| filterWorkspaceStatuses: state.filterWorkspaceStatuses, | ||
| workspaceStatuses: state.workspaceStatuses, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Preserve host-qualified identity in the numbering path.
computeVisibleWorktreeIds filters worktree rows but returns bare worktree.id values. getVisibleWorktreeIds then rebuilds rows with bare-ID membership at Lines [349-358]. When two execution hosts expose the same worktree ID, a selected row and an excluded row share the same rank, so the excluded row reappears in Cmd+1–9 order. Carry getWorktreeHostIdentity(worktree) through this path and add a two-host collision regression test. The duplicate-ID case is documented in src/renderer/src/components/sidebar/visible-worktree-status-filter.ts, Lines [18-20].
|
Any update here? This would be a great feature to have! |
|
I hope this makes it into the release soon. |











ELI5
The sidebar can already group workspaces by card status (Todo / In progress / In review / Done), but it can't filter by it. This adds a "Status" row to the sidebar options menu (the sliders icon) with a checkbox per status. Tick nothing and you see everything, exactly as today. Tick "Done" and you see only your finished workspaces.
What Changed
The filter
Statusrow in the sidebar options menu, underShow, next toHostsandProjects. SameDropdownMenuSubshape as those two — label left, current value right ("All statuses" / the status name / "N statuses"), checkboxes in the nested panel.agent-board-filtering.ts), which uses exactlyfilters.workspaceStatuses.length === 0 || filters.workspaceStatuses.includes(id).computeVisibleWorktreeIdspipeline, so it applies in every grouping mode (Project / Status / PR / None), to the Workspace Board, and to the Cmd+1–9 numbering — those cannot diverge from the rendered card order because they read the same function.filterWorkspaceStatusesUI state, persisted through the existing debouncedwindow.api.ui.setwriter and theClientUiWorkspaceFilterFieldsallowlist. Counted by the filter badge and reset by Clear Filters.The traps this closes
sanitizeFilterWorkspaceStatusesvalidates the selection against the live status catalog on hydrate and on every catalog edit. Delete a custom status you were filtering by and the filter drops that id instead of silently matching nothing.activateAndRevealWorktree.One refactor, forced by a lint gate
visible-worktrees.tscrossed the 300-linemax-linescap. Per AGENTS.md a disable or a baseline bump is not allowed, soSidebarFilterState/sidebarHasActiveFilters/ClearFilterActions/computeClearFilterActionsmoved intosidebar-filter-state.ts. That is the same split #13971 proposed, and the repo had already named the concept —sidebar-filter-state.test.tsexisted before this PR. Four importers, no behavior change.Why
#13996 asks for this directly, and calls out the inconsistency: the Workspace Board and the Agent Dashboard both filter by
workspaceStatus; the sidebar, which shares the model, does not.Why this supersedes the two open attempts
hiddenWorkspaceStatusIdsfilterWorkspaceStatusesmain#13999 had the right model and I have adopted its shape wholesale — positive selection, the pipeline predicate, catalog sanitization, and the reveal escape hatch are all its design. #13971 contributed the
sidebar-filter-state.tssplit and the active-workspace pin, both of which this PR also adopts. What is new here is the "select all collapses to none" rule (both PRs leave a full selection reading as an active filter that filters nothing), the deselect-the-last guard as a collapse rather than #13971's disabled checkbox, catalog-ordered persistence so the label is stable, and a rebase onto the post-#14465 / post-#14486 sidebar.The two places this PR deliberately differs from #13971, spelled out so nobody has to diff to find out whether they were intentional:
use-visible-worktrees.ts). "Move to Status" sits on the workspace row itself, so restatusing the workspace you are working in would otherwise delete its row while its panes stay open, with nothing on screen saying why. Status is the only filter dimension a user can flip from the row, so no other filter can be turned against the row that turned it — which is why the pin is gated on a status filter being active rather than applied unconditionally. Regression test:worktree-list/listing/active-workspace-survives-status-filter.test.ts.activateAndRevealWorktreecould never fire — the recovery path would be gated behind the very filter it exists to recover from. Leaving the palette unfiltered keeps hidden workspaces findable, and jumping to one clears the filter.Performance (STA-3354)
STA-3354 (P0) is about tab-agent status resolution scanning the whole global agent-status map per tab per render. This filter does not touch that path. It is worth stating plainly because the two things are both called "status" and they are not the same:
WorktreeStatus(src/renderer/src/lib/worktree-status.ts:14,active | working | permission | done | inactive) is the agent-activity dot, derived from live PTYs and the agent-status map viaresolveWorktreeStatus.WorkspaceStatus(src/shared/worktree/types.ts:51) is the kanban card status the user drags between board columns. It is a plain string field on the worktree.#13996 and #11042 are both about the second one. So the added cost is one
Set.has(getWorkspaceStatus(w, statuses))per worktree, insidecomputeVisibleWorktreeIds, which already runs once per filter/sort snapshot — not per row, not per render, and with no read ofagentStatusByPaneKey. Both call sites also subscribe to the status catalog only while a filter is active, so users who never filter by status pay nothing and don't re-run the pipeline on status renames.Manual order (STA-3921 / #13847)
No interaction.
computeVisibleWorktreeIdstakes the already-computedsortedIdsand only removes entries, then re-sorts by that pre-existing order index. Filtering never derives or writes an order, so it cannot compound the manual-order jumping in #13847 — exactly like the existing repo and host filters.Linked Issue
Fixes #13996
Supersedes #13971 and #13999 (same feature, two authors; both now conflict with
main).Related but deliberately not bundled: #13938 (project name on grouped cards) and #9708 (folder workspaces under Status/PR grouping).
Refactor collision assessment (#14443 / #14486)
Requested separately from the filter. Every claim below is from a
git merge-treeprobe, not from the GitHub mergeable flag — which was stale for #14486 throughout.#14443 is obsolete and should be closed, not merged.
refactor(sidebar): extract WorktreeList into focused modulesextracts a ~4800-line monolithicWorktreeList.tsxinto ~40 flatsidebar/use-worktree-*.tsmodules. That monolith no longer exists. #14465 (nwparker, merged 2026-08-14T06:35:41Z, 81 files) already landed that extraction as asidebar/worktree-list/module — 70 files — followed by #14467 for the quality gates.main'sWorktreeList.tsxis now 344 lines.08027d0d2376). It was last pushed 34 seconds before refactor(sidebar): split WorktreeList into a worktree-list module #14465 merged.mainin 3 files, includingWorktreeList.tsx— the file whose old contents its entire diff is premised on. (Re-probed 2026-08-16 against96b03bab4f: now 4 conflicts —WorktreeList.tsx,project-group-header-dom.test.ts,worktree-keyboard-cycle.test.ts, plus a modify/delete onworktree-list-groups.test.tsthatmainhas since removed. Drifting further, as predicted.)#14443 and #14486 do conflict with each other, and cannot be ordered. A direct probe reports 12 conflicting files including
WorktreeList.tsx. But ordering is the wrong question — they are not two steps, they are two competing extractions of the same code at different bases. #14486's head does contain #14465. It is #14443's rebased successor. #14486 supersedes #14443.#14486 did not conflict with
main, and did not conflict with this PR. (Settled: it merged on 2026-08-15T20:40:10Z. Thegit merge-treeprobe was right and the GitHub flag was wrong.)main+ refactor(sidebar): group worktree-list files by domain #14486 → clean. (GitHub still labelled it CONFLICTING at the time; that reflected the older head715b46a. The headb91ad74merged cleanly — and did merge.)It is a directory reorg:
worktree-list/flat files intodrag/,headers/,reveal/,rows/,scroll/,viewport/. Layout only.It shares exactly one file with this PR —
worktree-list/use-visible-sidebar-worktrees.ts— which refactor(sidebar): group worktree-list files by domain #14486 modifies in place (import retargeting) rather than moving. Both merge orders are clean:main→ refactor(sidebar): group worktree-list files by domain #14486 → this PR: cleanmain→ this PR → refactor(sidebar): group worktree-list files by domain #14486: clean#14486 does conflict with both superseded filter PRs — 22 files with #13999, 25 with #13971 — but that is not #14486's doing. Those two already conflict with plain
main(5 and 7 files) because they predate #14465. The refactor is not what blocks them. (Re-probed 2026-08-16 against96b03bab4f, now that #14486 has landed: #13971 conflicts in 8 files, #13999 in 6. Both drifted further, and neither was blocked by the refactor as such.)Recommended order for a maintainer
Merge refactor(sidebar): group worktree-list files by domain #14486 whenever convenient. It is clean againstDone — merged 2026-08-15T20:40:10Z.maintoday and every day it waits it drifts against a very active directory.main, andgit merge-tree --write-tree origin/main HEADreturns clean with zeroCONFLICTlines.)The real churn risk is not the filter PRs colliding with the refactor. It is that #14486 is a 119-file move sitting on the busiest directory in the app, and it is clean right now. Merge it first and everything else rebases trivially. (That is what happened: #14486 went in first, and this PR's rebase across it was mechanical — three conflicts, all import-path or code-that-moved-house, no behavior change.)
Visual Proof
None captured — this change is visually unverified, and I am not claiming otherwise.
Orca's sanctioned UI-validation skill is reserved for explicit human invocation, so I could not run it. The alternative — standing up my own isolated Electron dev instance — was not safe to attempt here: this machine currently has 7 live Orca processes and 26 Electron processes belonging to the user's real workspace and to other concurrent sessions, this worktree has no prebuilt dev bundle, and a dev instance launched alongside those has a track record of adopting sibling worktrees and clobbering dev identity mid-session. Risking the user's live workspace for a screenshot was the wrong trade, so I stopped.
The logic is covered by tests (see Testing); the rendered menu is not. A reviewer should confirm the visual result. Two-minute manual check:
What I would specifically ask a reviewer to eyeball, since tests cannot: the status icons rendering at
size-3.5next to their labels, and the trigger row's value text truncating correctly for a long custom status name.Testing
Scoped checks only (full-suite runs are avoided in this worktree).
visible-worktrees-status-filter.test.ts— the pipeline predicate: empty = all, single status, multi-status union, unsetworkspaceStatusresolving to the catalog default, the empty-result state (a status no workspace holds → zero visible, together with the assertion thatsidebarHasActiveFiltersis true so Clear Filters stays reachable), fail-open when the catalog is missing, stale ids ignored, and intersection with other filters.workspace-status-filter-sanitize.test.ts— pruning, collapse-to-all, catalog ordering, dedupe, non-array payloads, array-identity stability.SidebarWorkspaceStatusFilterSection.test.ts— toggle and label logic.keeps the surviving id when stale ids alone reach the catalog size, which fails under that mutation. The guard is now load-bearing and proven so.src/renderer/src/components/sidebar,src/renderer/src/store/slices,src/shared/workspace-status*→ 409 files, 4793 tests, all pass (covers thesidebar-filter-state.tsextraction).Re-verified after the post-#14486 rebase (2026-08-16)
Rebased onto
96b03bab4f. Three conflicts, all resolved without behavior change — see the collision-assessment update above for why they were structural rather than semantic.components/sidebar+app-shell+shared/workspace-status*→ 252 files, 2225 tests, all pass;store/slices→ 262 files, 2612 tests, all pass. (An initial combined run showed timeouts inagent-status-live-map-leak.test.ts; that file passes in isolation and in the split runs, the timing-out test differed between runs, and this PR touches nothing in the agent-status eviction path — machine load, not a regression.)tsconfig.node.json,tsconfig.tc.web.json,tsconfig.tc.cli.jsonall exit 0 on the rebased tree.oxfmt --checkclean;oxlint --deny-warningsclean on changed files — and confirmed live by injecting adebuggerstatement and watching it fail, since a silent clean run is otherwise indistinguishable from a dead gate. Native + type-aware code-quality audits exit 0 oversrc config tests mobile. react-doctor (both the config run and the changed-lines gate) clean. Max-lines ratchet OK, no new bypasses. All three localization gates pass.max-linesextraction still earns its keep.mainhad grownvisible-worktrees.tsto 448 lines; with the extraction plus this feature it is 394 — a net reduction, with nomax-linesdisable anywhere.new Set(filterWorkspaceStatuses)once per pipeline run, outside the.filtercallback, costing oneSet.has(getWorkspaceStatus(w, statuses))per worktree inside the existinguseMemo— not per row, not per render. Neither call site readsagentStatusByPaneKey, and both still subscribe to the status catalog only while a filter is active.One incidental fix the rebase forced:
mainmoved the debounced persisted-UI writer out ofApp.tsxintoapp-shell/use-persisted-ui-writer.tsand reshaped it around auseShallowselector. This PR's threeApp.tsxlines were re-homed there rather than recreated at the old path, and a code comment inui.tsthat namedApp.tsxwas corrected to name the hook.tsconfig.node.json,tsconfig.tc.web.json,tsconfig.tc.cli.json. Verified the node gate is live by injecting a deliberate type error and confirming it was caught.oxlint,oxfmt, react-doctor (changed), type-aware + native code-quality audits (changed), max-lines ratchet, reliability gates, all three localization gates — all pass. Nomax-linesdisable added; the cap was resolved by extraction.Platforms: logic-level change with no platform-dependent code — no
metaKey/path/shell handling touched. Under SSH the filter is pure renderer state over already-loaded worktree fields, so it adds no round-trips.Review
z.array(z.string())field added to the existingClientUiWorkspaceFilterFieldsallowlist.mobile/has its own workspace-status grouping and is not part of this change.filterWorkspaceStatusesis optional inPersistedUIand defaults to[], which is exactly today's behavior. An older client reading a newer profile ignores the field; a newer client reading an older profile sanitizesundefinedto[]. No wire opcode, no capability negotiation needed.Setlookup per worktree per pipeline run; the status catalog is subscribed to only while a filter is active.Author