Repository navigation
feat(sidebar): filter workspaces by card status - #13999
PannenetsF wants to merge 3 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 4f14d6d and 0dfa941f92f640f075db47b98ceefe6e6515c797. 📒 Files selected for processing (27)
🚧 Files skipped from review as they are similar to previous changes (27)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughAdds workspace-status filters to the RPC schema, UI state, persistence, hydration, and status-catalog sanitization. Adds sidebar and workspace-menu controls with localized labels, selection counts, stale-ID handling, and clear actions. Applies selected statuses to visible worktree computation and preserves lineage ancestors. Updates worktree activation to clear filters that exclude the target worktree. Adds tests for controls, state pruning, visibility filtering, and activation behavior. Merge Risk: ⚪ Minimal · up to This adds an optional workspace-status filter while preserving existing behavior when no statuses are selected; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description follows the required template and clearly explains the change, rationale, linked issue, testing, compatibility, and performance. Visual proof is not attached yet, but the omission is explicitly documented as pending before merge. Full details: Linked Issues checkExplanation The implementation satisfies issue Full details: Docstring CoverageExplanation Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 26 files. (1 skipped: 1 unsupported.) 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx (1)
76-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThree files independently derive the same live-catalog status-selection logic.
SidebarStatusFilterSection.tsx,SidebarFilter.tsx, andSidebarWorkspaceOptionsMenu.tsxeach re-implement "intersectfilterWorkspaceStatuseswith the liveworkspaceStatusescatalog" to avoid a deleted custom status inflating the count or lighting the filter badge. The shared root cause is the missing shared helper for this rule.
src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx#L76-L88: replace the inlineSetbuild with a shared helper, e.g.getLiveSelectedWorkspaceStatusIds(workspaceStatuses, filterWorkspaceStatuses): Set<WorkspaceStatus>, and keep using.has()forcheckedand.sizeforselectedCount.src/renderer/src/components/sidebar/SidebarFilter.tsx#L118-L124: replaceselectedStatusCount's inline.filter().lengthwithgetLiveSelectedWorkspaceStatusIds(...).size.src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx#L85-L91: replace the identicalselectedStatusCountcomputation with the same shared helper.♻️ Proposed shared helper
// src/shared/workspace-statuses.ts export function getLiveSelectedWorkspaceStatusIds( workspaceStatuses: readonly WorkspaceStatusDefinition[], filterWorkspaceStatuses: readonly WorkspaceStatus[] ): Set<WorkspaceStatus> { const set = new Set<WorkspaceStatus>() for (const status of workspaceStatuses) { if (filterWorkspaceStatuses.includes(status.id)) { set.add(status.id) } } return set }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 9f7a7884-173a-4ad3-b3f9-b53a33386404
📥 Commits
Reviewing files that changed from the base of the PR and between 36d45af and 81b1c3fc21dab097e2ff41d502d8f2407003e8a5.
📒 Files selected for processing (23)
src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.tssrc/renderer/src/App.tsxsrc/renderer/src/components/sidebar/SidebarFilter.tsxsrc/renderer/src/components/sidebar/SidebarStatusFilterSection.test.tsxsrc/renderer/src/components/sidebar/SidebarStatusFilterSection.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/WorktreeList.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/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktree-lineage-ancestors.tssrc/renderer/src/components/sidebar/visible-worktrees-status-filter.test.tssrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/worktree-activation-status-filter.test.tssrc/renderer/src/lib/worktree-activation.tssrc/renderer/src/store/slices/ui.tssrc/renderer/src/store/slices/workspace-status-filter-prune.test.tssrc/shared/constants.tssrc/shared/types.tssrc/shared/workspace-statuses.test.tssrc/shared/workspace-statuses.ts
81b1c3f to
02b335f
Compare
4414d9a to
7e40172
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. |
|
@brennanb2025 Rebased onto the latest main and resolved all conflicts. Verified locally (typecheck + targeted tests pass); CI is pending maintainer approval to run. Ready for review whenever you have a moment — thanks! |
|
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. |
Greptile SummaryThe PR adds a persisted multi-select workspace-status filter shared by the sidebar and Workspace Board.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issue identified. The filtering, reveal, persistence, hydration, and catalog-pruning paths remain aligned, and investigated ordering and lineage differences are either intentionally preserved or converge without an observable failure.
|
| Filename | Overview |
|---|---|
| src/renderer/src/components/sidebar/visible-worktrees.ts | Adds the shared effective-status predicate while preserving the sidebar’s intentional lineage-ancestor injection behavior. |
| src/renderer/src/store/slices/ui.ts | Adds filter state, hydration sanitization, and catalog-edit pruning with no accepted correctness issue. |
| src/renderer/src/lib/worktree-activation.ts | Clears status selections that would prevent an activated worktree from being revealed. |
| src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx | Implements the shared multi-select status submenu with live-catalog selection handling. |
| src/renderer/src/store/slices/persisted-ui-write-baseline.ts | Integrates the new array preference into field-level durable UI diffing and wire updates. |
| src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.ts | Adds the optional status-selection array to the cross-process UI update schema. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
UI[Sidebar or Board status menu] --> Store[filterWorkspaceStatuses]
Store --> Pipeline[computeVisibleWorktreeIds]
Catalog[workspaceStatuses catalog] --> Pipeline
Pipeline --> Sidebar[Sidebar worktree list]
Pipeline --> Board[Workspace Board]
Store --> Writer[Debounced persisted UI writer]
Writer --> Main[Main-process UI persistence]
Main --> Hydrate[Renderer hydration and sanitization]
Hydrate --> Store
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
Add a multi-select workspace-status filter to the sidebar options menu and the Workspace Board filter menu. Empty selection shows all statuses; selecting one or more narrows the list (e.g. only Done, or Todo + In progress + In review for "not completed"). Implemented as a predicate in the shared computeVisibleWorktreeIds pipeline, so it applies in every grouping mode (Project / Status / PR / None) and to both the sidebar list and the board. State (filterWorkspaceStatuses) is persisted via PersistedUIState and validated against the live status catalog on hydration and whenever the catalog changes, so a deleted custom status can't silently empty the list. Activating/revealing a workspace clears a status filter that would otherwise hide it, mirroring the existing repo-filter behavior. Mirrors the multi-select workspace-status filter shipped for the Agent Dashboard in stablyai#11042, reusing the same workspaceStatus model and visual metadata. Extracted addVisibleLineageAncestors into its own module to keep visible-worktrees.ts under the max-lines budget without disabling the rule. Closes stablyai#13996 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…eRabbit) computeVisibleWorktreeIds applied a selected status even when workspaceStatuses was undefined, so every row resolved to the fallback id and a non-default selection hid the whole list before the catalog loaded. Require the catalog before filtering, and extract the shared getLiveSelectedWorkspaceStatusIds helper the three selection-count call sites had each re-implemented. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…t fixture The status-filter PR made filterWorkspaceStatuses a required field of the sidebar filter state, but this pre-existing test literal predates the branch and wasn't updated during rebase. Empty array = show all, matching both cases' existing expectations. Co-Authored-By: Claude Opus 4.8 <[email protected]>
bb6af86 to
ff0759d
Compare
|
Closing as superseded by #14633. That PR carries the same workspace-status filtering feature on the reorganized current-main layout and explicitly identifies this as one of the competing implementations; its validation history keeps it as the active version. |
|
Superseded by the validated replacement PR #14633. |


