Repository navigation
Conversation
📝 WalkthroughWalkthroughThe PR adds persisted hidden workspace-status identifiers to UI state and RPC validation. It adds a sidebar status filter with localized labels and safeguards against hiding every status. Shared visibility logic applies the filter to worktrees, folder workspaces, kanban worktrees, and jump-palette results. Active-filter detection and clear-filter actions now include workspace statuses. Tests cover status resolution, filtering, persistence-related state behavior, and status toggling. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4e5f888c-922c-411a-b53e-33e589592aef
📥 Commits
Reviewing files that changed from the base of the PR and between 9e18e14 and e86ac962ade8cf93e142552dd97cc145ceddc46a.
📒 Files selected for processing (14)
src/main/runtime/rpc/methods/client-ui-schemas.tssrc/main/runtime/rpc/methods/client-ui-value-schemas.tssrc/renderer/src/App.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.tssrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsxsrc/renderer/src/components/sidebar/WorktreeList.tsxsrc/renderer/src/components/sidebar/sidebar-filter-state.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/store/slices/ui.tssrc/shared/constants.tssrc/shared/types.ts
| }, | ||
| "SidebarWorkspaceStatusFilterSection": { | ||
| "allStatuses": "All statuses", | ||
| "visibleStatusesCount": "{{value0}} statuses", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add plural forms for the visible-status count.
The last-status guard allows exactly one visible status. This string would render 1 statuses. Add _one and _other entries, and pass the count through the i18n pluralization option, so the singular form is selected.
Proposed fix
- "visibleStatusesCount": "{{value0}} statuses",
+ "visibleStatusesCount_one": "{{value0}} status",
+ "visibleStatusesCount_other": "{{value0}} statuses",Adds a Status row to the sidebar's workspace options menu with one checkbox per workspace status. Unchecking a status (e.g. Done) drops its workspaces from the sidebar list, Cmd+1-9 numbering included. State is a hide-list (`hiddenWorkspaceStatusIds`) so statuses added later stay visible; it persists with the other sidebar filters, counts toward the filter badge, and Clear Filters resets it. The last visible status cannot be unchecked — that would empty the sidebar with no way back from inside the list. Splits the value schemas out of client-ui-schemas.ts so the new persisted field fits under the max-lines budget. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review follow-up. Folder workspaces carry `workspaceStatus` but never pass through computeVisibleWorktreeIds, so unchecking a status skipped their rows. Both surfaces now route through one predicate, which also fails open when the status catalog is missing — resolving against an empty catalog maps every workspace to the built-in default, so hiding that default would have swept the whole list. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Review follow-up: - Read the hide-list through one reconciliation helper: ids of deleted statuses are dropped, and a list that would hide every surviving status is treated as no filter. The click-time "keep one visible" guard could not see a later status deletion coming, which left the sidebar empty with every checkbox unchecked. - The filter badge counts reconciled ids, so a deleted status no longer leaves a phantom filter with no row to untick. - Apply the filter in the workspace board and the Cmd+J palette, which build their own lists and documented that they mirror the sidebar. - Keep the active workspace's row visible: "Move to status" sits on the row itself, so marking the workspace you are in as a hidden status deleted its row while its panes stayed open. - Disable the last visible status checkbox instead of swallowing the click, and return the same array on a rejected toggle so it no longer churns a persisted-UI write. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
e86ac96 to
992803d
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. |
|
Addressed the review, plus a rebase onto latest CodeRabbit
Also found while re-reviewing (each in the third commit):
Verification: full renderer suite (22330 tests) green, typecheck (node/web/cli), oxlint, max-lines ratchet, and the localization gates all clean. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/workspace-status-visibility.ts (1)
4-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReduce the new explanatory comments.
Keep only the non-obvious invariant in each comment. Remove comments that restate the function name or describe direct control flow.
src/renderer/src/components/sidebar/workspace-status-visibility.ts#L4-L15: Reduce the helper description to one brief statement of the fail-open and all-status guard.src/renderer/src/components/sidebar/sidebar-filter-state.ts#L23-L31: Reduce the active-filter description to its recovery-path invariant.src/renderer/src/components/sidebar/sidebar-filter-state.ts#L65-L74: Reduce the reset-plan description to its testability purpose.As per coding guidelines, comments must be concise, non-obvious, and brief.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b6939038-1911-4d6a-9ff2-f5541f07b2ba
📒 Files selected for processing (19)
src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.tssrc/renderer/src/App.tsxsrc/renderer/src/components/WorktreeJumpPalette.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.tssrc/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.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/sidebar-filter-state.tssrc/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.tssrc/renderer/src/components/sidebar/visible-worktrees.test.tssrc/renderer/src/components/sidebar/visible-worktrees.tssrc/renderer/src/components/sidebar/workspace-status-visibility.test.tssrc/renderer/src/components/sidebar/workspace-status-visibility.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/store/slices/ui.tssrc/shared/constants.tssrc/shared/types.ts
🚧 Files skipped from review as they are similar to previous changes (10)
- src/shared/constants.ts
- src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.ts
- src/shared/types.ts
- src/renderer/src/i18n/locales/en.json
- src/renderer/src/App.tsx
- src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
- src/renderer/src/components/sidebar/visible-worktrees.test.ts
- src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
- src/renderer/src/store/slices/ui.ts
- src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsx
| return deviceVisibleWorkspaces.filter( | ||
| (folderWorkspace) => | ||
| !isWorkspaceStatusHidden(folderWorkspace, hiddenWorkspaceStatusIds, workspaceStatuses) | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the active workspace visible in every status-filter path.
The regular worktree path restores activeWorktreeId, but these paths do not. An active folder workspace can disappear from the sidebar. An active worktree can disappear from the kanban board.
src/renderer/src/components/sidebar/WorktreeList.tsx#L5713-L5716: Skip status filtering whenfolderWorkspaceKey(folderWorkspace.id) === currentSidebarWorktreeId.src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts#L72-L98: Pass the active worktree ID throughforcedVisibleWorktreeIds.- Add regression tests for both active hidden-status cases.
Based on learnings, active folder selection uses a folder: workspace key and must not be inferred from activeWorktreeId.
📍 Affects 2 files
src/renderer/src/components/sidebar/WorktreeList.tsx#L5713-L5716(this comment)src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts#L72-L98
Source: Learnings
… 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.
… 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.
|
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. |
|
Superseded by the validated replacement PR #14633. |

What
Adds a Status row to the sidebar workspace options menu (⚙ → Show → Status) with a checkbox per workspace status. Unchecking a status hides its workspaces from the sidebar list.
Motivation: finished work piles up in the sidebar — unchecking Done clears it without archiving anything.
How
hiddenWorkspaceStatusIds(new persisted UI state) is a hide-list, not a visible-list, so a status added later — including custom ones — shows by default.computeVisibleWorktreeIds, so the sidebar list and Cmd+1–9 numbering stay in sync. The two new options are optional and fail open: a caller that omits them shows every status.SidebarWorkspaceStatusFilterSectionmirrorsSidebarHostScopeMenuSection: one Sort-by-style row (label left, current value right) whose nested panel holds the checkboxes.client-ui-schemas.tspast the 300-line limit, so its value schemas moved toclient-ui-value-schemas.ts(219 + 122 lines). No behavior change.Not applied to the Cmd+J jump palette or the workspace kanban board (there, status is the column).
Test
visible-worktrees.test.ts, the last-status guard inSidebarWorkspaceStatusFilterSection.test.ts.sidebar+store+rpc/methodssuites pass (5235 tests).All statuses, panel lists Todo / In progress / In review / Done all checked, unchecking Done flips the row to3 statuses.🤖 Generated with Claude Code