From 381990d999af6676e78a03b54fce26e99cdfaa2f Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Tue, 20 Oct 2026 01:54:17 -0700 Subject: [PATCH] revert: "fix(web): keep subagent links visible in long background-work banners" (#20054) This reverts commit 3a69f7ada4cb012b8f4da580efdae72e5717bcda. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/ChatView.tsx | 3 +- .../chat/ComposerBannerStack.browser.test.tsx | 90 ------------------- .../components/chat/ComposerBannerStack.tsx | 30 ++----- 3 files changed, 10 insertions(+), 113 deletions(-) diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 8c12286a2419..78b84f00d678 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -5408,7 +5408,6 @@ export default function ChatView(props: ChatViewProps) { /> ), title: presentation.title, - descriptionPlacement: "below", description: presentation.items.length === 1 && presentation.items[0]?.childThreadId === undefined ? undefined @@ -5424,7 +5423,7 @@ export default function ChatView(props: ChatViewProps) { {separator} ) : ( - + { expect(hasDetails()).toBe(true); }); -it.each([320, 800])( - "keeps long background-work links reachable beside Stop in a %ipx composer", - async (width) => { - await page.viewport(width + 32, 800); - container.style.width = `${width}px`; - const openThread = vi.fn(); - const label = "Review the background task layout and child-thread navigation ".repeat(6); - await act(async () => - root.render( - ( - - {index > 0 ? " " : null} - openThread(index + 1)} - > - {label} - - {index < 11 ? "," : null} - - )), - actions: ( - - ), - }, - ]} - />, - ), - ); - await nextFrame(); - - const firstLink = page.getByRole("button", { name: "Open subagent 1", exact: true }); - const lastLink = page.getByRole("button", { name: "Open subagent 12", exact: true }); - const stop = page.getByRole("button", { name: "Stop", exact: true }); - expect(firstLink.element().getBoundingClientRect().height).toBeGreaterThan( - Number.parseFloat(getComputedStyle(firstLink.element()).lineHeight) * 2, - ); - const viewport = container.querySelector('[data-slot="scroll-area-viewport"]')!; - expect(viewport).not.toBeNull(); - expect(viewport.clientHeight).toBeGreaterThan(0); - expect(viewport.clientHeight).toBeLessThanOrEqual(window.innerHeight / 2); - expect(viewport.scrollHeight).toBeGreaterThan(viewport.clientHeight); - expect(viewport.scrollWidth).toBeLessThanOrEqual(viewport.clientWidth + 1); - - const scrollBounds = viewport.getBoundingClientRect(); - const stopBounds = stop.element().getBoundingClientRect(); - expect(stopBounds.top).toBe( - page.getByText("12 background tasks", { exact: true }).element().getBoundingClientRect().top, - ); - expect(scrollBounds.right).toBeLessThanOrEqual(stopBounds.left); - expect(stopBounds.right).toBeLessThanOrEqual(container.getBoundingClientRect().right); - expect(stopBounds.bottom).toBeLessThanOrEqual(scrollBounds.bottom); - expect(lastLink.element().getBoundingClientRect().top).toBeGreaterThan(scrollBounds.bottom); - await firstLink.click(); - expect(openThread).toHaveBeenLastCalledWith(1); - - viewport.scrollTop = viewport.scrollHeight; - await nextFrame(); - expect(viewport.scrollTop).toBeGreaterThan(0); - const lastBounds = lastLink.element().getBoundingClientRect(); - expect(lastBounds.top).toBeGreaterThanOrEqual(scrollBounds.top); - expect(lastBounds.bottom).toBeLessThanOrEqual(scrollBounds.bottom + 1); - expect(stop.element().getBoundingClientRect().top).toBe(stopBounds.top); - for (const control of [lastLink.element(), stop.element()]) { - const bounds = control.getBoundingClientRect(); - expect( - control.contains( - document.elementFromPoint(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2), - ), - ).toBe(true); - } - await lastLink.click(); - expect(openThread).toHaveBeenLastCalledWith(12); - }, -); - it("keeps only the usage limit attached while an active goal waits in the collapsible stack", async () => { await act(async () => root.render( diff --git a/apps/web/src/components/chat/ComposerBannerStack.tsx b/apps/web/src/components/chat/ComposerBannerStack.tsx index e2e7ecc42d0b..fc309c5352a6 100644 --- a/apps/web/src/components/chat/ComposerBannerStack.tsx +++ b/apps/web/src/components/chat/ComposerBannerStack.tsx @@ -17,7 +17,6 @@ export interface ComposerBannerStackItem { readonly icon: ReactNode; readonly title: ReactNode; readonly description?: ReactNode; - readonly descriptionPlacement?: "inline" | "below"; readonly children?: ReactNode; readonly actions?: ReactNode; readonly dismissLabel?: string; @@ -348,7 +347,6 @@ function ComposerBannerStackAlert({ ); } - const descriptionBelow = item.descriptionPlacement === "below"; return ( - + {item.icon} - + {item.description ? ( - descriptionBelow ? ( - - {item.description} - - ) : ( - - {item.description} - - ) + + {item.description} + ) : null} {item.actions || item.onDismiss ? ( - + {item.actions} {item.onDismiss ? (