Skip to content

Commit 078c289

Browse files
fix(web): keep activity attached ahead of failed updates
1 parent f8aaea8 commit 078c289

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ function ChatViewContent(props: ChatViewProps) {
21922192
items.push({
21932193
id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
21942194
variant: "default",
2195-
// Live connection status: calm styling, but it must front the stack.
2195+
// Prioritize live connection progress among the notices.
21962196
priority: "urgent",
21972197
icon: (
21982198
<span
@@ -2249,8 +2249,7 @@ function ChatViewContent(props: ChatViewProps) {
22492249
items.push({
22502250
id: `server-version:${serverUpdateEnvironmentId}`,
22512251
variant: updateFailed ? "error" : "default",
2252-
// A running update is live progress the user is waiting on; only the
2253-
// idle "update available" offer is calm enough to stack behind.
2252+
// Prioritize update progress over passive notices, but keep activity attached.
22542253
priority: updateInProgress ? "urgent" : "notice",
22552254
icon: <InfoIcon aria-hidden />,
22562255
title:

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ export type ComposerBannerStackContent = Pick<
2828
type ComposerBannerStackEntry = ComposerBannerStackItem | ComposerBannerStackContent;
2929

3030
function bannerPriority(item: ComposerBannerStackEntry) {
31-
if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {
31+
if (item.priority === "activity") {
3232
return 0;
3333
}
34-
return item.priority === "activity" ? 1 : 2;
34+
if (item.priority === "urgent" || item.variant === "error" || item.variant === "warning") {
35+
return 1;
36+
}
37+
return 2;
3538
}
3639

3740
interface ComposerBannerStackProps {
@@ -67,8 +70,7 @@ export function ComposerBannerStack({ className, items }: ComposerBannerStackPro
6770
return null;
6871
}
6972

70-
// Stable ordering keeps live activity ahead of passive notices while errors
71-
// and in-progress operations retain their existing priority.
73+
// Activity stays attached. Urgency and severity only order the notices behind it.
7274
const orderedItems = items.toSorted((a, b) => bannerPriority(a) - bannerPriority(b));
7375
const frontItem = orderedItems[0];
7476
if (!frontItem) {

0 commit comments

Comments
 (0)