Skip to content

fix(web): add default thread env mode setting#892

Open
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/default-worktree-mode-toggle
Open

fix(web): add default thread env mode setting#892
binbandit wants to merge 2 commits intopingdotgg:mainfrom
binbandit:t3code/default-worktree-mode-toggle

Conversation

@binbandit
Copy link
Contributor

@binbandit binbandit commented Mar 11, 2026

Summary

  • add a persisted app setting for the default draft-thread environment mode
  • use that setting when creating new draft threads so users do not need to re-toggle New worktree on each new thread
  • add tests covering app-settings persistence and backward-compatible defaults

Why

New draft threads always defaulted to local, even if a user consistently works in New worktree mode. The existing toggle only changed the current draft thread, so users had to repeat the same interaction on every new thread.

The right scope here is app-level persistence, not more draft-local state. That keeps existing thread behavior unchanged, preserves explicit overrides, and only affects brand-new draft thread creation.

Changes

  • extend web app settings with defaultThreadEnvMode
  • add a Settings toggle under Threads to switch the default between Local and New worktree
  • update sidebar new-thread creation to honor the persisted default unless an explicit envMode is already supplied
  • add tests for defaulting, invalid persisted values, and persisted worktree mode

UI changes

Screenshot 2026-03-11 at 7 56 24 pm

Validation

  • bun run test src/appSettings.test.ts src/composerDraftStore.test.ts in apps/web
  • bun fmt
  • bun lint
  • bun typecheck

Note

Add configurable default thread environment mode setting to the sidebar and settings UI

  • Adds a defaultThreadEnvMode field ('local' | 'worktree', default 'local') to AppSettingsSchema.
  • Exposes a new "Threads" section in _chat.settings.tsx with a toggle and restore-default button for this setting.
  • Updates Sidebar.tsx to use defaultThreadEnvMode when creating new threads instead of a hardcoded 'local'; the local-new-thread keyboard shortcut continues to force 'local'.
  • Adds resolveSidebarNewThreadEnvMode to resolve the env mode using an explicit request or fall back to the app default.
  • Behavioral Change: new threads created via project creation and the sidebar button now respect the user-configured default instead of always using 'local'.

Macroscope summarized 000ce3a.

@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: 840db564-e1c9-4dd8-95b3-d906de36b2cd

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 Add default thread env mode setting fix(web): add default thread env mode setting 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