Skip to content

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

Closed
binbandit wants to merge 4 commits intopingdotgg:mainfrom
binbandit:t3code/local-new-worktree-toggle
Closed

fix(web): make local/new worktree a real toggle#891
binbandit wants to merge 4 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 environment mode button with a segmented 'Local'/'New worktree' toggle in BranchToolbar

  • BranchToolbar.tsx replaces a single ghost button with a ToggleGroup containing 'Local' and 'New worktree' options, making the environment mode selection a true two-way toggle.
  • The active toggle reflects effectiveEnvMode; clicking the other option calls onEnvModeChange('local' | 'worktree'). When a worktree is already active, the label changes to 'Worktree' and both toggles are disabled.
  • extendReplacementRangeForTrailingSpace is extracted from ChatView.tsx into ChatView.logic.ts and re-exported to avoid duplication.
  • Browser tests added in BranchToolbar.browser.tsx covering the editable and locked states.

Macroscope summarized 837abe6.

@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: f3dd4296-dbb8-4797-af04-1d6e9b589946

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
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.

OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required.

@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
@juliusmarminge
Copy link
Member

sorry but this looks awful:

CleanShot 2026-03-12 at 16 36 03@2x image

@github-actions github-actions bot added the size:L 100-499 changed lines (additions + deletions). label Mar 13, 2026
@binbandit
Copy link
Contributor Author

Closing in favour of #1001

@binbandit binbandit closed this Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). 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.

2 participants