Fix worktree base branch updates for active draft#1900
Conversation
- Route branch selection to the active draft session - Prevent draft branch sync from overwriting an in-progress worktree setup - Add coverage for the draft-specific branch selector flow
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityA prior Macroscope approval was dismissed. Re-evaluating efce830… No code changes detected at |
- Replace unsafe DraftId construction with the draft ID helper type - Keep the base-branch session parity test aligned with active draft routing
Dismissing prior approval to re-evaluate ace12af
- Build draft session IDs with `draftIdFromPath` - Keep the active draft route selection test aligned with runtime behavior
Dismissing prior approval to re-evaluate efce830
What Changed
Why
UI Changes
Checklist
Note
Medium Risk
Touches branch/worktree synchronization logic for draft threads; mistakes could cause incorrect branch context or unexpected worktree setup behavior, but changes are localized and covered by new tests.
Overview
Fixes draft worktree routing so branch/base-branch changes act on the active draft route session when a
draftIdis present, instead of resolving drafts only bythreadRef(applies toBranchToolbar,BranchToolbarBranchSelector, andGitActionsControl).Threads
draftIdfromChatView→ChatHeader→GitActionsControl, adds anisSelectingWorktreeBaseguard to prevent automatic branch sync from overwriting user selection while a worktree draft is being configured, and adds browser tests covering the draft-specific branch selector flow and the non-overwrite behavior.Reviewed by Cursor Bugbot for commit 8490aff. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix base branch updates for active worktree draft session in branch toolbar
BranchToolbar,BranchToolbarBranchSelector,GitActionsControl, andChatHeadernow accept adraftIdprop and usegetDraftSession(draftId)to scope branch changes to the active draft route session rather than the thread-scoped draft.GitActionsControlsuppresses automatic branch syncing when a worktree draft is being configured (no server thread, noworktreePath), preventing a preselected base branch from being overwritten.Macroscope summarized 8490aff.