Skip to content

feat(sidebar): filter the workspace list by status - #13971

Closed
jihoonl wants to merge 3 commits into
stablyai:mainfrom
jihoonl:jihoonl/project_filter
Closed

jihoonl wants to merge 3 commits into
stablyai:mainfrom
jihoonl:jihoonl/project_filter

Conversation

@jihoonl

@jihoonl jihoonl commented Aug 12, 2026

Copy link
Copy Markdown

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.
  • Filtering happens in 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.
  • Counts toward the filter badge, and Clear Filters resets it.
  • The last visible status cannot be unchecked — the same guard the Hosts panel applies to its final host, since an empty sidebar has no in-list way back.
  • New SidebarWorkspaceStatusFilterSection mirrors SidebarHostScopeMenuSection: one Sort-by-style row (label left, current value right) whose nested panel holds the checkboxes.
  • Drive-by: the new persisted field pushed client-ui-schemas.ts past the 300-line limit, so its value schemas moved to client-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

  • New unit tests: status filtering in visible-worktrees.test.ts, the last-status guard in SidebarWorkspaceStatusFilterSection.test.ts.
  • sidebar + store + rpc/methods suites pass (5235 tests).
  • typecheck (node/web/cli), oxlint, max-lines ratchet, localization gates all clean.
  • Driven in the dev app over CDP: Status row renders All statuses, panel lists Todo / In progress / In review / Done all checked, unchecking Done flips the row to 3 statuses.

🤖 Generated with Claude Code

@jihoonl
jihoonl requested a review from brennanb2025 as a code owner August 12, 2026 05:28
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The 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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the change and testing but omits required Linked Issue, Visual Proof, Review, Checklist, and Author sections. Add the required template sections, including a linked issue, visual proof or N/A with reason, completed checklist items, review notes, and author details.
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: filtering the sidebar workspace list by status.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts
  • src/main/runtime/rpc/methods/client-ui-value-schemas.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.ts
  • src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui.ts
  • src/shared/constants.ts
  • src/shared/types.ts

},
"SidebarWorkspaceStatusFilterSection": {
"allStatuses": "All statuses",
"visibleStatusesCount": "{{value0}} statuses",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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",

jihoonl and others added 3 commits August 12, 2026 14:50
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]>
@jihoonl
jihoonl force-pushed the jihoonl/project_filter branch from e86ac96 to 992803d Compare August 12, 2026 05:56
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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.

@jihoonl

jihoonl commented Aug 12, 2026

Copy link
Copy Markdown
Author

Addressed the review, plus a rebase onto latest main (conflicts resolved; hiddenWorkspaceStatusIds now rides the new ClientUiWorkspaceFilterFields module instead of my own schema split, which is no longer needed).

CodeRabbit

  1. Fail-open when workspaceStatuses is missing — fixed. Resolving against an empty catalog collapsed every workspace onto the built-in default id, so hiding that default swept the whole list. The guard now lives in one predicate (workspace-status-visibility.ts), with a regression test that omits workspaceStatuses while hiding the default status.
  2. Folder workspaces bypass the filter — fixed. They carry workspaceStatus but never reach computeVisibleWorktreeIds, so their rows are filtered through the same predicate, with a test.
  3. Plural forms for visibleStatusesCount — not applied. getWorkspaceStatusVisibilityLabel returns the status's own label when exactly one is visible and "All statuses" when none are hidden, so the count string only renders for 2 or more. 1 statuses is unreachable; adding _one would be dead. Happy to add it if you'd rather keep the plural shape defensively.

Also found while re-reviewing (each in the third commit):

  • The "keep one status visible" guard only saw the statuses that existed at click time. Deleting the last visible status later left every surviving status hidden — an empty sidebar with every checkbox unchecked. The hide-list is now reconciled against the live catalog: unknown ids are dropped, and a list that would hide everything is treated as no filter.
  • The filter badge counted raw persisted ids, so a deleted status showed a phantom filter with no row to untick.
  • The workspace board and the Cmd+J palette build their own lists and both document that they mirror the sidebar; neither applied the status filter.
  • "Move to status" sits on the sidebar row itself, so marking the workspace you are working in as a hidden status deleted its row while its panes stayed open. The active workspace is now forced visible.
  • The last visible status checkbox is disabled (matching the Hosts panel) instead of silently swallowing the click, and a rejected toggle returns the same array so it no longer triggers a persisted-UI write.

Verification: full renderer suite (22330 tests) green, typecheck (node/web/cli), oxlint, max-lines ratchet, and the localization gates all clean.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/workspace-status-visibility.ts (1)

4-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4b9fb46 and 992803d.

📒 Files selected for processing (19)
  • src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/WorktreeJumpPalette.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.test.ts
  • src/renderer/src/components/sidebar/SidebarWorkspaceStatusFilterSection.tsx
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/default-branch-visible-under-hide-sleeping.test.ts
  • src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
  • src/renderer/src/components/sidebar/sidebar-filter-state.ts
  • src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts
  • src/renderer/src/components/sidebar/visible-worktrees.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts
  • src/renderer/src/components/sidebar/workspace-status-visibility.test.ts
  • src/renderer/src/components/sidebar/workspace-status-visibility.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/ui.ts
  • src/shared/constants.ts
  • src/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

Comment on lines +5713 to 5716
return deviceVisibleWorkspaces.filter(
(folderWorkspace) =>
!isWorkspaceStatusHidden(folderWorkspace, hiddenWorkspaceStatusIds, workspaceStatuses)
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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 when folderWorkspaceKey(folderWorkspace.id) === currentSidebarWorktreeId.
  • src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts#L72-L98: Pass the active worktree ID through forcedVisibleWorktreeIds.
  • 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

@jihoonl

jihoonl commented Aug 12, 2026

Copy link
Copy Markdown
Author

Here is the screenshot

Screenshot from 2026-08-12 14-19-49

brennanb2025 added a commit that referenced this pull request Aug 17, 2026
… 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.
brennanb2025 added a commit that referenced this pull request Aug 17, 2026
… 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.
@nwparker nwparker removed the P2 label Aug 19, 2026
@nwparker

Copy link
Copy Markdown
Contributor

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.

@nwparker

Copy link
Copy Markdown
Contributor

Superseded by the validated replacement PR #14633.

@nwparker nwparker closed this Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants