Skip to content

Commit 393ca71

Browse files
committed
fix(web): warning and error notices also stay visible above activity
Only urgent notices stayed expanded, so a plain warning like the server reconnecting banner still collapsed behind a goal or subagent banner (#19455). Every notice in the urgent, warning and error tier now keeps its place above the front item. Info and default notices still collapse.
1 parent 6223840 commit 393ca71

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎apps/web/src/components/chat/ComposerBannerStack.test.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ it("only offers notice details when the description cannot fit", async () => {
101101
expect(details()).toHaveLength(0);
102102
});
103103

104-
it("keeps an urgent notice out of the collapsed stack behind activity", async () => {
104+
it("keeps urgent, warning and error notices out of the collapsed stack behind activity", async () => {
105105
vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
106106
await act(() => {
107107
renderer = create(
@@ -115,6 +115,8 @@ it("keeps an urgent notice out of the collapsed stack behind activity", async ()
115115
title: "Usage limit reached",
116116
},
117117
{ id: "usage", variant: "info", priority: "notice", icon: null, title: "Usage limits" },
118+
{ id: "offline", variant: "warning", icon: null, title: "Server is reconnecting" },
119+
{ id: "clone", variant: "error", icon: null, title: "Failed to clone repo" },
118120
{
119121
id: "work",
120122
variant: "default",
@@ -134,6 +136,8 @@ it("keeps an urgent notice out of the collapsed stack behind activity", async ()
134136
// Order is unchanged: activity stays attached, with the notices above it.
135137
expect(titles(renderer.root)).toEqual([
136138
"Usage limit reached",
139+
"Server is reconnecting",
140+
"Failed to clone repo",
137141
"Usage limits",
138142
"Waiting on 2 subagents",
139143
]);

‎apps/web/src/components/chat/ComposerBannerStack.tsx‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ export function ComposerBannerStack({ className, items, attachedAbove }: Compose
7171
const orderedItems = items.toSorted((a, b) => bannerPriority(a) - bannerPriority(b));
7272
const frontItem = orderedItems[0];
7373
const stackedItems = orderedItems.slice(1);
74-
// An urgent notice is waiting on the user, so it keeps its expanded place above the
75-
// front item instead of collapsing behind it with the other notices.
76-
const pinnedItems = stackedItems.filter((item) => item.priority === "urgent");
77-
const collapsedItems = stackedItems.filter((item) => item.priority !== "urgent");
74+
// Urgent, warning and error notices need the user, so they keep their expanded place
75+
// above the front item instead of collapsing behind it with the other notices.
76+
const pinnedItems = stackedItems.filter((item) => bannerPriority(item) === 1);
77+
const collapsedItems = stackedItems.filter((item) => bannerPriority(item) !== 1);
7878
const hasStack = collapsedItems.length > 0;
7979

8080
useEffect(() => {

0 commit comments

Comments
 (0)