Skip to content

fix(web): make local/new worktree a real toggle#891

Open
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/local-new-worktree-toggle
Open

fix(web): make local/new worktree a real toggle#891
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/local-new-worktree-toggle

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 11, 2026

Summary

  • replace the branch toolbar mode button with a real two-state toggle for Local and New worktree
  • keep the selected mode visible when the environment is locked or already attached to a worktree
  • add a focused browser test for the toggle interaction and locked-state rendering

Validation

  • bun fmt
  • bun lint
  • bun typecheck
  • cd apps/web && bun run test
  • cd apps/web && bun run test:browser src/components/BranchToolbar.browser.tsx

Before and After

Before

Screenshot 2026-03-11 at 7 54 56 pm

After

Screenshot 2026-03-11 at 7 53 11 pm

Note

Replace single env mode button in BranchToolbar with a Local/New worktree segmented toggle

  • Replaces the previous single Button or static span with a ToggleGroup containing two Toggle controls labeled 'Local' and 'New worktree' (changing to 'Worktree' when a worktree is already active).
  • Both toggles are disabled when envLocked is true or a worktree is already active; onEnvModeChange fires only when a different valid mode is selected.
  • Adds FolderIcon and GitBranchPlusIcon inside icon chips for visual differentiation.
  • Adds browser-based Vitest tests in BranchToolbar.browser.tsx covering toggle rendering and disabled state when envLocked is set.

Macroscope summarized 198c5e8.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 282fa9f5-57b2-4dee-a595-941488f9c1e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 11, 2026
@binbandit binbandit changed the title Make Local/New worktree a real toggle fix(web): make local/new worktree a real toggle Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant