@devries-cameron20 / t3code Mirror · read-only / commits / 2e66b1fdfc
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 17:45 UTC

fix(web): live background-work banner no longer hides behind the update notice (#5595)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Theo Browne committed Aug 7, 2026 at 06:10 UTC 2e66b1fdfc63d39822cd58948bcf43e8fbc239b6
3 files changed +55 -8
apps/web/src/components/ChatView.tsx
+19 -4
@@ -1934,6 +1934,8 @@ function ChatViewContent(props: ChatViewProps) {
1934 items.push({
1935 id: `environment-unavailable:${activeEnvironmentUnavailableState.environmentId}`,
1936 variant: "default",
1937 + // Live connection status: calm styling, but it must front the stack.
1938 + urgent: true,
1939 icon: (
1940 <span
1941 className="size-1.5 animate-status-pulse rounded-full bg-foreground"
@@ -1988,6 +1990,9 @@ function ChatViewContent(props: ChatViewProps) {
1990 items.push({
1991 id: `server-version:${serverUpdateEnvironmentId}`,
1992 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,
1996 // In-flight and failed states carry their own status dot inside
1997 // ServerUpdateProgress; only the idle offer needs an icon.
1998 icon:
@@ -4372,8 +4377,12 @@ function ChatViewContent(props: ChatViewProps) {
4377 };
4378 }, [acknowledgeActiveThreadWoke, activeThread?.id, activeThreadWokeVisible]);
4379 // The stack renders items[0] front-most and tucks the rest behind hover, so
4375 - // ordering is priority: system banners, then the branch-mismatch notice,
4376 - // and the informational parked-thread banner last — it must never 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.
4386 const parkedThreadBannerItem = useMemo<ComposerBannerStackItem | null>(() => {
4387 if (!activeThreadSnoozed && !activeThreadSettled) {
4388 return null;
@@ -4423,21 +4432,27 @@ function ChatViewContent(props: ChatViewProps) {
4432 void handleSwitchCheckoutToThread();
4433 }, [gitStatusQuery.data?.hasWorkingTreeChanges, handleSwitchCheckoutToThread]);
4434 const composerBannerItems = useMemo<ComposerBannerStackItem[]>(() => {
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));
4439 const backgroundLivenessItems =
4440 backgroundLivenessBannerItem === null ? [] : [backgroundLivenessBannerItem];
4441 const wokeThreadItems = wokeThreadBannerItem === null ? [] : [wokeThreadBannerItem];
4442 const parkedThreadItems = parkedThreadBannerItem === null ? [] : [parkedThreadBannerItem];
4443 if (!localCheckoutBranchMismatch || !showBranchMismatchBanner || !activeBranchMismatchKey) {
4444 return [
4432 - ...systemComposerBannerItems,
4445 + ...urgentSystemItems,
4446 ...backgroundLivenessItems,
4447 + ...calmSystemItems,
4448 ...wokeThreadItems,
4449 ...parkedThreadItems,
4450 ];
4451 }
4452 return [
4439 - ...systemComposerBannerItems,
4453 + ...urgentSystemItems,
4454 ...backgroundLivenessItems,
4455 + ...calmSystemItems,
4456 ...wokeThreadItems,
4457 {
4458 id: `branch-mismatch:${activeBranchMismatchKey}`,
apps/web/src/components/chat/ComposerBannerStack.test.tsx
+18 -2
@@ -3,9 +3,12 @@ import { describe, expect, it } from "vite-plus/test";
3
4 import { ComposerBannerStack, type ComposerBannerStackItem } from "./ComposerBannerStack";
5
6 -const banner = (id: string): ComposerBannerStackItem => ({
6 +const banner = (
7 + id: string,
8 + variant: ComposerBannerStackItem["variant"] = "warning",
9 +): ComposerBannerStackItem => ({
10 id,
8 - variant: "warning",
11 + variant,
12 icon: <span aria-hidden="true">!</span>,
13 title: `${id} warning`,
14 });
@@ -29,6 +32,19 @@ describe("ComposerBannerStack", () => {
32 expect(markup).toContain("group-focus-within/banner-stack:visible");
33 });
34
35 + it("colors the collapsed stack cap by the hidden banner's variant, not a fixed warning", () => {
36 + const neutralBehind = renderToStaticMarkup(
37 + <ComposerBannerStack items={[banner("front", "default"), banner("stacked", "default")]} />,
38 + );
39 + expect(neutralBehind).toContain("border-border");
40 + expect(neutralBehind).not.toContain("border-warning/24");
41 +
42 + const warningBehind = renderToStaticMarkup(
43 + <ComposerBannerStack items={[banner("front", "default"), banner("stacked", "warning")]} />,
44 + );
45 + expect(warningBehind).toContain("border-warning/24");
46 + });
47 +
48 it("does not render an expandable region for a single banner", () => {
49 const markup = renderToStaticMarkup(<ComposerBannerStack items={[banner("front")]} />);
50
apps/web/src/components/chat/ComposerBannerStack.tsx
+18 -2
@@ -22,9 +22,23 @@ const exitTransitionStyle = {
22 transition: `transform ${DISMISS_TRANSITION_MS}ms ease-in, opacity ${DISMISS_TRANSITION_MS}ms ease-in`,
23 } satisfies CSSProperties;
24
25 +// The collapsed cap peeking above the front banner is the only hint that more
26 +// banners are stacked behind it, so its border must match the severity of the
27 +// first hidden banner — a neutral banner must not masquerade as a warning.
28 +const stackCapBorderClass: Record<ComposerBannerStackItem["variant"], string> = {
29 + default: "border-border",
30 + error: "border-destructive/24",
31 + info: "border-info/24",
32 + success: "border-success/24",
33 + warning: "border-warning/24",
34 +};
35 +
36 export interface ComposerBannerStackItem {
37 readonly id: string;
38 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;
42 readonly icon: ReactNode;
43 readonly title: ReactNode;
44 readonly description?: ReactNode;
@@ -67,6 +81,7 @@ export function ComposerBannerStack({ className, items }: ComposerBannerStackPro
81 const stackedItems = items.slice(1);
82 const hasStack = stackedItems.length > 0;
83 const showCollapsedStackCap = hasStack && exitingItemId !== frontItem.id;
84 + const firstStackedItem = stackedItems[0];
85
86 const requestDismiss = (item: ComposerBannerStackItem) => {
87 if (!item.onDismiss || exitingItemId) {
@@ -90,11 +105,12 @@ export function ComposerBannerStack({ className, items }: ComposerBannerStackPro
105 hasStack ? "group-hover/banner-stack:z-50 group-focus-within/banner-stack:z-50" : null,
106 )}
107 >
93 - {showCollapsedStackCap ? (
108 + {showCollapsedStackCap && firstStackedItem ? (
109 <div
110 className={cn(
111 "pointer-events-none absolute inset-x-0 -top-3 z-0 mx-auto h-3 rounded-t-[22px]",
97 - "border border-b-0 border-warning/24 bg-background/96 shadow-[0_6px_18px_rgba(0,0,0,0.06)]",
112 + "border border-b-0 bg-background/96 shadow-[0_6px_18px_rgba(0,0,0,0.06)]",
113 + stackCapBorderClass[firstStackedItem.variant],
114 "transition-opacity duration-150 ease-out",
115 "group-hover/banner-stack:opacity-0 group-focus-within/banner-stack:opacity-0",
116 )}