fix(desktop): expand collapsed sections when cycling workspaces via keyboard#3848
fix(desktop): expand collapsed sections when cycling workspaces via keyboard#3848saddlepaddle merged 1 commit intomainfrom
Conversation
…eyboard Meta+Alt+Up/Down (and the ⌘1..9 jump shortcuts) cycle through every workspace in the sidebar regardless of collapse state, but the destination row stayed hidden when its parent project or section was collapsed. Toggle the collapsed parents open before navigating so the focused workspace is visible.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughEnhanced keyboard navigation in the dashboard sidebar by adding automatic workspace reveal functionality. When users navigate via hotkeys or direct selection, collapsed parent sections and projects now automatically expand to display the destination workspace in the UI. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Greptile SummaryThis PR fixes a UX bug where navigating to a workspace via keyboard shortcuts (⌘⌥↑/⌘⌥↓, ⌘1–9) would land on a workspace that remained visually hidden inside a collapsed project or section. The fix builds a Confidence Score: 5/5Safe to merge — logic is correct, toggle guards prevent spurious state flips, and all shortcut paths are covered. No P0 or P1 findings. The No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/hooks/useDashboardSidebarShortcuts/useDashboardSidebarShortcuts.ts | Adds workspaceLocations memo and revealWorkspace callback to expand collapsed project/section ancestors before keyboard-shortcut navigation; logic is sound and toggle guards are correct. |
Sequence Diagram
sequenceDiagram
participant User
participant Hotkey as useHotkey (NEXT/PREV/JUMP)
participant Hook as useDashboardSidebarShortcuts
participant Locations as workspaceLocations (memo)
participant State as useDashboardSidebarState
participant Router as navigateToV2Workspace
User->>Hotkey: ⌘⌥↓ / ⌘1..9
Hotkey->>Hook: switchToWorkspace(index) or prev/next handler
Hook->>Locations: get(workspaceId) → { projectIsCollapsed, sectionId, sectionIsCollapsed }
alt project is collapsed
Hook->>State: toggleProjectCollapsed(projectId)
State-->>Hook: project.isCollapsed = false
end
alt section exists and is collapsed
Hook->>State: toggleSectionCollapsed(sectionId)
State-->>Hook: section.isCollapsed = false
end
Hook->>Router: navigateToV2Workspace(workspaceId, navigate)
Router-->>User: workspace visible + highlighted
Reviews (1): Last reviewed commit: "fix(desktop): expand collapsed sections ..." | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Test plan
Summary by cubic
Expands collapsed projects/sections when navigating to a workspace via ⌘⌥↑/↓ or ⌘1..9 so the destination is always visible in the sidebar.
useDashboardSidebarState(no re-toggle if already expanded).Written for commit ff27e23. Summary will update on new commits. Review in cubic
Summary by CodeRabbit