Skip to content

Add default new-thread worktree mode with draft defaults#1007

Closed
notkainoa wants to merge 2 commits intopingdotgg:mainfrom
notkainoa:t3code/rework-new-worktree-thread-flow
Closed

Add default new-thread worktree mode with draft defaults#1007
notkainoa wants to merge 2 commits intopingdotgg:mainfrom
notkainoa:t3code/rework-new-worktree-thread-flow

Conversation

@notkainoa
Copy link
Contributor

@notkainoa notkainoa commented Mar 13, 2026

Add a setting to choose the default mode for new threads: Local or New worktree.

What changed

  • Added a default new-thread setting: Local or New worktree.

  • Unified the sidebar button and chat.new to use the same draft setup logic.

  • New worktree now opens as a pending draft and creates the worktree on first send.

  • chat.newLocal still always opens a local draft.

  • Reopening an unsent draft now preserves its branch and mode.

Screenshot 2026-03-09 at 12 00 20 PM
Local.vs.Worktree.for.new.thread.mp4

Note

Add default new-thread worktree mode with settings toggle and draft defaults

  • Introduces buildNewThreadDraftDefaults in threadDraftDefaults.ts to compute envMode and initial branch for new draft threads based on user preference and current git status.
  • Adds newThreadUsesNewWorktree (default false) to AppSettingsSchema in appSettings.ts, with a settings UI toggle in _chat.settings.tsx to switch between local and new-worktree modes.
  • Refactors handleNewThread in Sidebar.tsx to use computed defaults instead of manual branching/worktree overrides; the chat.newLocal shortcut forces local mode.
  • Fixes older persisted settings missing new fields by shallow-merging them with schema defaults on read.
  • Behavioral Change: new draft threads now default to local mode unless the user enables the new-worktree setting; the chat.new shortcut no longer accepts explicit branch/worktree overrides.

Macroscope summarized c55c17b. (Automatic summaries will resume when PR exits draft mode or review begins).

- add `newThreadUsesNewWorktree` app setting and Threads mode selector in Settings
- centralize new-thread draft initialization in `buildNewThreadDraftDefaults`
- make Sidebar new-thread flow use resolved defaults (with force-local shortcut support)
- backfill settings parsing for older persisted payloads and add coverage for worktree-first send flow
@github-actions github-actions bot added the size:XL 500-999 changed lines (additions + deletions). label Mar 13, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 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: af0c2422-5226-4a12-b3e7-4d37d7c8a840

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 use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

@github-actions github-actions bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Mar 13, 2026
- Stop recomputing defaults when reselecting an existing project draft thread
- Keep existing draft branch/mode context instead of resetting it in Sidebar flow
- Fallback to worktree mode with null branch when `git.status` fails
- Add tests for reopening existing drafts and git status failure handling
@juliusmarminge
Copy link
Member

juliusmarminge commented Mar 13, 2026

just merged a different PR doing this (#892) although i do think your settings UI fits more so happy to get that int

@notkainoa notkainoa 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:XL 500-999 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