From 6b364ace85df23f448a9d58ee0051587f8e416ad Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Fri, 14 Aug 2026 00:32:29 -0700 Subject: [PATCH] Revert "fix(renderer): stop git history hover from showing two tooltips (#14468)" This reverts commit 2e91a74debba4ffbb942b9d8a4d728f9aa001234. --- .../right-sidebar/GitHistoryPanel.test.tsx | 29 ------------------- .../right-sidebar/GitHistoryRow.tsx | 12 ++++++-- tests/e2e/git-history-tooltip-wrap.spec.ts | 2 -- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/src/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsx b/src/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsx index 33fc4565527..07129f53077 100644 --- a/src/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsx +++ b/src/renderer/src/components/right-sidebar/GitHistoryPanel.test.tsx @@ -76,33 +76,4 @@ describe('GitHistoryPanel', () => { expect(markup).toContain('Fix tab overflow') expect(markup).toContain('52ad492') }) - - it('does not add native title tooltips alongside managed history tooltips', () => { - const result = makeHistoryResult() - result.items[0].references = [ - { id: 'refs/heads/main', name: 'main', category: 'branches' }, - { id: 'refs/heads/feature', name: 'feature', category: 'branches' }, - { id: 'refs/tags/v1.0.0', name: 'v1.0.0', category: 'tags' } - ] - - const markup = renderToStaticMarkup( - - ) - - expect(markup).toContain('Fix tab overflow') - expect(markup).toContain('main') - expect(markup).toContain('feature') - expect(markup).toContain('+1') - expect(markup).not.toContain('title="Fix tab overflow"') - expect(markup).not.toContain('title="main"') - expect(markup).not.toContain('title="feature"') - expect(markup).not.toContain('title="v1.0.0"') - expect(markup).not.toMatch(/\stitle=/) - }) }) diff --git a/src/renderer/src/components/right-sidebar/GitHistoryRow.tsx b/src/renderer/src/components/right-sidebar/GitHistoryRow.tsx index f2c3f020178..f41ea2f92b4 100644 --- a/src/renderer/src/components/right-sidebar/GitHistoryRow.tsx +++ b/src/renderer/src/components/right-sidebar/GitHistoryRow.tsx @@ -20,6 +20,7 @@ function GitHistoryRefBadge({ itemRef }: { itemRef: GitHistoryItemRef }): React. borderColor: itemRef.color ? graphColor(itemRef.color) : 'var(--border)', color: itemRef.color ? graphColor(itemRef.color) : 'var(--muted-foreground)' }} + title={itemRef.name} > {itemRef.name} @@ -89,7 +90,9 @@ export const GitHistoryRow = React.forwardRef( )} - {item.subject} + + {item.subject} + ( {hiddenRefs.length > 0 && ( - + ref.name).join(', ')} + > +{hiddenRefs.length} @@ -129,6 +135,7 @@ export const GitHistoryRow = React.forwardRef( {...rootProps} ref={ref as React.Ref} className={rowClassName} + title={rowTooltip} data-testid="git-history-row" > {rowContent} @@ -150,6 +157,7 @@ export const GitHistoryRow = React.forwardRef( ref={ref as React.Ref} type="button" className={rowClassName} + title={rowTooltip} aria-expanded={canExpand ? expanded : undefined} aria-label={ canExpand diff --git a/tests/e2e/git-history-tooltip-wrap.spec.ts b/tests/e2e/git-history-tooltip-wrap.spec.ts index f2f0fa50b36..6a8c4f5895b 100644 --- a/tests/e2e/git-history-tooltip-wrap.spec.ts +++ b/tests/e2e/git-history-tooltip-wrap.spec.ts @@ -73,9 +73,7 @@ test('keeps conventional commit-message lines intact in the history tooltip', as const row = orcaPage.getByTestId('git-history-row').filter({ hasText: subject }) await expect(row).toBeVisible({ timeout: 10_000 }) - await expect(row).not.toHaveAttribute('title') const trigger = row.locator('[data-slot="tooltip-trigger"]').filter({ hasText: subject }) - await expect(trigger).not.toHaveAttribute('title') await trigger.hover({ position: { x: 20, y: 10 } }) await trigger.hover({ position: { x: 40, y: 10 } })