Skip to content

Commit aa08190

Browse files
t3dotggclaude
andcommitted
fix(web): keep live update progress in the urgent banner tier
Bugbot caught that a running update uses the default variant, so the variant-based split stacked its progress banner behind background liveness while a failed update stayed in front. Add an explicit urgent flag for calm-styled live states (update progress, the reconnect fold) so ordering follows urgency, not visual variant. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 1461465 commit aa08190

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,6 +1934,8 @@ function ChatViewContent(props: ChatViewProps) {
19341934
items.push({
19351935
id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
19361936
variant: "default",
1937+
// Live connection status: calm styling, but it must front the stack.
1938+
urgent: true,
19371939
icon: (
19381940
<span
19391941
className="size-1.5 animate-status-pulse rounded-full bg-foreground"
@@ -1988,6 +1990,9 @@ function ChatViewContent(props: ChatViewProps) {
19881990
items.push({
19891991
id: `server-version:${serverUpdateEnvironmentId}`,
19901992
variant: updateFailed ? "error" : "default",
1993+
// A running update is live progress the user is waiting on; only the
1994+
// idle "update available" offer is calm enough to stack behind.
1995+
urgent: updateInProgress,
19911996
// In-flight and failed states carry their own status dot inside
19921997
// ServerUpdateProgress; only the idle offer needs an icon.
19931998
icon:
@@ -4372,12 +4377,12 @@ function ChatViewContent(props: ChatViewProps) {
43724377
};
43734378
}, [acknowledgeActiveThreadWoke, activeThread?.id, activeThreadWokeVisible]);
43744379
// The stack renders items[0] front-most and tucks the rest behind hover, so
4375-
// ordering is priority: urgent system banners (connection down, update
4376-
// failed), then background liveness — its Stop button is the only stop
4377-
// affordance for settled turns, so a calm "update available" notice must not
4378-
// cover it — then calm system banners, the woke and branch-mismatch
4379-
// notices, and the informational parked-thread banner last — it must never
4380-
// cover another.
4380+
// ordering is priority: urgent system banners (error/warning variants plus
4381+
// calm-styled live states flagged `urgent`, like update progress), then
4382+
// background liveness — its Stop button is the only stop affordance for
4383+
// settled turns, so a passive "update available" notice must not cover it —
4384+
// then calm system banners, the woke and branch-mismatch notices, and the
4385+
// informational parked-thread banner last — it must never cover another.
43814386
const parkedThreadBannerItem = useMemo<ComposerBannerStackItem | null>(() => {
43824387
if (!activeThreadSnoozed && !activeThreadSettled) {
43834388
return null;
@@ -4427,12 +4432,10 @@ function ChatViewContent(props: ChatViewProps) {
44274432
void handleSwitchCheckoutToThread();
44284433
}, [gitStatusQuery.data?.hasWorkingTreeChanges, handleSwitchCheckoutToThread]);
44294434
const composerBannerItems = useMemo<ComposerBannerStackItem[]>(() => {
4430-
const urgentSystemItems = systemComposerBannerItems.filter(
4431-
(item) => item.variant === "error" || item.variant === "warning",
4432-
);
4433-
const calmSystemItems = systemComposerBannerItems.filter(
4434-
(item) => item.variant !== "error" && item.variant !== "warning",
4435-
);
4435+
const isUrgentSystemItem = (item: ComposerBannerStackItem) =>
4436+
item.urgent === true || item.variant === "error" || item.variant === "warning";
4437+
const urgentSystemItems = systemComposerBannerItems.filter(isUrgentSystemItem);
4438+
const calmSystemItems = systemComposerBannerItems.filter((item) => !isUrgentSystemItem(item));
44364439
const backgroundLivenessItems =
44374440
backgroundLivenessBannerItem === null ? [] : [backgroundLivenessBannerItem];
44384441
const wokeThreadItems = wokeThreadBannerItem === null ? [] : [wokeThreadBannerItem];

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const stackCapBorderClass: Record<ComposerBannerStackItem["variant"], string> =
3636
export interface ComposerBannerStackItem {
3737
readonly id: string;
3838
readonly variant: "default" | "error" | "info" | "success" | "warning";
39+
// Ordering hint for stack assemblers: front this banner even though its
40+
// variant is calm (e.g. live update progress). The stack itself ignores it.
41+
readonly urgent?: boolean;
3942
readonly icon: ReactNode;
4043
readonly title: ReactNode;
4144
readonly description?: ReactNode;

0 commit comments

Comments
 (0)