ELI5
The sidebar can already group workspaces by status, but it couldn't filter by it — so grouping "by project" still showed every card no matter whether it was Todo, In progress, In review, or Done. This adds a status filter so you can say "show me only what's still in progress" or "hide everything that's done."
What Changed
computeVisibleWorktreeIdspipeline, so it applies in every grouping mode (Project / Status / PR / None) and to both the sidebar list and the Workspace Board automatically.filterWorkspaceStatusesis persisted viaPersistedUIState(new optional field) and validated against the live status catalog on hydration and whenever the catalog changes, so a deleted custom status can't silently empty the list.addVisibleLineageAncestorsinto its own module sovisible-worktrees.tsstays under themax-linesbudget (no rule disable).Why
The Workspace Board and Agent Dashboard already filter by workspace status; the sidebar list did not, which is both a feature gap and an inconsistency across surfaces that share the same
workspaceStatusmodel. This mirrors the multi-select workspace-status filter shipped for the Agent Dashboard in #11042, reusing the same model and visual metadata.Linked Issue
Fixes #13996
Related prior work (Agent Dashboard status filter this mirrors): #11042
Visual Proof
How to test
Automated verification (all green):
pnpm typecheck(web/node/cli),oxlint+oxfmt --check, focused Vitest suites (283 tests incl. new predicate/sanitizer/store-prune/reveal-clear/component tests), the localization catalog/extraction/coverage gates, and a cleanelectron-viterenderer build.AI Disclosure
Implemented with Claude Code (Claude Opus 5, 1M context). Research, implementation, multi-agent adversarial review, and fixes were AI-assisted; the diff was reviewed for correctness, wire/persistence compatibility, and UI/i18n consistency.
Review
filterWorkspaceStatusesis a new optional client→host preference (backward-safe); old clients/hosts ignore it. No host-published payload changes.[](show all). Added to theui.setZod schema so the schema-parity assertions hold..filter()predicate over an already-materialized list; no new subscriptions in hot paths.Checklist
N/Awith reason — pending, see Visual Proofpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author