The best way to control Claude Code, Codex and more from any computer or phone
fix(web): show the full command when the Running banner truncates (#19810)
Co-authored-by: macodev00 <macodev00@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
maco committed
Oct 20, 2026 at 06:15 UTC
060ac670a9bc1af5d1800856dd92d7a3b299880c
2 files changed
+65
-16
apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
+32
@@ -109,3 +109,35 @@ it("keeps only the usage limit attached while an active goal waits in the collap
109
await expect.element(limit).toBeVisible();
110
expect(visibleBanners()).toHaveLength(1);
111
});
112
+
113
+it("reveals the full running command only while its title is clipped", async () => {
114
+ const command =
115
+ "Running: /usr/bin/zsh -lc 'sleep 600 > /tmp/t3-background-command-with-a-long-log-filename-for-truncation.log 2>&1'";
116
+ container.style.width = "240px";
117
+ await act(async () =>
118
+ root.render(
119
+ <ComposerBannerStack
120
+ items={[
121
+ {
122
+ id: "background-work",
123
+ variant: "default",
124
+ priority: "activity",
125
+ icon: null,
126
+ title: command,
127
+ },
128
+ ]}
129
+ />,
130
+ ),
131
+ );
132
+
133
+ const details = page.getByRole("button", { name: "Show title details", exact: true });
134
+ await expect.element(details).toBeVisible();
135
+ await userEvent.hover(details);
136
+ const popup = page.getByRole("dialog", { name: "Notice details", exact: true });
137
+ await expect.element(popup).toBeVisible();
138
+ await expect.element(popup).toHaveTextContent(command);
139
+
140
+ container.style.width = "4000px";
141
+ await expect.element(details).not.toBeInTheDocument();
142
+ await expect.element(popup).not.toBeInTheDocument();
143
+});
apps/web/src/components/chat/ComposerBannerStack.tsx
+33
-16
@@ -249,30 +249,38 @@ export function ComposerBannerStack({ className, items, attachedAbove }: Compose
249
);
250
}
251
252
-function NoticeDescription({ children }: { children: ReactNode }) {
253
- const descriptionRef = useRef<HTMLSpanElement>(null);
252
+function NoticeText({
253
+ children,
254
+ className,
255
+ detailsLabel,
256
+}: {
257
+ readonly children: ReactNode;
258
+ readonly className: string;
259
+ readonly detailsLabel: string;
260
+}) {
261
+ const textRef = useRef<HTMLSpanElement>(null);
262
const detailsRef = useRef<HTMLButtonElement>(null);
263
const [showDetails, setShowDetails] = useState(false);
264
265
useLayoutEffect(() => {
258
- const description = descriptionRef.current;
259
- if (!description) return;
266
+ const text = textRef.current;
267
+ if (!text) return;
268
const measure = () => {
269
// Ignore the space taken by the details button itself so it cannot
262
- // sustain its own overflow after the description would otherwise fit.
270
+ // sustain its own overflow after the text would otherwise fit.
271
const recoveredWidth = detailsRef.current ? detailsRef.current.offsetWidth + 4 : 0;
264
- const hidden = getComputedStyle(description).position === "absolute";
272
+ const hidden = getComputedStyle(text).position === "absolute";
273
setShowDetails(
274
hidden ||
267
- [description, ...description.querySelectorAll("*")].some(
275
+ [text, ...text.querySelectorAll("*")].some(
276
(element) => element.scrollWidth > element.clientWidth + recoveredWidth,
277
),
278
);
279
};
280
measure();
273
- const stopObserving = observeResize(description, measure);
281
+ const stopObserving = observeResize(text, measure);
282
const mutations = new MutationObserver(measure);
275
- mutations.observe(description, { childList: true, subtree: true, characterData: true });
283
+ mutations.observe(text, { childList: true, subtree: true, characterData: true });
284
return () => {
285
stopObserving();
286
mutations.disconnect();
@@ -281,10 +289,7 @@ function NoticeDescription({ children }: { children: ReactNode }) {
289
290
return (
291
<span className="contents">
284
- <span
285
- ref={descriptionRef}
286
- className="w-0 min-w-0 grow truncate text-muted-foreground @max-[400px]:sr-only"
287
- >
292
+ <span ref={textRef} className={className}>
293
{children}
294
</span>
295
{showDetails ? (
@@ -296,7 +301,7 @@ function NoticeDescription({ children }: { children: ReactNode }) {
301
ref={detailsRef}
302
size="icon-xs"
303
variant="ghost-muted"
299
- aria-label="Show notice details"
304
+ aria-label={detailsLabel}
305
className="flex-none"
306
/>
307
}
@@ -353,8 +358,20 @@ function ComposerBannerStackAlert({
358
{item.icon}
359
</ComposerBanner.Icon>
360
<ComposerBanner.Content className="whitespace-nowrap">
356
- <span className="min-w-0 truncate font-medium leading-7 sm:leading-6">{item.title}</span>
357
- {item.description ? <NoticeDescription>{item.description}</NoticeDescription> : null}
361
+ <NoticeText
362
+ detailsLabel="Show title details"
363
+ className="min-w-0 truncate font-medium leading-7 sm:leading-6"
364
+ >
365
+ {item.title}
366
+ </NoticeText>
367
+ {item.description ? (
368
+ <NoticeText
369
+ detailsLabel="Show notice details"
370
+ className="w-0 min-w-0 grow truncate text-muted-foreground @max-[400px]:sr-only"
371
+ >
372
+ {item.description}
373
+ </NoticeText>
374
+ ) : null}
375
</ComposerBanner.Content>
376
{item.actions || item.onDismiss ? (
377
<ComposerBanner.Actions>