Repository navigation
feat(source-control): show current branch without evicting Create PR - #10215
Conversation
#9787 added the current-branch identity to the Source Control header but did it by replacing the Create PR button's toolbar slot, so #10032 reverted the whole thing. Create PR is the primary entry point into the stage→commit→push→generate-PR flow, so it can't be traded away. Restore the branch identity as its own row above the toolbar so it coexists with the Create PR button (Option 2 layout). Detached HEAD renders in the same identity row via DetachedHeadBadge (re-adds its tabIndex/aria-label), replacing the separate below-toolbar badge row.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughSource Control now passes Git identity data to the header toolbar, which renders either a current-branch row or a detached-head badge above existing actions. The badge supports 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 845a145c-8e44-43cf-97e3-1c9cf393f546
📒 Files selected for processing (9)
src/renderer/src/components/DetachedHeadBadge.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar-identity.test.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.tsxsrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.json
…se ref Same font-mono / 10.5px / foreground-90 / underline treatment so the current branch name reads visually consistent with the base ref in the context row.
Keeps the 'vs main' font/size/color match but no underline — the label isn't clickable, so the underline read as a false affordance.
…racts Add a stable data-testid to the identity row so the no-identity case proves no row renders, and assert the detached badge's accessible label + focusability. Addresses CodeRabbit review on #10215.
…tablyai#10215) * feat(source-control): show current branch without evicting Create PR stablyai#9787 added the current-branch identity to the Source Control header but did it by replacing the Create PR button's toolbar slot, so stablyai#10032 reverted the whole thing. Create PR is the primary entry point into the stage→commit→push→generate-PR flow, so it can't be traded away. Restore the branch identity as its own row above the toolbar so it coexists with the Create PR button (Option 2 layout). Detached HEAD renders in the same identity row via DetachedHeadBadge (re-adds its tabIndex/aria-label), replacing the separate below-toolbar badge row. * style(source-control): match branch identity text to the 'vs main' base ref Same font-mono / 10.5px / foreground-90 / underline treatment so the current branch name reads visually consistent with the base ref in the context row. * style(source-control): drop branch identity underline Keeps the 'vs main' font/size/color match but no underline — the label isn't clickable, so the underline read as a false affordance. * test(source-control): harden identity-row detached + no-identity contracts Add a stable data-testid to the identity row so the no-identity case proves no row renders, and assert the detached badge's accessible label + focusability. Addresses CodeRabbit review on stablyai#10215.
Why
#9787 added the current-branch identity to the Source Control header, but it did so by replacing the Create PR button's slot in the header toolbar. That removed the primary one-click entry point into the full stage → commit → push → generate-PR flow, so #10032 reverted the whole PR.
Per the follow-up decision: keep the branch-identity display, but restore the Create PR entry point — the two should coexist, not compete for one slot.
What
Re-add the branch identity as its own row above the toolbar (the "Option 2" layout), so it sits alongside the untouched Create PR button:
SourceControlGitIdentityRowinsource-control-header-toolbar.tsxrenders above the existing toolbar row; Create PR / hosted-review / filter / overflow are unchanged.DetachedHeadBadge(re-adds thetabIndex+aria-labelaccessibility bits from Show current branch in Source Control header #9787), replacing the old separate below-toolbar badge row inSourceControl.tsx.Current branch: {{value0}}i18n key across en/es/ja/ko/zh (removed by the revert).Tests
source-control-header-toolbar-identity.test.tsxlocks the regression: branch identity and the Create PR button both render (identity above), plus detached-HEAD and no-identity cases.typecheck:web, existing toolbar tests, andverify:localization-catalog/verify:localization-coverageall green.Verified in-app (Electron CDP)
Launched the dev build on this worktree and inspected the real rendered Source Control header.
No PR yet → branch identity row +
Create PRbutton coexist (the regression fix): DOM confirms both aspan[aria-label="Current branch: …"]and abuttonreadingCreate PR.Branch with an open PR → identity row sits above the hosted-review (
PR #10215) link, filter and overflow unchanged:Detached-HEAD state is covered by unit test but not exercised on-screen here.