diff --git a/src/renderer/src/components/DetachedHeadBadge.tsx b/src/renderer/src/components/DetachedHeadBadge.tsx index 461c202d8f5..bc03ce2ab52 100644 --- a/src/renderer/src/components/DetachedHeadBadge.tsx +++ b/src/renderer/src/components/DetachedHeadBadge.tsx @@ -12,13 +12,15 @@ type DetachedHeadBadgeProps = { label?: 'sidebar' | 'source-control' side?: React.ComponentProps['side'] className?: string + tabIndex?: number } export function DetachedHeadBadge({ display, label = 'source-control', side = 'right', - className + className, + tabIndex }: DetachedHeadBadgeProps): React.JSX.Element { const visibleLabel = label === 'sidebar' ? display.sidebarLabel : display.sourceControlLabel @@ -28,6 +30,7 @@ export function DetachedHeadBadge({ { expect(branchIndex).toBeGreaterThan(-1) expect(filterIndex).toBeGreaterThan(branchIndex) expect(markup).toContain('aria-label="Current branch: brennanb2025/source-control-branch-name"') + expect(markup).toContain('tabindex="0"') expect(markup).toContain('min-w-0 truncate') }) @@ -79,6 +80,7 @@ describe('SourceControlHeaderToolbar', () => { expect(markup).toContain( 'aria-label="Detached HEAD at 8cec248. You are viewing a commit, not a branch."' ) + expect(markup).toContain('tabindex="0"') expect(markup).toContain('lucide-git-commit-horizontal') }) diff --git a/src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx b/src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx index 92bdf3534d8..ef74aa4280d 100644 --- a/src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx +++ b/src/renderer/src/components/right-sidebar/source-control-header-toolbar.tsx @@ -50,7 +50,12 @@ function SourceControlGitIdentityLabel({ if (display.kind === 'detached') { return ( - + ) } @@ -66,8 +71,9 @@ function SourceControlGitIdentityLabel({