@devries-cameron20 / t3code-1 / commits / 09b464cf83
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): urgent and warning notices no longer hide behind activity banners (#18919)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Madhav Gautam committed Oct 20, 2026 at 04:25 UTC 09b464cf83df88c7d104be3932b0e1e5822bc655
2 files changed +53 -2
apps/web/src/components/chat/ComposerBannerStack.browser.test.tsx
+51
@@ -3,6 +3,7 @@ import "../../index.css";
3 import { act } from "react";
4 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 { ComposerBannerStack } from "./ComposerBannerStack";
9
@@ -58,3 +59,53 @@ it("only offers notice details when the description cannot fit", async () => {
59 await nextFrame();
60 expect(hasDetails()).toBe(true);
61 });
62 +
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(
66 + <ComposerBannerStack
67 + items={[
68 + {
69 + id: "goal",
70 + variant: "default",
71 + priority: "activity",
72 + icon: null,
73 + title: "Goal active",
74 + description: "Finish the banner fix",
75 + },
76 + {
77 + id: "limit",
78 + variant: "default",
79 + priority: "urgent",
80 + icon: null,
81 + title: "Usage limit reached",
82 + },
83 + ]}
84 + />,
85 + ),
86 + );
87 +
88 + const visibleBanners = () =>
89 + Array.from(container.querySelectorAll('[data-slot="composer-banner"]')).filter((banner) =>
90 + banner.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true }),
91 + );
92 + const limit = page.getByText("Usage limit reached", { exact: true });
93 + const goal = page.getByText("Goal active", { exact: true });
94 +
95 + expect(visibleBanners()).toHaveLength(1);
96 + await expect.element(limit).toBeVisible();
97 + await expect.element(goal).not.toBeVisible();
98 + expect(container.querySelector('[data-slot="composer-banner-attachment"]')?.textContent).toBe(
99 + "Usage limit reached",
100 + );
101 +
102 + await act(async () => page.getByRole("button", { name: "Show other notices" }).click());
103 + await expect.element(goal).toBeVisible();
104 + await expect.element(limit).toBeVisible();
105 + await expect.poll(visibleBanners).toHaveLength(2);
106 +
107 + await act(async () => userEvent.keyboard("{Escape}"));
108 + await expect.element(goal).not.toBeVisible();
109 + await expect.element(limit).toBeVisible();
110 + expect(visibleBanners()).toHaveLength(1);
111 +});
apps/web/src/components/chat/ComposerBannerStack.tsx
+2 -2
@@ -31,10 +31,10 @@ export type ComposerBannerStackContent = Pick<
31 type ComposerBannerStackEntry = ComposerBannerStackItem | ComposerBannerStackContent;
32
33 function bannerPriority(item: ComposerBannerStackEntry) {
34 - if (item.priority === "activity") {
34 + if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {
35 return 0;
36 }
37 - if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {
37 + if (item.priority === "activity") {
38 return 1;
39 }
40 return 2;