From f52a2f5b43d41de6a411f66c7eb14f7c51bb511c Mon Sep 17 00:00:00 2001 From: Brandon Julio Thenaro Date: Wed, 11 Nov 2026 10:12:04 +0700 Subject: [PATCH 1/3] fix(web): share hover delays between adjacent subagent previews Subagent previews repeat the initial hover delay when scanning adjacent rows, while sidebar thread previews already share Base UI grouping. Use the existing tooltip provider around the conversation timeline and relationship panel so their rows share the warm hover window without adding timer state or changing trigger delays. Fixes pingdotgg/t3code#34144. Both focused browser regressions fail on upstream main without the providers and pass with them. The timeline regression also verifies the 200 ms first-hover delay and its return after leaving the group. vp run check:changed origin/main passed formatting, lint, both knip stages, affected type checks, 164 tests, and React Compiler coverage. Before/after Chromium captures use the actual MessagesTimeline component with synthetic subagents. --- .../chat/MessagesTimeline.browser.test.tsx | 41 ++++++++++++++++++- .../src/components/chat/MessagesTimeline.tsx | 6 +-- ...hreadRelationshipsControl.browser.test.tsx | 30 +++++++++++++- .../chat/ThreadRelationshipsControl.tsx | 6 +-- 4 files changed, 75 insertions(+), 8 deletions(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx index 0ca1f46f5d7ea..7621b9ab81ef8 100644 --- a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx @@ -2,7 +2,7 @@ import { injectHtmlRenderBootstrap } from "@t3tools/shared/htmlRender"; import { HtmlRenderDocument } from "../files/BrowserDocumentFrame"; import { flushSync } from "react-dom"; import { AudioPreview } from "../files/AudioPreview"; -import { cdp, page } from "vite-plus/test/browser"; +import { cdp, page, userEvent } from "vite-plus/test/browser"; import { ComposerContextId, EnvironmentId, @@ -1817,3 +1817,42 @@ it("keeps concurrent approvals actionable outside collapsed work and restores se .element(screen.getByRole("button", { name: "Open the current tab", exact: true })) .toBeVisible(); }); + +it("opens adjacent subagent previews without repeating the hover delay", async () => { + const entries = ["Review implementation", "Check edge cases"].map((title, index) => ({ + kind: "event" as const, + id: `hover-agent-${index}`, + createdAt: CREATED_AT, + projectedItem: v2Item("subagent", { + id: `hover-item-${index}`, + subagentId: `hover-agent-${index}`, + title, + providerInstanceId: "codex", + driver: "codex", + origin: "app_owned", + childThreadId: `child-${index}`, + result: `Result for ${title}`, + }), + })); + await using screen = await renderTimeline(entries); + await screen.getByRole("button", { name: /Worked for/ }).click(); + await screen.getByRole("button", { name: "2 subagents", exact: true }).click(); + using _timers = fakeTimers(); + const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); + await userEvent.hover(screen.getByRole("button", { name: "Open Review implementation" })); + await act(() => vi.advanceTimersByTime(199)); + expect(popup()).toBeNull(); + await act(() => vi.advanceTimersByTime(1)); + expect(popup()?.textContent).toContain("Review implementation"); + await userEvent.hover(screen.getByRole("button", { name: "Open Check edge cases" })); + await act(() => vi.advanceTimersByTime(1)); + expect(popup()?.textContent).toContain("Check edge cases"); + await userEvent.hover(screen.getByRole("button", { name: /Worked for/ })); + await act(() => vi.advanceTimersByTime(401)); + expect(popup()).toBeNull(); + await userEvent.hover(screen.getByRole("button", { name: "Open Review implementation" })); + await act(() => vi.advanceTimersByTime(199)); + expect(popup()).toBeNull(); + await act(() => vi.advanceTimersByTime(1)); + expect(popup()?.textContent).toContain("Review implementation"); +}); diff --git a/apps/web/src/components/chat/MessagesTimeline.tsx b/apps/web/src/components/chat/MessagesTimeline.tsx index 3b8db4484132d..fb638b22cb4f8 100644 --- a/apps/web/src/components/chat/MessagesTimeline.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.tsx @@ -90,7 +90,7 @@ import { } from "./MessagesTimeline.logic"; import { type ThreadFindMatch } from "./threadFind"; import { useThreadFindNavigation } from "./useThreadFindNavigation"; -import { TooltipScrollDismissArea } from "../ui/tooltip"; +import { TooltipProvider, TooltipScrollDismissArea } from "../ui/tooltip"; import { WorktreeSetupCard } from "./WorktreeSetupCard"; import { useOpenPrLink } from "~/lib/openPullRequestLink"; import { useMediaQuery } from "~/hooks/useMediaQuery"; @@ -1289,7 +1289,7 @@ const ConversationTimeline = memo(function ConversationTimeline({ } return ( - <> + {activityAnnouncer} @@ -1371,7 +1371,7 @@ const ConversationTimeline = memo(function ConversationTimeline({ - + ); }); diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx index 9679f42569c6b..3819b83b18dc6 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx @@ -56,7 +56,7 @@ vi.mock(import("../../state/use-atom-command"), () => ({ : AsyncResult.failure(Cause.fail(new Error("Connection lost")))) as never, })); -import { render } from "../../../test/render"; +import { act, fakeTimers, render } from "../../../test/render"; import { makeThreadProjectionFixture } from "../../test-fixtures"; import { ToastProvider } from "../ui/toast"; import { ThreadRelationshipsPanel } from "./ThreadRelationshipsControl"; @@ -406,3 +406,31 @@ it("hides a deleted fork and keeps unloaded and archived forks with their curren await expect.element(screen.getByText("Archived fork", { exact: true })).toBeVisible(); await expect.element(screen.getByText("deleted-fork", { exact: true })).not.toBeInTheDocument(); }); + +it("shares the hover delay between adjacent lineage rows", async () => { + setup(); + state.relatedShells = [ + { id: "source", title: "First agent", lineage: { parentThreadId: null } }, + { + id: "child", + title: "Second agent", + lineage: { parentThreadId: threadId, relationshipToParent: "fork", sideChat: false }, + }, + ]; + await using screen = await render( + , + ); + using _timers = fakeTimers(); + const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); + await userEvent.hover(screen.getByText("First agent", { exact: true })); + await act(() => vi.advanceTimersByTime(200)); + expect(popup()?.textContent).toContain("First agent"); + await userEvent.hover(screen.getByText("Second agent", { exact: true })); + await act(() => vi.advanceTimersByTime(1)); + expect(popup()?.textContent).toContain("Second agent"); +}); diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx index 102d9734ded92..753552b9be311 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.tsx @@ -84,7 +84,7 @@ import { ThreadLineageWorkflowRow } from "./ThreadLineageWorkflowRow"; import { openSideChatTab } from "../../lib/sideChatPane"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "../ui/menu"; -import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; +import { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from "../ui/tooltip"; import { toastManager } from "../ui/toast"; import { Spinner } from "../ui/spinner"; import { cn } from "~/lib/utils"; @@ -941,7 +941,7 @@ export function ThreadRelationshipsPanel(props: { }; return ( - <> + {lineageVisible ? ( ) : null} - + ); } From 9680609106b001358d3d27429e2dafc90b4eafd4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 11 Nov 2026 03:41:16 +0000 Subject: [PATCH 2/3] test(web): drop the Base UI timeout replay from the subagent hover test AI-assisted; verified with the tests and tools listed above. --- .../src/components/chat/MessagesTimeline.browser.test.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx index 7621b9ab81ef8..1efc5a552a260 100644 --- a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx @@ -1847,12 +1847,4 @@ it("opens adjacent subagent previews without repeating the hover delay", async ( await userEvent.hover(screen.getByRole("button", { name: "Open Check edge cases" })); await act(() => vi.advanceTimersByTime(1)); expect(popup()?.textContent).toContain("Check edge cases"); - await userEvent.hover(screen.getByRole("button", { name: /Worked for/ })); - await act(() => vi.advanceTimersByTime(401)); - expect(popup()).toBeNull(); - await userEvent.hover(screen.getByRole("button", { name: "Open Review implementation" })); - await act(() => vi.advanceTimersByTime(199)); - expect(popup()).toBeNull(); - await act(() => vi.advanceTimersByTime(1)); - expect(popup()?.textContent).toContain("Review implementation"); }); From e173372e6d2ddf6e4a86974ee6c9349601e6ad99 Mon Sep 17 00:00:00 2001 From: Brandon Julio Thenaro Date: Fri, 20 Nov 2026 14:50:07 +0700 Subject: [PATCH 3/3] test(web): use browser assertions for subagent hover previews Use the browser assertion API for the timeline and Lineage popup checks. Sample the open popup after each explicit clock advance so waiting for an assertion cannot bypass the hover delay under test. Both regressions fail at the adjacent preview with the providers removed. The changed-file checks pass with the providers restored, including 215 tests. Codex through T3 Code. gpt-6.2-sol - high --- .../src/components/chat/MessagesTimeline.browser.test.tsx | 8 ++++---- .../chat/ThreadRelationshipsControl.browser.test.tsx | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx index f9ceb40b0ccaf..f74523706986e 100644 --- a/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx +++ b/apps/web/src/components/chat/MessagesTimeline.browser.test.tsx @@ -2481,13 +2481,13 @@ it("opens adjacent subagent previews without repeating the hover delay", async ( await screen.getByRole("button", { name: /Worked for/ }).click(); await screen.getByRole("button", { name: "2 subagents", exact: true }).click(); using _timers = fakeTimers(); - const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); + const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); await userEvent.hover(screen.getByRole("button", { name: "Open Review implementation" })); await act(() => vi.advanceTimersByTime(199)); - expect(popup()).toBeNull(); + await expect.element(popup()).not.toBeInTheDocument(); await act(() => vi.advanceTimersByTime(1)); - expect(popup()?.textContent).toContain("Review implementation"); + await expect.element(popup()).toMatchTextContent("Review implementation"); await userEvent.hover(screen.getByRole("button", { name: "Open Check edge cases" })); await act(() => vi.advanceTimersByTime(1)); - expect(popup()?.textContent).toContain("Check edge cases"); + await expect.element(popup()).toMatchTextContent("Check edge cases"); }); diff --git a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx index 963959b94f41a..b693a5a191129 100644 --- a/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx +++ b/apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx @@ -454,13 +454,13 @@ it("shares the hover delay between adjacent lineage rows", async () => { />, ); using _timers = fakeTimers(); - const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); + const popup = () => document.querySelector('[data-slot="tooltip-popup"][data-open]'); await userEvent.hover(screen.getByText("First agent", { exact: true })); await act(() => vi.advanceTimersByTime(200)); - expect(popup()?.textContent).toContain("First agent"); + await expect.element(popup()).toMatchTextContent("First agent"); await userEvent.hover(screen.getByText("Second agent", { exact: true })); await act(() => vi.advanceTimersByTime(1)); - expect(popup()?.textContent).toContain("Second agent"); + await expect.element(popup()).toMatchTextContent("Second agent"); }); it.each([1, 18])("continues scrolling the panel past a list of %i subagents", async (count) => {