Skip to content

Show current branch in Source Control header - #9787

Merged
brennanb2025 merged 5 commits into
mainfrom
brennanb2025/source-control-branch-name
Jul 22, 2026
Merged

brennanb2025 merged 5 commits into
mainfrom
brennanb2025/source-control-branch-name

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • show the current branch as the leading identity in the Source Control header
  • show detached HEAD in that same identity slot as a compact commit badge
  • remove hosted-review chrome and the duplicate Create PR action from the Source Control header
  • keep review creation in the dedicated Checks tab, including its publish/sync prerequisites and recovery states
  • truncate long identities while preserving the full value for assistive technology and tooltips

Screenshots

Captured from the real Electron dev build with an isolated, unpushed test branch.

Source Control

The header contains branch identity, filter, and overflow controls—no Create PR action.

Source Control showing the current branch without a Create PR header action

Checks

Review creation prerequisites live in Checks. For this unpushed branch, Checks correctly offers Publish Branch before pull-request creation.

Checks showing the Publish Branch prerequisite before pull-request creation

Testing

  • 58 focused Source Control header and Checks review-creation tests
  • pnpm run typecheck:web
  • targeted Oxlint and Oxfmt checks
  • React Doctor changed-file check
  • max-lines ratchet, reliability gates, styled-scrollbar, and localization-catalog checks
  • real Electron dev build: branch identity visible, zero Create PR header buttons, Checks publish prerequisite visible
  • renderer console: zero errors during the verified flow
  • PR Checks CI is running for the latest commit

Cross-platform, SSH, and security

This is render-only UI and changes no shortcut, path, Git command, host routing, network, IPC, authentication, or persistence behavior. Branch names and commit identities are rendered as escaped React text. The existing identity and hosted-review paths continue to support native, WSL, and SSH-backed worktrees.

Notes

No Linear issue is linked to this worktree.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The collapsed Source Control toolbar now receives and displays the current branch with a branch icon, tooltip, accessible label, truncation styling, and localized text. Hosted-review header integration and its checks-tab callback were removed, along with renderer-specific create-PR header wiring. Static-markup tests cover branch ordering, accessibility attributes, truncation, and detached HEAD behavior. Current-branch translations were added for English, Spanish, Japanese, Korean, and Chinese.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, screenshots, testing, and notes, but it lacks the required dedicated AI Review Report and Security Audit sections. Add separate AI Review Report and Security Audit sections that summarize risks checked, findings, and any follow-up or verification done.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title matches the main change: showing the current branch in the Source Control header.
✨ 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

Run ID: 36b238ec-ba7c-4325-be7c-f5501a9cdad5

📥 Commits

Reviewing files that changed from the base of the PR and between 4254357 and 1f6910c.

📒 Files selected for processing (9)
  • src/renderer/src/components/right-sidebar/SourceControl.hosted-review-header-link.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/hosted-review-header-chrome.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx
  • 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
💤 Files with no reviewable changes (3)
  • src/renderer/src/components/right-sidebar/hosted-review-header-chrome.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.hosted-review-header-link.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json

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

🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsx (1)

22-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the retained Create PR header action.

This helper always passes visibleCreatePrHeaderAction={null}, so the changed Create PR rendering branch is untested. Add a case with a non-null action and assert that the button remains in the collapsed toolbar.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eec4d85e-0907-4c38-9ec2-77a1e0183e30

📥 Commits

Reviewing files that changed from the base of the PR and between 1f6910c and 2b2e756.

📒 Files selected for processing (4)
  • src/renderer/src/components/DetachedHeadBadge.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsx
  • src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx

@brennanb2025
brennanb2025 merged commit 56a31a5 into main Jul 22, 2026
1 check passed
AmethystLiang added a commit that referenced this pull request Jul 23, 2026
gal064 pushed a commit to gal064/orca that referenced this pull request Jul 23, 2026
@hatton

hatton commented Jul 23, 2026

Copy link
Copy Markdown

Thank you @brennanb2025!

brennanb2025 added a commit that referenced this pull request Jul 23, 2026
…10215)

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

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

* 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 #10215.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* feat(source-control): show current branch in header

* fix(source-control): keep header focused on branch

* fix(source-control): compact detached head identity

* fix(source-control): make branch identity keyboard accessible

* fix(source-control): keep create review in checks
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.

2 participants