Skip to content

feat(source-control): show current branch without evicting Create PR - #10215

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/branch-identity-keep-create-pr
Jul 23, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/branch-identity-keep-create-pr

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

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:

⎇ brennanb2025/branch-name
[+ Create PR]        [🔍] [⋯]
 vs main  +3 −1
  • New SourceControlGitIdentityRow in source-control-header-toolbar.tsx renders above the existing toolbar row; Create PR / hosted-review / filter / overflow are unchanged.
  • Detached HEAD now renders in that same identity row via DetachedHeadBadge (re-adds the tabIndex + aria-label accessibility bits from Show current branch in Source Control header #9787), replacing the old separate below-toolbar badge row in SourceControl.tsx.
  • Re-adds the Current branch: {{value0}} i18n key across en/es/ja/ko/zh (removed by the revert).

Tests

  • New source-control-header-toolbar-identity.test.tsx locks 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, and verify:localization-catalog / verify:localization-coverage all 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 PR button coexist (the regression fix): DOM confirms both a span[aria-label="Current branch: …"] and a button reading Create PR.

branch identity + Create PR

Branch with an open PR → identity row sits above the hosted-review (PR #10215) link, filter and overflow unchanged:

branch identity + hosted review link

Detached-HEAD state is covered by unit test but not exercised on-screen here.

#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.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b76ebf92-7137-4c0e-a163-1ce02ccb8972

📥 Commits

Reviewing files that changed from the base of the PR and between d643866 and 3f1285a.

📒 Files selected for processing (2)
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar-identity.test.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar-identity.test.tsx

📝 Walkthrough

Walkthrough

Source 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 tabIndex, accessibility labeling, and label truncation. Localized current-branch strings were added for supported locales. Tests cover normal, detached, and absent identity states while verifying the “Create PR” action remains rendered.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the main change and tests, but it omits required template sections like AI Review Report, Security Audit, Notes, and a separate Screenshots section. Add the missing template sections: Summary, Screenshots, AI Review Report, Security Audit, and Notes, and include the requested checklist details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: preserving Create PR while showing current branch in Source Control.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between eb2508e and b7d6a22.

📒 Files selected for processing (9)
  • src/renderer/src/components/DetachedHeadBadge.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar-identity.test.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/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.
@brennanb2025
brennanb2025 merged commit 94d3db4 into main Jul 23, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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.
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