Repository navigation
fix(desktop): drop the hover remove button on the local main sidebar row - #6220
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe expanded workspace row now identifies local main workspaces. It hides remove and close actions for those workspaces while preserving existing actions for other workspace types. ChangesLocal main workspace protection
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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. Comment |
A stray click on the hover minus button removed the project's anchor row from the v2 sidebar. The local main workspace now renders no hover action button; deliberate removal stays available via the row context menu, the command palette, and the Workspaces page.
13cf103 to
29284ab
Compare
Greptile SummaryThe PR prevents the local main workspace from being removed independently of its project while preserving removal behavior for worktrees and remote mains.
Confidence Score: 5/5The PR appears safe to merge, with the local-main protection applied consistently across current removal surfaces and the shared mutation path. The UI predicates use local identity derived from the same machine-ID comparison as the state-layer guard, while worktree and remote-main removal behavior remains reachable.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/commandPalette/modules/workspace/commands.tsx | Suppresses the remove-from-sidebar command when the active workspace is the local main. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx | Removes the hover removal control from local-main sidebar rows while retaining existing controls for remote mains and worktrees. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarWorkspaceContextMenu/DashboardSidebarWorkspaceContextMenu.tsx | Hides local-main removal from the context menu and conditionally preserves correct menu grouping. |
| apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspaces/components/V2WorkspacesList/components/V2WorkspaceRow/V2WorkspaceRow.tsx | Disables local-main unpin actions in the Workspaces page UI and handler. |
| apps/desktop/src/renderer/routes/_authenticated/hooks/useDashboardSidebarState/useDashboardSidebarState.ts | Adds the central state-layer guard preventing local-main sidebar tombstones. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Removal request] --> B{Local main workspace?}
B -->|Yes| C[Hide or disable UI affordance]
C --> D[Mutation guard refuses tombstone]
B -->|No| E[Invoke hideWorkspaceInSidebar]
E --> F[Tombstone sidebar workspace record]
Reviews (1): Last reviewed commit: 13cf103 | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
|
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. |
Summary
Manual QA
Verified over CDP against the real dev app (before/after): with the change stashed, the local main row rendered the minus button and a click removed the row; with the change applied, the local main row renders no hover action button while the worktree row's close button and the context-menu removal path still work end-to-end.
Testing
bun run typecheck(desktop, exit 0)bun run lint(exit 0)Summary by CodeRabbit