Repository navigation
Remember new worktree base branch selection - #139
Merged
Merged
Conversation
ymichael
added a commit
that referenced
this pull request
Jun 16, 2026
Switching New Worktree -> Working Locally -> New Worktree now re-seeds the base branch from the fresh smart remote default instead of restoring the previously-picked branch. The picked branch is scoped to the active environment and dropped whenever the scope (environment mode or project) changes. Removes the now-redundant per-environment localStorage persistence of the worktree base branch (#139): the smart default added in this PR already surfaces the fresh remote default (e.g. origin/main) on load, so remembering a stale pick only fought the "prefer fresh remote default" intent. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ymichael
added a commit
that referenced
this pull request
Jun 16, 2026
## Summary New worktrees always base off the **fresh remote default**, and that default keeps winning as you move around the composer. - Refresh remote-tracking refs before branch search so newly pushed remote branches appear without a manual `git fetch`. - Compute a smart worktree base default that uses `origin/<default>` when the local default is only behind, while keeping the local default for equal/ahead/diverged histories. - Wire the computed default through project branch responses, root-composer display/submission, and server-side managed worktree creation. - Re-seed the new-worktree base branch from that fresh default when switching environment modes (e.g. `New Worktree -> Working Locally -> New Worktree`), instead of restoring the previously-picked branch. - Drop the now-redundant per-environment localStorage persistence of the worktree base branch (previously added in #139): the smart default already surfaces `origin/main` on load, so remembering a stale pick only fought the "prefer fresh remote default" behavior. ### Note The re-seed is uniform across modes: Working Locally also re-seeds its branch (back to the current checkout) on a mode toggle, not just New Worktree. ## Validation Frontend (this change): - `pnpm exec turbo run typecheck --filter=@bb/app` - `pnpm exec turbo run test lint --filter=@bb/app` Backend (smart default, unchanged from earlier commits): - `pnpm exec turbo run typecheck --filter=@bb/host-workspace --filter=@bb/host-daemon --filter=@bb/server-contract --filter=@bb/server --filter=@bb/app` - `pnpm exec turbo run test --filter=@bb/host-workspace` - `pnpm exec turbo run test --filter=@bb/host-daemon` - `pnpm exec turbo run test --filter=@bb/server-contract` - `pnpm exec turbo run test --filter=@bb/server -- worktree-base-branch` - `pnpm exec turbo run test --filter=@bb/host-daemon-contract` - `pnpm exec turbo run test --filter=@bb/domain` - `pnpm exec turbo run test --filter=@bb/server -- public-threads.defaults thread-default-policy thread-create` --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
origin/main.origin/<default>into the first remote branch page so common refs likeorigin/mainare available without waiting for search.Search to narrow branch results.branch picker hint and its dead prop plumbing.Investigation notes
origin/mainis not in the first page, typing it can briefly show an empty/loading state before the debounced branch query returns.origin/<default>; the first page only pinned the local default branch. This PR makes the host branch response include the matching origin remote ref up front.Validation
pnpm exec turbo run test --filter=@bb/app --forcepnpm exec turbo run typecheck --filter=@bb/apppnpm exec turbo run lint --filter=@bb/apppnpm exec turbo run test --filter=@bb/host-daemon --forcepnpm exec turbo run typecheck --filter=@bb/host-daemon