Skip to content

feat(vcs): let worktrees check out an existing branch - #8

Merged
Fryuni merged 3 commits into
mainfrom
t3code/worktree-checkout-existing-branch-toggle
Sep 14, 2026
Merged

Fryuni merged 3 commits into
mainfrom
t3code/worktree-checkout-existing-branch-toggle

Conversation

@Fryuni

@Fryuni Fryuni commented Sep 14, 2026

Copy link
Copy Markdown
Owner

What Changed

Worktree mode can now check out an existing local branch instead of always minting a new t3code/* branch.

  • Added a "Create new branch" toggle to the worktree branch picker on web (branch selector in the branch toolbar) and mobile (new task flow). With it off, selecting a branch creates the worktree checked out at that branch.
  • createWorktree on the server accepts an existing local branch when no new ref name is supplied, and fails with a clear error for remote refs or branches already checked out in another worktree.
  • "Start from origin" is disabled and ignored when not creating a branch; the server skips the origin fetch/resolve path and just adds the worktree at the branch.
  • Branch rows that are remote, current, or already checked out are disabled while choosing a worktree base with the toggle off.
  • The createNewBranch flag flows through composer drafts, the queued-message outbox, prepareWorktree bootstrap, and thread metadata updates. User docs updated.

Why

Worktree mode previously forced a fresh temporary branch, so starting work on an existing feature branch meant creating the worktree by hand. This makes "open a worktree on branch X" a first-class choice while keeping the new-branch behavior as the default, with guards so git never tries to check out a branch that is already in use.

UI Changes

Before/after screenshots of the branch picker with the new "Create new branch" toggle (on and off states) will be attached. No motion or interaction timing changed.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Built with GLM (glm-5.3-flash) via opencode.

- add a Create new branch toggle in the worktree branch picker (web and mobile)
- when off, the selected local branch is checked out directly and busy/remote refs are disabled
- skip origin fetch and branch creation when reusing an existing branch
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T17:27:48.753049Z 7495409 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c21de80f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/components/BranchToolbarBranchSelector.tsx Outdated
@Fryuni

Fryuni commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

[from Codex]: @codex review

The previous finding is addressed in c46427e. Please review the updated PR and confirm whether any issues remain.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c46427ec7c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/components/ChatView.logic.ts Outdated
@Fryuni

Fryuni commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

[from Codex]: @codex review

The background-draft finding is fixed in 7495409. Both review threads have been addressed. Please review the latest commit and confirm whether any issues remain.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 74954099cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Fryuni
Fryuni merged commit 3aa3bf4 into main Sep 14, 2026
@Fryuni
Fryuni deleted the t3code/worktree-checkout-existing-branch-toggle branch September 14, 2026 17:28
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