Skip to content

fix(desktop): drop the hover remove button on the local main sidebar row - #6220

Merged
Kitenite merged 1 commit into
mainfrom
prevent-local-workspace-r
Aug 5, 2026
Merged

Kitenite merged 1 commit into
mainfrom
prevent-local-workspace-r

Conversation

@Kitenite

@Kitenite Kitenite commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • The local main workspace row in the v2 sidebar no longer shows the hover minus ("Remove from sidebar") button — a stray click on it removed the project's anchor row and reset the workspace's pane layout.
  • Deliberate removal is untouched: the row context menu's "Remove from Sidebar", the command palette command, and the Workspaces-page unpin all still work. Remote mains keep the minus button; worktree rows keep their close (X) button.

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

  • Bug Fixes
    • Updated workspace sidebar actions to show only the options applicable to each workspace type.
    • Local main workspaces no longer display remove or close actions.
    • Other main workspaces retain the remove option, while non-main workspaces retain the close option.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4dc72063-cf74-4511-8a62-b7462a7f27be

📥 Commits

Reviewing files that changed from the base of the PR and between 2e80a46 and 29284ab.

📒 Files selected for processing (1)
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx

📝 Walkthrough

Walkthrough

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

Changes

Local main workspace protection

Layer / File(s) Summary
Workspace action visibility
apps/desktop/src/renderer/routes/_authenticated/_dashboard/components/DashboardSidebar/components/DashboardSidebarWorkspaceItem/components/DashboardSidebarExpandedWorkspaceRow/DashboardSidebarExpandedWorkspaceRow.tsx
The component identifies local main workspaces and renders neither remove nor close actions for them. Other workspace action behavior remains unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. 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 uses conventional commit format and clearly states the main fix: preventing local main workspace removal from the v2 sidebar.
Description check ✅ Passed The description explains the problem, implementation, affected removal paths, testing, and known limitations, with only the template checklist omitted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch prevent-local-workspace-r

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.

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.
@Kitenite
Kitenite force-pushed the prevent-local-workspace-r branch from 13cf103 to 29284ab Compare August 5, 2026 23:23
@Kitenite Kitenite changed the title fix(desktop): prevent local main workspace removal from the v2 sidebar fix(desktop): drop the hover remove button on the local main sidebar row Aug 5, 2026
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents the local main workspace from being removed independently of its project while preserving removal behavior for worktrees and remote mains.

  • Hides or disables removal controls in the sidebar, command palette, and Workspaces page.
  • Adds a shared mutation guard that refuses to tombstone the local main workspace.
  • Keeps project-level removal and restoration of previously hidden local mains unchanged.

Confidence Score: 5/5

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

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: 13cf103 | Re-trigger Greptile

@Kitenite
Kitenite merged commit 5990aaa into main Aug 5, 2026
11 of 12 checks passed
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch

Thank you for your contribution! 🎉

@coderabbitai

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

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.

1 participant