Skip to content

Commit 730b2f6

Browse files
committed
Compact cluster signal strip
1 parent fa070e3 commit 730b2f6

3 files changed

Lines changed: 81 additions & 66 deletions

File tree

src/components/workspace.tsx

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,24 +101,26 @@ export function Toolbar({ count, data, scope }: { count: number; data: KiteData;
101101

102102
export function SummaryStrip({ counts, warningCount }: { counts: Map<string, number>; warningCount: number }) {
103103
return (
104-
<section className="summary-strip" aria-label="Cluster summary">
105-
{overviewCards.map((card, index) => {
106-
const Icon = card.icon;
107-
return (
108-
<article className="summary-card" key={card.kind} style={{ "--delay": `${index * 65}ms` } as CSSProperties}>
109-
<Icon size={20} />
110-
<span>{card.label}</span>
111-
<strong>{counts.get(card.kind) ?? 0}</strong>
112-
<small>live</small>
113-
</article>
114-
);
115-
})}
116-
<article className="summary-card risk" style={{ "--delay": "260ms" } as CSSProperties}>
117-
<Gauge size={20} />
118-
<span>Warnings</span>
119-
<strong>{warningCount}</strong>
120-
<small>needs review</small>
121-
</article>
104+
<section className="summary-strip" aria-label="Cluster signals">
105+
<span className="summary-strip-label">Cluster</span>
106+
<div className="summary-metrics">
107+
{overviewCards.map((card, index) => {
108+
const Icon = card.icon;
109+
return (
110+
<article className="summary-metric" key={card.kind} style={{ "--delay": `${index * 45}ms` } as CSSProperties}>
111+
<Icon size={20} />
112+
<span>{card.label}</span>
113+
<strong>{counts.get(card.kind) ?? 0}</strong>
114+
</article>
115+
);
116+
})}
117+
<article className="summary-metric risk" style={{ "--delay": "180ms" } as CSSProperties}>
118+
<Gauge size={20} />
119+
<span>Warnings</span>
120+
<strong>{warningCount}</strong>
121+
</article>
122+
</div>
123+
<small className={warningCount ? "summary-state warning" : "summary-state"}>{warningCount ? "review" : "clear"}</small>
122124
</section>
123125
);
124126
}

src/styles/base.css

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ summary:focus-visible {
125125
.inspector header span,
126126
.detail-row span,
127127
.scope-readout,
128-
.summary-card span,
129-
.summary-card small {
128+
.summary-strip-label,
129+
.summary-metric span,
130+
.summary-state {
130131
color: var(--text-soft);
131132
font-family: var(--font-mono);
132133
font-size: 11px;
@@ -416,38 +417,76 @@ summary:focus-visible {
416417
}
417418

418419
.summary-strip {
419-
display: grid;
420-
grid-template-columns: repeat(5, minmax(120px, 1fr));
421-
gap: 1px;
420+
display: flex;
421+
align-items: center;
422+
gap: 14px;
423+
min-block-size: 54px;
422424
margin-block-end: 14px;
425+
padding-inline: 14px;
423426
border: 1px solid var(--line);
427+
background: var(--surface);
428+
}
429+
430+
.summary-strip-label {
431+
flex: 0 0 auto;
432+
text-transform: uppercase;
433+
}
434+
435+
.summary-metrics {
436+
display: grid;
437+
grid-template-columns: repeat(5, minmax(96px, 1fr));
438+
gap: 1px;
439+
flex: 1 1 auto;
440+
min-inline-size: 0;
424441
background: var(--line);
425442
}
426443

427-
.summary-card {
444+
.summary-metric {
428445
display: grid;
429-
grid-template-columns: auto 1fr;
430-
gap: 8px 12px;
446+
grid-template-columns: 16px minmax(0, 1fr) auto;
447+
gap: 8px;
431448
align-items: center;
432-
min-block-size: 100px;
433-
padding: 16px 18px;
434-
background: var(--surface);
449+
min-block-size: 34px;
450+
min-inline-size: 0;
451+
padding-inline: 10px;
452+
background: var(--surface-soft);
435453
}
436454

437-
.summary-card svg {
438-
grid-row: span 3;
455+
.summary-metric svg {
439456
color: var(--green-deep);
440457
}
441458

442-
.summary-card strong {
443-
font-size: 34px;
459+
.summary-metric span {
460+
overflow: hidden;
461+
text-overflow: ellipsis;
462+
text-transform: uppercase;
463+
white-space: nowrap;
464+
}
465+
466+
.summary-metric strong {
467+
color: var(--text);
468+
font-family: var(--font-mono);
469+
font-size: 16px;
444470
line-height: 1;
445471
}
446472

447-
.summary-card.risk svg {
473+
.summary-metric.risk {
474+
box-shadow: inset 2px 0 0 color-mix(in srgb, var(--orange) 72%, transparent);
475+
}
476+
477+
.summary-metric.risk svg,
478+
.summary-state.warning {
448479
color: var(--orange);
449480
}
450481

482+
.summary-state {
483+
flex: 0 0 auto;
484+
padding: 4px 7px;
485+
border: 1px solid var(--line);
486+
text-transform: uppercase;
487+
background: var(--surface-soft);
488+
}
489+
451490
.scope-tabs {
452491
display: flex;
453492
gap: 0;
@@ -3211,7 +3250,11 @@ summary:focus-visible {
32113250
}
32123251

32133252
.summary-strip {
3214-
grid-template-columns: repeat(5, minmax(120px, 1fr));
3253+
gap: 10px;
3254+
}
3255+
3256+
.summary-metrics {
3257+
grid-template-columns: repeat(5, minmax(96px, 1fr));
32153258
}
32163259

32173260
.pod-triage-rail {

src/styles/motion.css

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66
animation: surface-enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
77
}
88

9-
.summary-card {
9+
.summary-metric {
1010
animation: surface-enter 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
1111
animation-delay: var(--delay);
1212
}
1313

14-
.summary-card::after {
15-
animation: metric-line 760ms ease both;
16-
}
17-
1814
.runtime-tile,
1915
.container-card,
2016
.pod-issue-strip button {
@@ -125,26 +121,6 @@
125121
}
126122
}
127123

128-
.summary-card {
129-
position: relative;
130-
overflow: hidden;
131-
}
132-
133-
.summary-card::after {
134-
position: absolute;
135-
inset-inline: 0;
136-
inset-block-end: 0;
137-
block-size: 2px;
138-
content: "";
139-
background: var(--green);
140-
transform: scaleX(0);
141-
transform-origin: left;
142-
}
143-
144-
.summary-card.risk::after {
145-
background: var(--orange);
146-
}
147-
148124
@keyframes surface-enter {
149125
from {
150126
opacity: 0;
@@ -156,12 +132,6 @@
156132
}
157133
}
158134

159-
@keyframes metric-line {
160-
to {
161-
transform: scaleX(1);
162-
}
163-
}
164-
165135
@keyframes row-enter {
166136
from {
167137
opacity: 0;

0 commit comments

Comments
 (0)