Skip to content

Commit c562cfe

Browse files
committed
improve(ui): restyle connection-lost pill as neutral status surface
1 parent 21f2512 commit c562cfe

2 files changed

Lines changed: 48 additions & 46 deletions

File tree

‎ui/src/components/connection-banner.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { LitElement, html, nothing } from "lit";
44
import { property } from "lit/decorators.js";
55
import { t } from "../i18n/index.ts";
6-
import { icons } from "./icons.ts";
76
import { redactLoginFailureError } from "./login-gate.ts";
87

98
export type ConnectionBannerProps = {
@@ -17,11 +16,11 @@ function renderConnectionBanner(props: ConnectionBannerProps) {
1716
return html`
1817
<div class="connection-banner" role="status" aria-live="polite">
1918
<div class="connection-banner__pill" title=${detail ? `${hint}\n${detail}` : hint}>
20-
<span class="connection-banner__spinner" aria-hidden="true">${icons.loader}</span>
21-
<strong class="connection-banner__title">${t("connection.lostTitle")}</strong>
19+
<span class="connection-banner__dot" aria-hidden="true"></span>
20+
<span class="connection-banner__title">${t("connection.lostTitle")}</span>
2221
<span class="connection-banner__state">${t("connection.reconnecting")}</span>
2322
<span class="connection-banner__sr-hint">${hint}</span>
24-
<button class="btn btn--sm connection-banner__retry" type="button" @click=${props.onRetry}>
23+
<button class="connection-banner__retry" type="button" @click=${props.onRetry}>
2524
${t("connection.retryNow")}
2625
</button>
2726
</div>

‎ui/src/styles/components.css‎

Lines changed: 45 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -327,25 +327,22 @@
327327
pointer-events: none;
328328
}
329329

330+
/* Neutral elevated surface; the amber status dot is the only color accent so
331+
the pill reads as quiet system status, not a warning callout. */
330332
.connection-banner__pill {
331333
pointer-events: auto;
332334
display: inline-flex;
333-
align-items: center;
334-
gap: 10px;
335+
align-items: stretch;
335336
min-width: 0;
336337
max-width: 100%;
337-
padding: 6px 6px 6px 14px;
338338
border-radius: var(--radius-full);
339-
border: 1px solid color-mix(in srgb, var(--warn) 36%, var(--border));
340-
background: color-mix(
341-
in srgb,
342-
var(--warn) 10%,
343-
color-mix(in srgb, var(--bg-elevated) 86%, transparent)
344-
);
345-
backdrop-filter: blur(12px) saturate(1.4);
346-
-webkit-backdrop-filter: blur(12px) saturate(1.4);
347-
box-shadow: var(--shadow-md);
339+
border: 1px solid var(--border);
340+
background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
341+
backdrop-filter: blur(12px) saturate(1.2);
342+
-webkit-backdrop-filter: blur(12px) saturate(1.2);
343+
box-shadow: var(--shadow-lg);
348344
font-size: 13px;
345+
line-height: 1;
349346
animation: connection-banner-enter 0.25s var(--ease-out);
350347
}
351348

@@ -366,35 +363,30 @@
366363
}
367364
}
368365

369-
.connection-banner__spinner {
370-
display: inline-flex;
371-
align-items: center;
372-
color: var(--warn);
373-
}
374-
375-
.connection-banner__spinner svg {
376-
width: 14px;
377-
height: 14px;
378-
fill: none;
379-
stroke: currentColor;
380-
stroke-width: 2;
381-
stroke-linecap: round;
382-
animation: connection-banner-spin 1s linear infinite;
383-
}
384-
385-
@keyframes connection-banner-spin {
386-
to {
387-
transform: rotate(360deg);
388-
}
366+
.connection-banner__dot {
367+
width: 7px;
368+
height: 7px;
369+
align-self: center;
370+
margin-left: 14px;
371+
border-radius: var(--radius-full);
372+
background: var(--warn);
373+
box-shadow: 0 0 8px color-mix(in srgb, var(--warn) 55%, transparent);
374+
animation: pulse-subtle 2s ease-in-out infinite;
375+
flex-shrink: 0;
389376
}
390377

391378
.connection-banner__title {
379+
align-self: center;
380+
margin-left: 9px;
381+
padding: 10px 0;
392382
color: var(--text-strong);
393-
font-weight: 600;
383+
font-weight: 500;
394384
white-space: nowrap;
395385
}
396386

397387
.connection-banner__state {
388+
align-self: center;
389+
margin-left: 7px;
398390
color: var(--muted);
399391
white-space: nowrap;
400392
}
@@ -412,19 +404,30 @@
412404
white-space: nowrap;
413405
}
414406

415-
.connection-banner .connection-banner__retry {
416-
border-radius: var(--radius-full);
417-
border-color: color-mix(in srgb, var(--warn) 42%, var(--border));
407+
/* Text action behind a hairline divider so the pill stays a single surface
408+
instead of a capsule-inside-a-capsule. */
409+
.connection-banner__retry {
410+
margin-left: 12px;
411+
padding: 0 14px;
412+
border: none;
413+
border-left: 1px solid var(--border);
414+
border-radius: 0 var(--radius-full) var(--radius-full) 0;
418415
background: transparent;
419-
color: var(--text-strong);
420-
font-size: 12px;
421-
padding: 4px 12px;
416+
color: var(--accent);
417+
font-size: 12.5px;
418+
font-weight: 500;
422419
white-space: nowrap;
420+
cursor: pointer;
421+
transition: background var(--duration-fast) var(--ease-out);
422+
}
423+
424+
.connection-banner__retry:hover {
425+
background: color-mix(in srgb, var(--bg-hover) 84%, transparent);
423426
}
424427

425-
.connection-banner .connection-banner__retry:hover:not(:disabled) {
426-
border-color: color-mix(in srgb, var(--warn) 60%, var(--border));
427-
background: color-mix(in srgb, var(--warn) 14%, transparent);
428+
.connection-banner__retry:focus-visible {
429+
outline: none;
430+
box-shadow: var(--focus-ring);
428431
}
429432

430433
@media (max-width: 640px) {

0 commit comments

Comments
 (0)