The best way to control Claude Code, Codex and more from any computer or phone
revert: "fix(web): keep subagent links visible in long background-work banners" (#20054) (#22228)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 20, 2026 at 02:02 UTC
bd659881876e2d2b9be0c48817dfedc283a0df89
3 files changed
+10
-113
apps/web/src/components/ChatView.tsx
+1
-2
@@ -5406,7 +5406,6 @@ export default function ChatView(props: ChatViewProps) {
5406
/>
5407
),
5408
title: presentation.title,
5409
- descriptionPlacement: "below",
5409
description:
5410
presentation.items.length === 1 && presentation.items[0]?.childThreadId === undefined
5411
? undefined
@@ -5422,7 +5421,7 @@ export default function ChatView(props: ChatViewProps) {
5421
{separator}
5422
</>
5423
) : (
5425
- <span>
5424
+ <span className="whitespace-nowrap">
5425
<InlineButton
5426
tone="muted"
5427
aria-label={`${presentation.items.length === 1 ? "Show" : "Open"} subagent ${item.label}`}
apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
-90
@@ -5,8 +5,6 @@ import { createRoot, type Root } from "react-dom/client";
5
import { afterEach, beforeEach, expect, it, vi } from "vite-plus/test";
6
import { page, userEvent } from "vite-plus/test/browser";
7
8
-import { Button, InlineButton } from "../ui/button";
9
-
8
import { ComposerBannerStack } from "./ComposerBannerStack";
9
10
let root: Root;
@@ -62,94 +60,6 @@ it("only offers notice details when the description cannot fit", async () => {
60
expect(hasDetails()).toBe(true);
61
});
62
65
-it.each([320, 800])(
66
- "keeps long background-work links reachable beside Stop in a %ipx composer",
67
- async (width) => {
68
- await page.viewport(width + 32, 800);
69
- container.style.width = `${width}px`;
70
- const openThread = vi.fn();
71
- const label = "Review the background task layout and child-thread navigation ".repeat(6);
72
- await act(async () =>
73
- root.render(
74
- <ComposerBannerStack
75
- items={[
76
- {
77
- id: "background-work",
78
- variant: "default",
79
- priority: "activity",
80
- icon: null,
81
- title: "12 background tasks",
82
- descriptionPlacement: "below",
83
- description: Array.from({ length: 12 }, (_, index) => (
84
- <span key={index}>
85
- {index > 0 ? " " : null}
86
- <InlineButton
87
- tone="muted"
88
- aria-label={`Open subagent ${index + 1}`}
89
- onClick={() => openThread(index + 1)}
90
- >
91
- {label}
92
- </InlineButton>
93
- {index < 11 ? "," : null}
94
- </span>
95
- )),
96
- actions: (
97
- <Button size="xs" variant="ghost">
98
- Stop
99
- </Button>
100
- ),
101
- },
102
- ]}
103
- />,
104
- ),
105
- );
106
- await nextFrame();
107
-
108
- const firstLink = page.getByRole("button", { name: "Open subagent 1", exact: true });
109
- const lastLink = page.getByRole("button", { name: "Open subagent 12", exact: true });
110
- const stop = page.getByRole("button", { name: "Stop", exact: true });
111
- expect(firstLink.element().getBoundingClientRect().height).toBeGreaterThan(
112
- Number.parseFloat(getComputedStyle(firstLink.element()).lineHeight) * 2,
113
- );
114
- const viewport = container.querySelector<HTMLElement>('[data-slot="scroll-area-viewport"]')!;
115
- expect(viewport).not.toBeNull();
116
- expect(viewport.clientHeight).toBeGreaterThan(0);
117
- expect(viewport.clientHeight).toBeLessThanOrEqual(window.innerHeight / 2);
118
- expect(viewport.scrollHeight).toBeGreaterThan(viewport.clientHeight);
119
- expect(viewport.scrollWidth).toBeLessThanOrEqual(viewport.clientWidth + 1);
120
-
121
- const scrollBounds = viewport.getBoundingClientRect();
122
- const stopBounds = stop.element().getBoundingClientRect();
123
- expect(stopBounds.top).toBe(
124
- page.getByText("12 background tasks", { exact: true }).element().getBoundingClientRect().top,
125
- );
126
- expect(scrollBounds.right).toBeLessThanOrEqual(stopBounds.left);
127
- expect(stopBounds.right).toBeLessThanOrEqual(container.getBoundingClientRect().right);
128
- expect(stopBounds.bottom).toBeLessThanOrEqual(scrollBounds.bottom);
129
- expect(lastLink.element().getBoundingClientRect().top).toBeGreaterThan(scrollBounds.bottom);
130
- await firstLink.click();
131
- expect(openThread).toHaveBeenLastCalledWith(1);
132
-
133
- viewport.scrollTop = viewport.scrollHeight;
134
- await nextFrame();
135
- expect(viewport.scrollTop).toBeGreaterThan(0);
136
- const lastBounds = lastLink.element().getBoundingClientRect();
137
- expect(lastBounds.top).toBeGreaterThanOrEqual(scrollBounds.top);
138
- expect(lastBounds.bottom).toBeLessThanOrEqual(scrollBounds.bottom + 1);
139
- expect(stop.element().getBoundingClientRect().top).toBe(stopBounds.top);
140
- for (const control of [lastLink.element(), stop.element()]) {
141
- const bounds = control.getBoundingClientRect();
142
- expect(
143
- control.contains(
144
- document.elementFromPoint(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2),
145
- ),
146
- ).toBe(true);
147
- }
148
- await lastLink.click();
149
- expect(openThread).toHaveBeenLastCalledWith(12);
150
- },
151
-);
152
-
63
it("keeps only the usage limit attached while an active goal waits in the collapsible stack", async () => {
64
await act(async () =>
65
root.render(
apps/web/src/components/chat/ComposerBannerStack.tsx
+9
-21
@@ -17,7 +17,6 @@ export interface ComposerBannerStackItem {
17
readonly icon: ReactNode;
18
readonly title: ReactNode;
19
readonly description?: ReactNode;
20
- readonly descriptionPlacement?: "inline" | "below";
20
readonly children?: ReactNode;
21
readonly actions?: ReactNode;
22
readonly dismissLabel?: string;
@@ -348,7 +347,6 @@ function ComposerBannerStackAlert({
347
</ComposerBanner.Root>
348
);
349
}
351
- const descriptionBelow = item.descriptionPlacement === "below";
350
return (
351
<ComposerBanner.Root
352
role="alert"
@@ -356,15 +354,11 @@ function ComposerBannerStackAlert({
354
variant={item.variant}
355
density="comfortable"
356
>
359
- <ComposerBanner.Row
360
- layout={descriptionBelow || item.priority === "activity" ? "inline" : "wrap-actions"}
361
- >
357
+ <ComposerBanner.Row layout={item.priority === "activity" ? "inline" : "wrap-actions"}>
358
<ComposerBanner.Icon className="h-(--composer-banner-icon-column) self-start">
359
{item.icon}
360
</ComposerBanner.Icon>
365
- <ComposerBanner.Content
366
- className={descriptionBelow ? "flex-col items-stretch gap-0" : "whitespace-nowrap"}
367
- >
361
+ <ComposerBanner.Content className="whitespace-nowrap">
362
<NoticeText
363
detailsLabel="Show title details"
364
className="min-w-0 truncate font-medium leading-7 sm:leading-6"
@@ -372,22 +366,16 @@ function ComposerBannerStackAlert({
366
{item.title}
367
</NoticeText>
368
{item.description ? (
375
- descriptionBelow ? (
376
- <ComposerBanner.Scroll className="text-muted-foreground whitespace-normal wrap-anywhere [--inline-button-text-align:start] [--inline-button-white-space:normal] [&_[data-slot=inline-button]]:max-w-full">
377
- <span className="block pb-1">{item.description}</span>
378
- </ComposerBanner.Scroll>
379
- ) : (
380
- <NoticeText
381
- detailsLabel="Show notice details"
382
- className="w-0 min-w-0 grow truncate text-muted-foreground @max-[400px]:sr-only"
383
- >
384
- {item.description}
385
- </NoticeText>
386
- )
369
+ <NoticeText
370
+ detailsLabel="Show notice details"
371
+ className="w-0 min-w-0 grow truncate text-muted-foreground @max-[400px]:sr-only"
372
+ >
373
+ {item.description}
374
+ </NoticeText>
375
) : null}
376
</ComposerBanner.Content>
377
{item.actions || item.onDismiss ? (
390
- <ComposerBanner.Actions className={descriptionBelow ? "self-start" : undefined}>
378
+ <ComposerBanner.Actions>
379
{item.actions}
380
{item.onDismiss ? (
381
<ComposerBanner.Dismiss