feat: persist workspace rail selection#1050
Conversation
|
Warning Review limit reached
More reviews will be available in 35 minutes and 28 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds workspace ChangesWorkspace Archive, Metadata, and Active Filtering
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Code Review
This pull request introduces workspace rail metadata and soft archiving functionality, updating the database schema, API endpoints, and frontend components to support these new features. The feedback highlights an accessibility regression caused by moving the rename trigger to a double-click, which prevents keyboard-only users from renaming workspaces, and suggests adding a dedicated rename button instead. Additionally, the feedback recommends cleaning up the unused deleteMutation and its pending state check since deletion has been replaced by archiving.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| type="button" | ||
| className="workspace-bar__name" | ||
| disabled={busy} | ||
| onClick={() => { | ||
| onClick={onSelect} | ||
| onDoubleClick={() => { | ||
| setDraft(workspace.name); | ||
| setEditing(true); | ||
| }} | ||
| title="rename" | ||
| title="select workspace; double-click to rename" | ||
| > | ||
| {workspace.name} | ||
| </button> |
There was a problem hiding this comment.
Moving the rename trigger from onClick to onDoubleClick introduces an accessibility regression. Keyboard-only users who navigate using Tab and activate buttons using Enter or Space will only trigger the onClick (onSelect) handler, leaving them with no way to rename a workspace. Removing onDoubleClick here and adding a dedicated rename button to the row actions solves this issue.
type="button"
className="workspace-bar__name"
disabled={busy}
onClick={onSelect}
title="select workspace"
>
{workspace.name}
</button>
| type="button" | ||
| className="workspace-bar__icon-btn workspace-bar__icon-btn--danger" | ||
| disabled={busy} | ||
| onClick={onDelete} | ||
| aria-label={`delete ${workspace.name}`} | ||
| title="delete workspace" | ||
| onClick={onArchive} | ||
| aria-label={`archive ${workspace.name}`} | ||
| title="archive workspace" | ||
| > | ||
| × | ||
| </button> |
There was a problem hiding this comment.
Add a dedicated rename button to the row actions. This ensures that both mouse and keyboard users can trigger the workspace rename flow reliably.
type="button"
className="workspace-bar__icon-btn"
disabled={busy}
onClick={() => {
setDraft(workspace.name);
setEditing(true);
}}
aria-label={`rename ${workspace.name}`}
title="rename workspace"
>
✎
</button>
<button
type="button"
className="workspace-bar__icon-btn workspace-bar__icon-btn--danger"
disabled={busy}
onClick={onArchive}
aria-label={`archive ${workspace.name}`}
title="archive workspace"
>
×
</button>
| invalidate, | ||
| createMutation, | ||
| updateMutation, | ||
| archiveMutation, | ||
| deleteMutation, | ||
| } = useIaWorkspaces(); |
There was a problem hiding this comment.
| const pending = | ||
| createMutation.isPending || | ||
| updateMutation.isPending || | ||
| archiveMutation.isPending || | ||
| deleteMutation.isPending || | ||
| reordering; |
There was a problem hiding this comment.
Remove deleteMutation.isPending from the pending state check since deleteMutation is no longer used in this component.
| const pending = | |
| createMutation.isPending || | |
| updateMutation.isPending || | |
| archiveMutation.isPending || | |
| deleteMutation.isPending || | |
| reordering; | |
| const pending = | |
| createMutation.isPending || | |
| updateMutation.isPending || | |
| archiveMutation.isPending || | |
| reordering; |
|
Review verdict: changes requested for PR #1050 at exact head 3c1c755. Blocker:
Non-blocking cleanup:
Bot feedback triage:
Scope / closure:
Verification run by reviewer:
|
|
Review verdict: changes requested for PR #1050 at exact head cd88c7e. Blocker:
Non-blocking observations:
Bot feedback triage:
Evidence checked:
|
|
Review verdict: approved for PR #1050 at exact head ee994f5. Blockers: none. Review focus:
Bot feedback triage:
Evidence inspected:
Scope/closure recommendation: approved; keep |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/components/WorkspaceBar.tsx (1)
102-111: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winExpose the current workspace filter state to assistive tech.
The new selection is only conveyed by
workspace-bar__row--selected. Screen readers won't know whether a workspace or all is currently active, so the filter state disappears outside the visual styling. Addaria-pressedor an equivalent state announcement on these buttons.Possible fix
<button type="button" className="workspace-bar__name" disabled={busy} onClick={onSelect} onDoubleClick={startEditing} + aria-pressed={selected} title="select workspace; double-click or tab to rename action to edit" > {workspace.name} </button><button type="button" className="workspace-bar__all-btn" disabled={pending || activeWorkspaceId === null} onClick={() => setActiveWorkspaceId(null)} + aria-pressed={activeWorkspaceId === null} > all </button>Also applies to: 283-290, 308-310
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/components/WorkspaceBar.tsx` around lines 102 - 111, The workspace selection state is only reflected visually in WorkspaceBar, so assistive tech can’t tell which filter is active. Update the relevant button elements in WorkspaceBar (including the workspace/all selectors around the referenced button blocks) to expose the active state with aria-pressed or an equivalent accessible state. Use the existing selection logic in WorkspaceBar to keep the ARIA state in sync with the current filter, without changing the click/double-click behavior.
🧹 Nitpick comments (1)
test/ia-workspace-router.test.ts (1)
233-241: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert that
/restoremakes the workspace visible in the default list again.This test proves the restore response payload, but not the router contract that default
GET /hub/ia/workspacesincludes restored rows again. A restore handler that only returnsstatus: 'active'could still pass here.Suggested test addition
expect(restored.status).toBe(200); expect( ((await restored.json()) as { workspace: Workspace }).workspace.status ).toBe('active'); + expect( + ( + (await (await fetch(`${baseUrl}${WS}`)).json()) as { + workspaces: Workspace[]; + } + ).workspaces.map((w) => w.id) + ).toEqual([created.workspace.id]); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/ia-workspace-router.test.ts` around lines 233 - 241, The restore test only checks the `/restore` response payload, so it misses the router contract that restored workspaces reappear in the default `GET /hub/ia/workspaces` listing. In `ia-workspace-router.test.ts`, after calling the restore endpoint and verifying the workspace is active, add an assertion using the existing list fetch flow to confirm the restored workspace ID is present again in the default workspace list.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/components/WorkspaceBar.tsx`:
- Around line 174-177: The persisted active workspace selection in WorkspaceBar
can become stale when the saved id no longer exists in the loaded workspaces,
causing ViewSpineTree to show an empty filtered view. Add a reconciliation step
in WorkspaceBar after the workspaces query finishes successfully: compare
activeWorkspaceId from useUiStore against the loaded workspaces, and if it is
missing or archived, clear it by calling setActiveWorkspaceId so the UI falls
back to the all view.
In `@server/features/ia-workspace-router.ts`:
- Around line 148-159: The fallback order calculation in the workspace create
flow is using only active rows via iaStore.listWorkspaces(), which can miss
archived workspaces and cause duplicate order values later. Update the create
path in ia-workspace-router to compute nextOrder from all workspaces instead of
the default active-only list, using the same nextOrder helper but with a
full-workspace source so archived rows are included.
---
Outside diff comments:
In `@frontend/src/components/WorkspaceBar.tsx`:
- Around line 102-111: The workspace selection state is only reflected visually
in WorkspaceBar, so assistive tech can’t tell which filter is active. Update the
relevant button elements in WorkspaceBar (including the workspace/all selectors
around the referenced button blocks) to expose the active state with
aria-pressed or an equivalent accessible state. Use the existing selection logic
in WorkspaceBar to keep the ARIA state in sync with the current filter, without
changing the click/double-click behavior.
---
Nitpick comments:
In `@test/ia-workspace-router.test.ts`:
- Around line 233-241: The restore test only checks the `/restore` response
payload, so it misses the router contract that restored workspaces reappear in
the default `GET /hub/ia/workspaces` listing. In `ia-workspace-router.test.ts`,
after calling the restore endpoint and verifying the workspace is active, add an
assertion using the existing list fetch flow to confirm the restored workspace
ID is present again in the default workspace list.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5b1a8c7-6ce8-46d1-bdbf-aa7ffe64ebe8
📒 Files selected for processing (10)
frontend/src/components/ViewSpineTree.tsxfrontend/src/components/WorkspaceBar.cssfrontend/src/components/WorkspaceBar.tsxfrontend/src/lib/api.tsfrontend/src/lib/hooks/use-ia-workspaces.tsserver/features/ia-workspace-router.tsserver/ia-store.tsshared/workspace.tstest/ia-store.test.tstest/ia-workspace-router.test.ts
|
Review verdict: approve for PR #1050 at exact head 3faabff. Blockers: none. Why this passes:
Evidence reviewed:
Bot feedback + learning:
|
|
Review verdict: changes requested for PR #1050 at exact head 478318e. Blocker:
Non-blocking concerns:
What passes:
Bot feedback triage:
Evidence inspected:
Bot feedback + learning:
|
Refs #1043
Summary
Verification
Simplify
Summary by CodeRabbit
New Features
Bug Fixes