Skip to content

feat(sidebar): filter workspaces by card status - #13999

Closed
PannenetsF wants to merge 3 commits into
stablyai:mainfrom
PannenetsF:yq/serene-stonebraker-dee7b3
Closed

PannenetsF wants to merge 3 commits into
stablyai:mainfrom
PannenetsF:yq/serene-stonebraker-dee7b3

Conversation

@PannenetsF

Copy link
Copy Markdown
Contributor

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

  • New multi-select status filter in the sidebar options menu (⚙️) and the Workspace Board filter menu — one checkbox per workspace status, with its colored status icon, a count badge, and a Clear action.
  • Empty selection = show all (no behavior change). Selecting statuses narrows the list:
    • Only Done → select Done
    • Only In progress → select In progress
    • Not completed → select Todo + In progress + In review
  • 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 Workspace Board automatically.
  • State filterWorkspaceStatuses is persisted via PersistedUIState (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.
  • Activating/revealing a workspace clears a status filter that would otherwise hide it, mirroring the existing repo-filter reveal behavior.
  • Refactor: extracted addVisibleLineageAncestors into its own module so visible-worktrees.ts stays under the max-lines budget (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 workspaceStatus model. 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

⚠️ Not yet attached. This was developed in a headless environment where the Electron app can't be launched, so I could not capture before/after screenshots. I will add a short before/after clip of the sidebar status filter (grouped by project) before merge. Reviewers running locally can reproduce with the steps below.

How to test

  1. Open the sidebar options menu (the sliders icon in the sidebar header).
  2. Under "Show", open the new Status submenu; select one or more statuses.
  3. Confirm the sidebar list narrows to only workspaces with those statuses, in any grouping mode (Project / Status / PR / None).
  4. Repeat from the Workspace Board's filter menu — the same selection drives both surfaces.
  5. Delete a custom status you had filtered on (in the board) and confirm the list does not go silently empty.
  6. With a status filter active, activate/reveal a workspace whose status isn't selected and confirm it's revealed (the filter clears).
  • I manually tested these changes locally — see note under Visual Proof; automated coverage below stands in for the full manual pass on this headless run.
  • Automated tests added/updated

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 clean electron-vite renderer 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

  • Security: no new IPC surface beyond an optional string-array preference field validated by Zod.
  • Cross-platform: pure store/UI logic, no platform-specific paths or shortcuts.
  • Remote SSH: filterWorkspaceStatuses is a new optional client→host preference (backward-safe); old clients/hosts ignore it. No host-published payload changes.
  • Mobile: unaffected; mobile omits the optional field so a desktop-set value is preserved, not clobbered (status filter UI is desktop-only for now).
  • Backwards compatibility: old profiles hydrate to [] (show all). Added to the ui.set Zod schema so the schema-parity assertions hold.
  • Performance: one extra .filter() predicate over an already-materialized list; no new subscriptions in hot paths.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason — pending, see Visual Proof
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Author

  • X / Twitter: @your_handle

@PannenetsF

Copy link
Copy Markdown
Contributor Author

Precedent: this reuses the multi-select workspace-status filter model introduced for the Agent Dashboard in #11042 (agent-board-filtering.ts), extending the same workspaceStatus filtering to the sidebar list and Workspace Board. Tracking issue: #13996.

@PannenetsF

Copy link
Copy Markdown
Contributor Author
image Before image After

the project tag would be always shown

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 838a2d46-9e4c-47df-b8f4-a8c5bf4e44b6

📥 Commits

Reviewing files that changed from the base of the PR and between 4f14d6d and 0dfa941f92f640f075db47b98ceefe6e6515c797.

📒 Files selected for processing (27)
  • src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.ts
  • src/renderer/src/app-shell/use-persisted-ui-writer.ts
  • src/renderer/src/components/sidebar/SidebarFilter.tsx
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.test.tsx
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
  • src/renderer/src/components/sidebar/default-branch-visible-under-hide-sleeping.test.ts
  • src/renderer/src/components/sidebar/sidebar-filter-actions.ts
  • src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
  • src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts
  • src/renderer/src/components/sidebar/visible-worktree-kinds.ts
  • src/renderer/src/components/sidebar/visible-worktree-lineage-ancestors.ts
  • src/renderer/src/components/sidebar/visible-worktrees-status-filter.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.test.tsx
  • src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/worktree-activation-status-filter.test.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/workspace-status-filter-prune.test.ts
  • src/shared/constants.ts
  • src/shared/persisted-ui-state-types.ts
  • src/shared/workspace-statuses.test.ts
  • src/shared/workspace-statuses.ts
🚧 Files skipped from review as they are similar to previous changes (27)
  • src/renderer/src/components/sidebar/visible-worktrees-status-filter.test.ts
  • src/shared/constants.ts
  • src/shared/workspace-statuses.test.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.test.tsx
  • src/main/runtime/rpc/methods/client-ui-workspace-filter-fields.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/workspace-status-filter-prune.test.ts
  • src/renderer/src/lib/worktree-activation-status-filter.test.ts
  • src/renderer/src/components/sidebar/visible-worktree-lineage-ancestors.ts
  • src/renderer/src/components/sidebar/SidebarFilter.tsx
  • src/renderer/src/app-shell/use-persisted-ui-writer.ts
  • src/renderer/src/components/sidebar/visible-worktrees.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/sidebar/default-branch-visible-under-hide-sleeping.test.ts
  • src/renderer/src/components/sidebar/visible-worktree-kinds.ts
  • src/renderer/src/components/sidebar/worktree-list/listing/use-visible-worktrees.ts
  • src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
  • src/renderer/src/components/sidebar/use-visible-workspace-kanban-worktree-ids.ts
  • src/renderer/src/components/sidebar/sidebar-filter-actions.ts
  • src/shared/workspace-statuses.ts
  • src/shared/persisted-ui-state-types.ts
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.test.tsx
  • src/renderer/src/components/sidebar/worktree-list/listing/use-filters.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

Adds 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 0dfa9

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: filtering sidebar workspaces by card status.
Description check ✅ Passed 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 e…
Linked Issues check ✅ Passed The implementation satisfies issue #13996. It adds multi-select status filtering, supports all grouping modes and both surfaces, persists and validates selections, and clears filters when revealing or…
Out of Scope Changes check ✅ Passed The changes remain within scope. The lineage-ancestor extraction, persistence updates, tests, localization, and activation behavior directly support the workspace-status filtering feature.
Full details: Description check

Explanation

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 check

Explanation

The implementation satisfies issue #13996. It adds multi-select status filtering, supports all grouping modes and both surfaces, persists and validates selections, and clears filters when revealing or activating hidden workspaces.

Full details: Docstring Coverage

Explanation

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.

❤️ 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: 1

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx (1)

76-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Three files independently derive the same live-catalog status-selection logic. SidebarStatusFilterSection.tsx, SidebarFilter.tsx, and SidebarWorkspaceOptionsMenu.tsx each re-implement "intersect filterWorkspaceStatuses with the live workspaceStatuses catalog" 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 inline Set build with a shared helper, e.g. getLiveSelectedWorkspaceStatusIds(workspaceStatuses, filterWorkspaceStatuses): Set<WorkspaceStatus>, and keep using .has() for checked and .size for selectedCount.
  • src/renderer/src/components/sidebar/SidebarFilter.tsx#L118-L124: replace selectedStatusCount's inline .filter().length with getLiveSelectedWorkspaceStatusIds(...).size.
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx#L85-L91: replace the identical selectedStatusCount computation 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.ts
  • src/renderer/src/App.tsx
  • src/renderer/src/components/sidebar/SidebarFilter.tsx
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.test.tsx
  • src/renderer/src/components/sidebar/SidebarStatusFilterSection.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.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/use-visible-workspace-kanban-worktree-ids.ts
  • src/renderer/src/components/sidebar/visible-worktree-lineage-ancestors.ts
  • src/renderer/src/components/sidebar/visible-worktrees-status-filter.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/lib/worktree-activation-status-filter.test.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/store/slices/ui.ts
  • src/renderer/src/store/slices/workspace-status-filter-prune.test.ts
  • src/shared/constants.ts
  • src/shared/types.ts
  • src/shared/workspace-statuses.test.ts
  • src/shared/workspace-statuses.ts

@coderabbitai

coderabbitai Bot commented Aug 18, 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.

@PannenetsF

Copy link
Copy Markdown
Contributor Author

@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!

@nwparker nwparker removed the P2 label Aug 19, 2026
@coderabbitai

coderabbitai Bot commented Aug 28, 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.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a persisted multi-select workspace-status filter shared by the sidebar and Workspace Board.

  • Filters worktrees by their effective card status across grouping modes.
  • Adds status-selection UI, active-filter counts, and clear actions.
  • Sanitizes persisted selections during hydration and catalog updates.
  • Clears a hiding status filter when revealing a workspace.
  • Extracts lineage-ancestor injection without changing its structural behavior.

Confidence Score: 5/5

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

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

PannenetsF and others added 3 commits September 12, 2026 22:16
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]>
@PannenetsF
PannenetsF force-pushed the yq/serene-stonebraker-dee7b3 branch from bb6af86 to ff0759d Compare September 12, 2026 14:21
@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; its validation history keeps it as the active version.

@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.

[Feature]: Filter sidebar workspaces by card status (Todo / In progress / In review / Done)

4 participants