From 245e5d83fd8cd2d45c5c74caedb93d3b5d3b7782 Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:44:53 -0700 Subject: [PATCH] Reduce tab preview tooltip delay to 500 ms (#33447) * Reduce tab preview tooltip delay to 500 ms * Reduce tab hover card test delay expectations --- .../components/tab-bar/TabStripTooltipProvider.test.tsx | 4 ++-- .../src/components/tab-bar/TabStripTooltipProvider.tsx | 2 +- tests/e2e/tab-hover-card.spec.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/components/tab-bar/TabStripTooltipProvider.test.tsx b/src/renderer/src/components/tab-bar/TabStripTooltipProvider.test.tsx index 798d144f541..afb35a2dde6 100644 --- a/src/renderer/src/components/tab-bar/TabStripTooltipProvider.test.tsx +++ b/src/renderer/src/components/tab-bar/TabStripTooltipProvider.test.tsx @@ -39,9 +39,9 @@ describe('TabStripTooltipProvider', () => { vi.useRealTimers() }) - it('holds the first preview until an 800 ms hover', () => { + it('holds the first preview until a 500 ms hover', () => { hover('first tab') - advance(799) + advance(499) expect(screen.queryByText('Build')).toBeNull() advance(1) expect(screen.getAllByText('Build').length).toBeGreaterThan(0) diff --git a/src/renderer/src/components/tab-bar/TabStripTooltipProvider.tsx b/src/renderer/src/components/tab-bar/TabStripTooltipProvider.tsx index 4d33ac67d00..a6ef31c64ed 100644 --- a/src/renderer/src/components/tab-bar/TabStripTooltipProvider.tsx +++ b/src/renderer/src/components/tab-bar/TabStripTooltipProvider.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react' import { TooltipProvider } from '@/components/ui/tooltip' -export const TAB_TOOLTIP_DELAY_MS = 800 +export const TAB_TOOLTIP_DELAY_MS = 500 export function TabStripTooltipProvider({ children }: { children: ReactNode }): React.JSX.Element { return ( diff --git a/tests/e2e/tab-hover-card.spec.ts b/tests/e2e/tab-hover-card.spec.ts index 0e2c560ea38..7070993bc1a 100644 --- a/tests/e2e/tab-hover-card.spec.ts +++ b/tests/e2e/tab-hover-card.spec.ts @@ -40,7 +40,7 @@ test('whole-tab hover cards wait independently on every hover', async ({ // The left padding and icon used to sit outside the terminal title's trigger. await orcaPage.mouse.move(firstBox.x + 3, firstBox.y + firstBox.height / 2) - await orcaPage.waitForTimeout(600) + await orcaPage.waitForTimeout(300) await expect(card).toHaveCount(0) await expect(cardTitle).toHaveText('Build and test the hover cards') const program = card.locator('[data-tab-hover-card-program]') @@ -50,7 +50,7 @@ test('whole-tab hover cards wait independently on every hover', async ({ const programBox = await program.boundingBox() expect(programBox?.y).toBeGreaterThan((titleBox?.y ?? 0) + (titleBox?.height ?? 0)) await orcaPage.mouse.move(secondBox.x + 3, secondBox.y + secondBox.height / 2) - await orcaPage.waitForTimeout(600) + await orcaPage.waitForTimeout(300) await expect(card).toHaveCount(0) await expect(cardTitle).toHaveText('Review changes') @@ -64,7 +64,7 @@ test('whole-tab hover cards wait independently on every hover', async ({ await expect(card).toHaveCount(0) await orcaPage.mouse.move(firstBox.x + 3, firstBox.y + firstBox.height / 2) - await orcaPage.waitForTimeout(600) + await orcaPage.waitForTimeout(300) await expect(card).toHaveCount(0) await expect(cardTitle).toHaveText('Build and test the hover cards') @@ -72,7 +72,7 @@ test('whole-tab hover cards wait independently on every hover', async ({ await orcaPage.mouse.move(firstBox.x + 3, firstBox.y + firstBox.height + 100) await expect(card).toHaveCount(0) await orcaPage.mouse.move(firstBox.x + 3, firstBox.y + firstBox.height / 2) - await orcaPage.waitForTimeout(600) + await orcaPage.waitForTimeout(300) await expect(card).toHaveCount(0) await expect(cardTitle).toHaveText('Build and test the hover cards')