Repository navigation
Show current branch in Source Control header - #9787
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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)
✅ 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
Run ID: 36b238ec-ba7c-4325-be7c-f5501a9cdad5
📒 Files selected for processing (9)
src/renderer/src/components/right-sidebar/SourceControl.hosted-review-header-link.test.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/hosted-review-header-chrome.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.tsxsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/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
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsx (1)
22-49: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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
📒 Files selected for processing (4)
src/renderer/src/components/DetachedHeadBadge.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.test.tsxsrc/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx
|
Thank you @brennanb2025! |
…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.
* 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
…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.
Summary
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.
Checks
Review creation prerequisites live in Checks. For this unpushed branch, Checks correctly offers Publish Branch before pull-request creation.
Testing
pnpm run typecheck:webCross-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.