fix(web): keep the branch toolbar in sync with the real checkout#2988
fix(web): keep the branch toolbar in sync with the real checkout#2988denniskasper wants to merge 1 commit into
Conversation
Two related toolbar reconciliation fixes: 1. Refresh VCS status (not only the ref list) when the branch combobox opens and after branch actions. Previously opening the picker reloaded the refs but left the trigger label driven by stale status, so the list could update while the label did not. 2. When git authoritatively reports a detached HEAD (on no branch — e.g. the thread's branch was deleted out from under the checkout), stop falling back to the now-dangling thread branch and show "Select ref" instead of a branch name that is not actually checked out. Related to pingdotgg#2926. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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)
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. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit edec0b7. Configure here.
| activeWorktreePath, | ||
| activeThreadBranch, | ||
| currentGitBranch, | ||
| isDetachedCheckout, |
There was a problem hiding this comment.
Stale refs defeat detached toolbar label
Medium Severity
Detached checkout is detected from loaded VCS status (refName is null), but currentGitBranch still substitutes the refs list when status returns that null via ??. The detached branch of resolveBranchToolbarValue then returns that ref-derived name, so the toolbar can keep showing a deleted or stale branch instead of Select ref.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit edec0b7. Configure here.
ApprovabilityVerdict: Needs human review An unresolved review comment identifies a potential logic bug where the detached checkout detection may not correctly display 'Select ref' due to how You can customize Macroscope's approvability policy. Learn more. |


What Changed
Two related branch-toolbar reconciliation fixes:
Related to #2926.
Why
The toolbar could display a branch you weren't on: after deleting/switching the underlying branch externally, the label kept showing the old/deleted branch (e.g.
throwaway/repro-error) even though HEAD was detached. These changes make the toolbar reflect the real checkout.UI Changes
No layout/styling change — behavioral. In detached HEAD (e.g. the thread's branch was deleted), the trigger label previously showed the stale/deleted branch name; it now shows "Select ref". The combobox also re-syncs its status when opened, so the label can't lag behind the ref list.
Checklist