Repository navigation
Conversation
📝 WalkthroughWalkthroughThe dashboard sidebar now stores per-project workspace sort modes, derives workspace notification statuses from cached terminal data, and orders workspace entries by manual order, status, creation time, or name. Automatic modes disable workspace reordering. ChangesWorkspace sorting
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant DashboardSidebarWorkspaceSortMenu
participant useDashboardSidebarState
participant DashboardSidebar
participant useV2WorkspaceNotificationStatuses
participant sortProjectChildren
User->>DashboardSidebarWorkspaceSortMenu: select sort mode
DashboardSidebarWorkspaceSortMenu->>useDashboardSidebarState: update project workspaceSortOrder
useDashboardSidebarState-->>DashboardSidebar: updated sidebar project state
DashboardSidebar->>useV2WorkspaceNotificationStatuses: request workspace statuses
useV2WorkspaceNotificationStatuses-->>DashboardSidebar: return status map
DashboardSidebar->>sortProjectChildren: sort project children
sortProjectChildren-->>DashboardSidebar: ordered workspace children
Possibly related PRs
Suggested reviewers: 🚥 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 |
|
Ready to review this PR? Stage has broken it down into 8 individual chapters for you: Chapters generated by Stage for commit e6462c2 on Jul 27, 2026 7:29pm UTC. |
cfc3d2e to
cb4911a
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.ts (1)
78-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract shared cache-subscription logic; verify the
event.typefilter divergence fromuseV2AttentionWorkspaceCount.This hook duplicates the query-cache subscription,
manualUnread/terminalSeenAtreads, andcacheVersionbump pattern already used byuseV2AttentionWorkspaceCountbelow (lines 180-219). Additionally, this hook's subscribe callback checksevent.type === "updated"(line 96) while the sibling hook's callback has noevent.typecheck at all (line 190) — same queryKey, different filter. If this divergence isn't intentional, it risks the two hooks becoming stale in different ways as the cache emits other event types (e.g.added,removed).Consider extracting a small shared hook (e.g.
useTerminalAgentBindingsCacheVersion()) that both call, so the subscription/filter logic has one source of truth.🤖 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 `@apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.ts` around lines 78 - 141, Extract the duplicated query-cache version subscription into a shared hook such as useTerminalAgentBindingsCacheVersion, and use it from both useV2WorkspaceNotificationStatuses and useV2AttentionWorkspaceCount. Centralize the terminal-agent-bindings query-key handling and event-type filter there, deciding whether updated-only or all relevant cache events are intended, so both consumers invalidate consistently. Remove each hook’s local cacheVersion state and subscription while preserving their existing manualUnread and terminalSeenAt behavior.
🤖 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.
Nitpick comments:
In
`@apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.ts`:
- Around line 78-141: Extract the duplicated query-cache version subscription
into a shared hook such as useTerminalAgentBindingsCacheVersion, and use it from
both useV2WorkspaceNotificationStatuses and useV2AttentionWorkspaceCount.
Centralize the terminal-agent-bindings query-key handling and event-type filter
there, deciding whether updated-only or all relevant cache events are intended,
so both consumers invalidate consistently. Remove each hook’s local cacheVersion
state and subscription while preserving their existing manualUnread and
terminalSeenAt behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e8f0777d-4acd-4f53-8a37-5ffbd2031a4c
📒 Files selected for processing (23)
apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/index.tsapps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/DashboardSidebar.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/DashboardSidebarProjectSection.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarCollapsedProjectContent/DashboardSidebarCollapsedProjectContent.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarExpandedProjectContent/DashboardSidebarExpandedProjectContent.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/DashboardSidebarProjectRow.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/components/DashboardSidebarWorkspaceSortMenu/DashboardSidebarWorkspaceSortMenu.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/components/DashboardSidebarProjectRow/components/DashboardSidebarWorkspaceSortMenu/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarProjectSection/hooks/useDashboardSidebarProjectSectionActions/useDashboardSidebarProjectSectionActions.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarSection/components/DashboardSidebarSectionHeader/DashboardSidebarSectionHeader.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/SortableSectionHeader/SortableSectionHeader.tsxapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/buildDashboardSidebarProjects.test.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/buildDashboardSidebarProjects.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarData/useDashboardSidebarData.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/types.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/sortProjectChildren/index.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/sortProjectChildren/sortProjectChildren.test.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/sortProjectChildren/sortProjectChildren.tsapps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/utils/testProjectFixtures.tsapps/desktop/src/renderer/routes/_authenticated/hooks/useDashboardSidebarState/useDashboardSidebarState.tsapps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.test.tsapps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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
`@apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.ts`:
- Around line 27-41: Replace the useState/useEffect subscription in
useTerminalAgentBindingsCacheVersion with a React-integrated external-store
observer such as useSyncExternalStore or useQuery, using the
terminal-agent-bindings query cache as the source. Ensure updates occurring
before passive effects are observed during render/commit so
useV2WorkspaceNotificationStatuses and useV2AttentionWorkspaceCount receive
current summaries.
🪄 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 Plus
Run ID: 5d67ef01-a75b-4ee7-b7b4-0fb2b3529f40
📒 Files selected for processing (1)
apps/desktop/src/renderer/hooks/host-service/useV2NotificationStatus/useV2NotificationStatus.ts
|
@coderabbitai review |
✅ Action performedReview finished.
|
What changed
Why
Projects can accumulate many concurrent agent workspaces. A small project-level control makes it easy to find the oldest or newest work, scan alphabetically, or bring work needing attention forward while preserving the user's hand-arranged order.
Verification
mainand resolved the new project sorting/filtering and workspace pinning integrationsbun install --frozen-lockfilebun run lint:fixbun run lint(0 warnings)bun run typecheckinapps/desktopgit diff --checkhttp://localhost:3125with CDP on9342maincoexist with the per-project workspace controlScreenshots
Sort menu
Agent status
Actionable workspace moves ahead of newer idle work while local main remains pinned.
Oldest first
Summary by CodeRabbit
New Features
Bug Fixes
Tests