polish(app): spacing scale, unified insets, shared banner classes, scrollbar cues

- --sp-1..7 scale; card headers unified on 10x14, bodies on 12x14;
  orphan gaps snapped to rungs
- CapsuleChart's orphaned CSS deleted
- StaleBanner/budget/empty/range notes moved from inline styles to
  plain.css classes; Panel bodyStyle prop retired (scroll-x class)
- thin always-visible scrollbars on scrolling panels and overflow-x
  tables; Compare pickers flex below 760px instead of overflowing
- one capitalization fix (loading quota…)

235/235, build green.
This commit is contained in:
iamtoruk 2026-07-16 04:02:21 -07:00
parent edaa284c0f
commit 0eb0fd60d7
10 changed files with 49 additions and 74 deletions

View file

@ -321,7 +321,6 @@ function DailyBudgetBanner({ payload, provider }: { payload: MenubarPayload | nu
if (percent < 80) return null
const exceeded = percent >= 100
const accent = exceeded ? 'var(--bad)' : 'var(--warn)'
const spent = budget.kind === 'usd' ? formatUsd(used) : formatCompact(used)
const cap = budget.kind === 'usd' ? formatUsd(budget.value) : formatCompact(budget.value)
const text = exceeded
@ -334,24 +333,9 @@ function DailyBudgetBanner({ payload, provider }: { payload: MenubarPayload | nu
}
return (
<div
role="status"
className="daily-budget-banner"
style={{
display: 'flex',
alignItems: 'center',
gap: 10,
padding: '6px 16px',
fontSize: 12,
fontWeight: 550,
color: accent,
borderLeft: `3px solid ${accent}`,
borderBottom: '1px solid var(--line)',
lineHeight: 1.4,
}}
>
<span style={{ flex: 1 }}>{text}</span>
<button type="button" className="set-text-button" style={{ color: 'var(--mut)' }} onClick={dismiss}>Dismiss</button>
<div role="status" className={exceeded ? 'budget-banner exceeded' : 'budget-banner'}>
<span>{text}</span>
<button type="button" className="set-text-button" onClick={dismiss}>Dismiss</button>
</div>
)
}

View file

@ -2,5 +2,5 @@ import type { ReactNode } from 'react'
/** The canonical empty/placeholder note: muted text at one size. */
export function EmptyNote({ children }: { children: ReactNode }) {
return <p style={{ color: 'var(--mut)', margin: 0, fontSize: 12 }}>{children}</p>
return <p className="empty-note">{children}</p>
}

View file

@ -1,4 +1,4 @@
import type { CSSProperties, ReactNode } from 'react'
import type { ReactNode } from 'react'
/** Dash0-style card: optional `.phead` title strip + `.pbody` content. */
export function Panel({
@ -6,7 +6,6 @@ export function Panel({
right,
rightLink,
className,
bodyStyle,
children,
}: {
title?: ReactNode
@ -14,7 +13,6 @@ export function Panel({
/** Render the `right` slot as a lavender action link (`.r.link`, e.g. "See all ›"). */
rightLink?: boolean
className?: string
bodyStyle?: CSSProperties
children?: ReactNode
}) {
return (
@ -25,7 +23,7 @@ export function Panel({
{right !== undefined && <span className={rightLink ? 'r link' : 'r'}>{right}</span>}
</div>
)}
<div className="pbody" style={bodyStyle}>
<div className="pbody">
{children}
</div>
</div>

View file

@ -6,18 +6,7 @@ import type { CliError } from '../lib/types'
*/
export function StaleBanner({ error }: { error: CliError }) {
return (
<div
role="status"
className="stale-banner"
style={{
fontSize: 11.5,
color: 'var(--mut)',
borderLeft: '2px solid var(--warn)',
padding: '3px 8px',
margin: '0 0 8px',
lineHeight: 1.4,
}}
>
<div role="status" className="stale-banner">
Refresh failed, showing last good data · {error.message}
</div>
)

View file

@ -21,7 +21,7 @@ function fmtMetric(v: number | null, fn: 'cost' | 'number' | 'percent' | 'decima
// the selected period. Say so instead of silently ignoring the dates.
function RangeNote() {
return (
<p className="cmp-range-note" role="status" style={{ color: 'var(--mut)', margin: '0 0 6px', fontSize: 11.5 }}>
<p className="cmp-range-note" role="status">
Compare uses the selected period, custom dates are not supported yet.
</p>
)
@ -91,7 +91,6 @@ export function Compare({
setModelA(next)
if (next === modelB) setModelB(nudgeDistinct(next))
}}
width={230}
/>
<span className="cmp-vs">vs</span>
<Dropdown
@ -103,7 +102,6 @@ export function Compare({
setModelB(next)
if (next === modelA) setModelA(nudgeDistinct(next))
}}
width={230}
/>
</div>
{modelA && modelB && modelA !== modelB && (

View file

@ -99,7 +99,7 @@ function ModelsUsage({
return (
<>
{report.error && <StaleBanner error={report.error} />}
<Panel bodyStyle={{ overflowX: 'auto' }}>
<Panel className="scroll-x">
{report.data.length ? (
<ModelsTable rows={report.data} byTask={byTask} onAddAlias={onAddAlias} />
) : (
@ -146,7 +146,7 @@ function AuditLens({
return (
<>
{report.error && <StaleBanner error={report.error} />}
<Panel bodyStyle={{ overflowX: 'auto' }}>
<Panel className="scroll-x">
{report.data.length ? (
<AuditTable rows={report.data} />
) : (

View file

@ -100,7 +100,7 @@ function renderQuota(data: QuotaProvider[] | null, error: ReturnType<typeof useP
}
return (
<Panel title="Live quota">
<p className="quota-connection-note">Loading quota…</p>
<p className="quota-connection-note">loading quota…</p>
</Panel>
)
}
@ -157,7 +157,7 @@ function QuotaContent({ quota, providerName }: { quota: QuotaProvider; providerN
if (quota.connection === 'disconnected') {
return <p className="quota-connection-note">Connect {providerName}: log in with the {providerName} CLI</p>
}
if (quota.connection === 'loading') return <p className="quota-connection-note">Loading quota…</p>
if (quota.connection === 'loading') return <p className="quota-connection-note">loading quota…</p>
if (quota.connection === 'stale' || quota.connection === 'transientFailure') {
return <p className="quota-connection-note">waiting on the CLI…</p>
}

View file

@ -153,7 +153,7 @@ function SpendPage({
<ProjectBreakdown projects={projects} />
</div>
<Panel title="Cost flow · model → project" right="model → project flow for this range" bodyStyle={{ overflowX: 'auto' }}>
<Panel title="Cost flow · model → project" right="model → project flow for this range" className="scroll-x">
{flow.data && flow.data.links.length ? (
<Sankey flow={flow.data} />
) : flow.error ? (

View file

@ -86,7 +86,7 @@ h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 6px
/* cards — Dash0 style: header strip + body */
.panel { background: var(--panel); border: 1px solid var(--hair); border-radius: 10px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 1px 2px rgba(0,0,0,.25); }
.phead { display: flex; align-items: center; gap: 8px; padding: 8px 13px; background: var(--phead); border-bottom: 1px solid var(--hair); }
.phead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--phead); border-bottom: 1px solid var(--hair); }
.phead b { font-size: 11.5px; font-weight: 560; color: var(--t2); }
.phead .r { margin-left: auto; font-size: 11px; color: var(--t3); }
.phead .r.link { color: var(--lav); font-weight: 530; }
@ -97,18 +97,6 @@ h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 6px
.stat .v small { font-size: 11px; color: var(--t3); font-weight: 500; letter-spacing: 0; }
.stat .d { font-size: 10.5px; margin-top: 4px; color: var(--t3); font-variant-numeric: tabular-nums; }
/* capsule chart (ref: gradient pill bars) */
.plot { position: relative; height: 108px; }
.gl { position: absolute; left: 0; right: 30px; border-top: 1px solid var(--hair); }
.gl em { position: absolute; right: -30px; top: -7px; font-style: normal; font-size: 9.5px; color: var(--t3); font-family: var(--mono); }
.bars { position: absolute; inset: 0 30px 0 0; display: flex; align-items: flex-end; gap: 3px; padding: 0 8px; }
.bars .c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bars .b { width: 100%; max-width: 12px; background: linear-gradient(to top, #232A3F, #2E3750); border-radius: 99px; min-height: 6px; }
.bars .c.hi .b { background: var(--grad-bar); box-shadow: 0 0 18px rgba(91,140,255,.35); }
.bars .c.hi2 .b { background: linear-gradient(to top, rgba(91,140,255,.4), #5B8CFF); }
.days { display: flex; justify-content: space-between; padding: 6px 38px 0 8px; }
.days span { font-size: 9.5px; color: var(--t3); font-family: var(--mono); }
/* stacked multi-series bars */
.spend-chart-panel { display: flex; flex-direction: column; }
.spend-chart-panel .pbody { display: flex; flex: 1; min-height: 0; flex-direction: column; }

View file

@ -44,6 +44,8 @@
--fs-hero: 40px; --fs-stat: 24px; --fs-kpi: 17px; --fs-subhead: 13px;
--fs-body: 12.5px; --fs-meta: 11.5px; --fs-label: 10.5px; --fs-micro: 9.5px;
--fw-body: 500; --fw-medium: 550; --fw-subhead: 600; --fw-strong: 620; --fw-kpi: 650; --fw-hero: 700;
/* Spacing scale (px). */
--sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px;
--grad: var(--accent);
--grad-bar: var(--bar-hi);
--t1: var(--ink);
@ -198,7 +200,7 @@ body { overflow: hidden; background: var(--bg); color: var(--ink); }
letter-spacing: .05em; text-transform: uppercase;
}
.about-modal-link {
position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 0;
position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: 8px 0;
color: var(--ink); font-size: 12.5px; text-decoration: none;
}
.about-modal-link + .about-modal-link::before {
@ -305,14 +307,33 @@ body { overflow: hidden; background: var(--bg); color: var(--ink); }
.spend-top-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.spend-breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.spend-scroll > .pbody { max-height: 300px; overflow-y: auto; }
.spend-scroll > .pbody::-webkit-scrollbar { width: 6px; }
.spend-scroll > .pbody::-webkit-scrollbar-thumb { background: var(--mut2); border-radius: 3px; }
.spend-scroll > .pbody::-webkit-scrollbar-track { background: var(--line); }
.scroll-x .pbody { overflow-x: auto; }
/* Thin, always-visible scrollbars so vertical/horizontal overflow stays discoverable. */
.spend-scroll > .pbody::-webkit-scrollbar,
.session-list::-webkit-scrollbar,
.scroll-x .pbody::-webkit-scrollbar { width: 6px; height: 6px; }
.spend-scroll > .pbody::-webkit-scrollbar-thumb,
.session-list::-webkit-scrollbar-thumb,
.scroll-x .pbody::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
.spend-scroll > .pbody::-webkit-scrollbar-thumb:hover,
.session-list::-webkit-scrollbar-thumb:hover,
.scroll-x .pbody::-webkit-scrollbar-thumb:hover { background: var(--mut2); }
.spend-scroll > .pbody::-webkit-scrollbar-track,
.session-list::-webkit-scrollbar-track,
.scroll-x .pbody::-webkit-scrollbar-track { background: transparent; }
.error-boundary { display: flex; padding: 20px; }
.error-card { max-width: 760px; padding: 16px 18px; }
.error-title { margin: 0 0 8px; font-size: 14px; font-weight: 620; color: var(--ink); }
.error-msg { margin: 0 0 12px; font-size: 12.5px; color: var(--bad); font-variant-numeric: tabular-nums; }
/* Notices — placeholder note, stale-data banner, daily-budget banner. */
.empty-note { color: var(--mut); margin: 0; font-size: 12px; }
.stale-banner { font-size: 11.5px; color: var(--mut); border-left: 2px solid var(--warn); padding: 3px 8px; margin: 0 0 8px; line-height: 1.4; }
.budget-banner { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 12px; font-weight: 550; color: var(--warn); border-left: 3px solid var(--warn); border-bottom: 1px solid var(--line); line-height: 1.4; }
.budget-banner.exceeded { color: var(--bad); border-left-color: var(--bad); }
.budget-banner > span { flex: 1; }
.budget-banner .set-text-button { color: var(--mut); }
/* Settings */
.body.set-body { align-self: stretch; align-items: stretch; justify-content: flex-start; width: auto; height: 100%; min-height: 0; max-width: none; margin: 0; padding: 0; overflow: hidden; flex-direction: row; gap: 0; }
.body.set-body > .set-rail, .body.set-body > .set-pane { width: auto; max-width: none; min-height: 0; margin: 0; flex-shrink: 1; }
@ -330,13 +351,13 @@ body { overflow: hidden; background: var(--bg); color: var(--ink); }
.set-cap { color: var(--mut2); font-size: 11px; line-height: 1.6; margin: 0; }
.set-p .card { overflow: visible; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--card-shadow); }
.about-sec { padding: 14px 18px; border-bottom: 1px solid var(--line2); }
.about-sec { padding: 12px 14px; border-bottom: 1px solid var(--line2); }
.about-sec.set-last-sec { border-bottom: 0; }
.about-sec-h { font-size: 10.5px; font-weight: 600; color: var(--mut2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.about-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: var(--fs-body); color: var(--ink); }
.about-row .tx small { display: block; color: var(--mut2); font-size: 11px; font-weight: 400; margin-top: 2px; }
.about-row .r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.set-prov-head { display: flex; align-items: center; gap: 10px; padding: 11px 15px; }
.set-prov-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.set-prov-name { font-size: var(--fs-subhead); font-weight: var(--fw-subhead); }
.set-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mut); font-weight: 520; }
.set-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mut2); flex: 0 0 auto; }
@ -442,9 +463,6 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.models-by-task .model-task-row td:first-child { padding-left: 24px; font-weight: 500; }
.models-by-task .model-task-row td:first-child::before { left: 22px; }
.models-by-task .model-task-row td:last-child::before { right: 2px; }
.bars .b, .bars .c.hi .b, .bars .c.hi2 .b { background: var(--bar); box-shadow: none; }
.bars .c.hi .b { background: var(--bar-hi); }
.bars .c.hi2 .b { background: color-mix(in srgb, var(--bar-hi) 70%, var(--bar)); }
.s-opus { background: var(--s-opus); }
.s-fable { background: var(--s-fable); }
.s-son { background: var(--s-sonnet); }
@ -468,7 +486,7 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.quota-connection-terminalFailure i { background: var(--bad); }
.quota-connection-note { margin: 0; color: var(--mut); font-size: 12px; }
.quota-connection-note.quota-terminal { color: var(--bad); }
.quota-windows { display: grid; gap: 15px; }
.quota-windows { display: grid; gap: var(--sp-4); }
.quota-window-labels { display: flex; align-items: baseline; gap: 12px; color: var(--ink); font-size: 12px; }
.quota-window-labels span:last-child { margin-left: auto; color: var(--mut); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.quota-window .track { margin-top: 7px; }
@ -535,7 +553,7 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.ov-link:hover, .ov-link:focus-visible, .ov-coach-cta:hover, .ov-coach-cta:focus-visible, .set-text-button:hover, .set-text-button:focus-visible { text-decoration-color: currentColor; }
.ov-insight-band { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: stretch; }
.ov-insight-band > :only-child { grid-column: 1 / -1; }
.ov-coach { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ov-coach { display: flex; align-items: center; gap: var(--sp-3); padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ov-coach > svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--mut2); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ov-coach-tx { font-size: 12.5px; color: var(--mut); flex: 1; line-height: 1.45; }
.ov-coach-tx .num { color: var(--ink); font-weight: 600; }
@ -730,7 +748,7 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.sessions-more:hover, .sessions-more:focus-visible { border-color: var(--accent); background: var(--hover); color: var(--ink); outline: none; }
.sessions-more-caption { color: var(--mut2); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.session-inline-detail { display: flex; min-width: 650px; flex-direction: column; gap: 12px; padding: 12px; border-top: 1px solid var(--line2); background: color-mix(in srgb, var(--panel) 84%, var(--hover)); }
.detail-head { padding: 14px 15px; }
.detail-head { padding: 10px 14px; }
.detail-head h3 { margin: 0 0 6px; font-size: 15px; font-weight: 620; }
.detail-line { color: var(--mut); font-size: 12px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@ -739,13 +757,15 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.session-detail-notes { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--mut); font-size: 11.5px; font-variant-numeric: tabular-nums; }
/* Compare */
.cmp-range-note { color: var(--mut); margin: 0 0 6px; font-size: 11.5px; }
.cmp-picker { display: flex; width: auto; align-items: center; align-self: flex-start; gap: 8px; }
.cmp-picker .dropdown { flex: 1 1 230px; min-width: 0; max-width: 230px; }
.cmp-picker .dropdown-trigger { min-height: 29px; padding: 6px 10px; font-size: 11.5px; }
.cmp-vs { color: var(--mut2); font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.cmp-body { display: flex; width: 100%; flex-direction: column; gap: 14px; }
.cmp-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.cmp-card { min-width: 0; overflow: hidden; box-shadow: var(--card-shadow); }
.cmp-head { display: flex; min-height: 42px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line2); background: var(--phead); }
.cmp-head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line2); background: var(--phead); }
.cmp-head h3 { margin: 0; font-size: var(--fs-subhead); font-weight: var(--fw-subhead); color: var(--ink); letter-spacing: -.005em; }
.cmp-head-note { margin-left: auto; color: var(--mut2); font-size: 10px; }
.cmp-metrics { padding: 4px 14px 7px; }
@ -758,12 +778,12 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.cmp-value { color: var(--mut); font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cmp-best { color: var(--ok); font-weight: 600; }
.cmp-foot { padding: 8px 14px 10px; border-top: 1px solid var(--line2); color: var(--mut2); font-size: 10px; }
.cmp-category-body { padding: 12px 14px 14px; }
.cmp-category-body { padding: 12px 14px; }
.cmp-legend { display: flex; justify-content: flex-end; gap: 16px; margin-bottom: 10px; color: var(--mut); font-size: 10px; }
.cmp-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cmp-key { width: 14px; height: 4px; border-radius: 2px; background: var(--accent); }
.cmp-key.cmp-key-b { background: var(--bar-hi); }
.cmp-categories { display: flex; flex-direction: column; gap: 11px; }
.cmp-categories { display: flex; flex-direction: column; gap: var(--sp-3); }
.cmp-category { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: start; gap: 12px; }
.cmp-category-name { padding-top: 8px; color: var(--ink); font-size: 11.5px; font-weight: 560; }
.cmp-bars { display: grid; gap: 5px; }
@ -777,7 +797,6 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
@media (max-width: 860px) {
.spend-top-row { grid-template-columns: 1fr; }
.spend-breakdowns { grid-template-columns: 1fr; }
.cmp-picker .dropdown { width: 180px !important; }
.cmp-pair { grid-template-columns: 1fr; }
.cmp-metric-head, .cmp-metric { grid-template-columns: minmax(110px, 1fr) 76px 76px; }
}
@ -786,7 +805,6 @@ td:first-child { font-size: var(--fs-body); font-weight: var(--fw-body); }
.sessions-toolbar, .sessions-search { width: 100%; }
.sessions-search { min-width: 0; }
.cmp-picker { gap: 5px; }
.cmp-picker .dropdown { width: 42vw !important; min-width: 0; }
.cmp-category { grid-template-columns: 70px minmax(0, 1fr); }
.cmp-bar-row { grid-template-columns: minmax(0, 1fr) 76px; }
}