Skip to content

Commit 47f06a5

Browse files
committed
fix(web): stop the chat timeline reading through the provider banner
The provider status banner floats above the message timeline, but its only backing was a 4% variant tint, so the messages underneath stayed fully sharp and legible through the card. It reuses the alert-glass surface the composer banner stack already floats on, which supplies the same variant tint over an opaque, blurred background.
1 parent 94331c5 commit 47f06a5

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ describe("ProviderStatusBanner", () => {
4444
expect(markup).toContain("absolute top-2 right-2");
4545
});
4646

47+
it("renders on a glass surface so the timeline never reads through the banner", () => {
48+
const markup = renderToStaticMarkup(
49+
<ProviderStatusBanner status={warningProvider()} onDismiss={() => {}} />,
50+
);
51+
52+
expect(markup).toContain("alert-glass");
53+
expect(markup).toContain('data-variant="warning"');
54+
});
55+
4756
it("labels error dismiss controls with the correct severity", () => {
4857
const markup = renderToStaticMarkup(
4958
<ProviderStatusBanner

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export const ProviderStatusBanner = memo(function ProviderStatusBanner({
4646
<div className="pointer-events-auto mx-auto w-fit max-w-[calc(100%-2rem)] pt-3">
4747
<div
4848
className={cn(
49-
"relative inline-flex items-center gap-3 rounded-xl border py-3 ps-3.5 pe-10 text-card-foreground text-sm",
49+
"alert-glass relative inline-flex items-center gap-3 rounded-xl border py-3 ps-3.5 pe-10 text-card-foreground text-sm",
5050
status.status === "warning"
51-
? "border-warning/32 bg-warning/4 [&_svg]:text-warning"
52-
: "border-destructive/32 bg-destructive/4 text-destructive-foreground [&_svg]:text-destructive",
51+
? "border-warning/32 [&_svg]:text-warning"
52+
: "border-destructive/32 text-destructive-foreground [&_svg]:text-destructive",
5353
)}
54+
data-variant={status.status === "warning" ? "warning" : "error"}
5455
role="alert"
5556
>
5657
<InfoIcon className="size-4 shrink-0" aria-hidden />

0 commit comments

Comments
 (0)