Skip to content

refactor(desktop): remove branch switcher from main workspace sidebar#1327

Merged
Kitenite merged 1 commit into
mainfrom
kitenite/remove-branch-switcher-and-terminal-nav
Feb 9, 2026
Merged

refactor(desktop): remove branch switcher from main workspace sidebar#1327
Kitenite merged 1 commit into
mainfrom
kitenite/remove-branch-switcher-and-terminal-nav

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Feb 9, 2026

Summary

  • Remove the branch switcher dropdown from the main workspace (branch workspace) in the sidebar
  • Clean up related backend tRPC procedures that are no longer called

Changes

  • Deleted BranchSwitcher component — the dropdown UI for switching branches on the main workspace
  • Deleted procedures/branch.ts — contained getBranches and switchBranchWorkspace tRPC procedures, only used by the removed component
  • Updated workspaces.ts router — removed branch procedures import and registration
  • Updated create.ts — removed now-misleading "Use the branch switcher" error message
  • Updated barrel export — removed BranchSwitcher from components/index.ts

Test Plan

  • Verify sidebar renders correctly for branch workspaces (no branch switcher button)
  • Verify sidebar renders correctly for worktree workspaces (unchanged)
  • Verify creating a new branch workspace still works via the sidebar footer
  • Typecheck passes (bun run typecheck --filter=@superset/desktop)

Summary by CodeRabbit

  • Removed Features

    • Removed branch switching dropdown UI from workspace sidebar
    • Removed branch workspace switching and management capabilities
  • Changes

    • Simplified error messaging when creating workspaces with explicit branch selection

The branch switcher dropdown in the sidebar for branch workspaces is no
longer needed. This removes the UI component and its supporting backend
tRPC procedures (getBranches, switchBranchWorkspace).
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

This PR removes the branch-switching feature from both the backend tRPC router and frontend UI. It deletes the branch procedures module, eliminates the BranchSwitcher React component, removes associated router configuration, and simplifies an error message in workspace creation logic.

Changes

Cohort / File(s) Summary
Branch procedures removal
apps/desktop/src/lib/trpc/routers/workspaces/procedures/branch.ts, apps/desktop/src/lib/trpc/routers/workspaces/workspaces.ts
Deleted branch.ts router with getBranches query and switchBranchWorkspace mutation; removed branch procedures import and aggregation from main workspaces router.
Branch UI component removal
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/components/BranchSwitcher/BranchSwitcher.tsx, apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/components/BranchSwitcher/index.ts, apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/components/index.ts, apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/WorkspaceListItem.tsx
Removed entire BranchSwitcher component (219 lines), deleted component and barrel exports, and removed BranchSwitcher usage from WorkspaceListItem rendering.
Error message simplification
apps/desktop/src/lib/trpc/routers/workspaces/procedures/create.ts
Shortened error message in createBranchWorkspace when explicit branch conflicts with main workspace branch; no logic flow changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A bunching of branches, once swift to behold,
Now trimmed from the repo, their story retold.
The switcher hops off, the procedures depart,
Simpler workspaces take root in the heart! 🌱

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: removing the branch switcher component from the workspace sidebar UI.
Description check ✅ Passed The description provides a clear summary, detailed changes list, and test plan, covering all critical aspects of the refactoring.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/remove-branch-switcher-and-terminal-nav

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/WorkspaceListItem/WorkspaceListItem.tsx (1)

414-414: ⚠️ Potential issue | 🟡 Minor

Stale comment references removed component.

The biome-ignore justification still mentions BranchSwitcher as a reason for not using <button>. The suppression itself is still valid (the close button is still nested), but the comment text should be updated.

✏️ Suggested fix
-		// biome-ignore lint/a11y/useSemanticElements: Can't use <button> because this contains nested buttons (BranchSwitcher, close button)
+		// biome-ignore lint/a11y/useSemanticElements: Can't use <button> because this contains nested interactive elements (close button, diff stats)

@Kitenite Kitenite merged commit 4b68bd8 into main Feb 9, 2026
6 checks passed
@Kitenite Kitenite deleted the kitenite/remove-branch-switcher-and-terminal-nav branch February 9, 2026 01:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 9, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

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