diff --git a/server/src/ledgrab/static/css/cards.css b/server/src/ledgrab/static/css/cards.css index 36d8bd6..daaeae4 100644 --- a/server/src/ledgrab/static/css/cards.css +++ b/server/src/ledgrab/static/css/cards.css @@ -1253,39 +1253,8 @@ ul.section-tip li { align-items: center; } -/* Collapsible target pipeline metrics */ -.target-metrics-collapse { - margin-top: 4px; -} -.target-metrics-toggle { - cursor: pointer; - font-size: 0.75rem; - color: var(--text-secondary); - padding: 4px 0; - user-select: none; - background: none; - border: none; - font-family: inherit; -} -.target-metrics-toggle::before { - content: '▸ '; -} -.target-metrics-collapse.open .target-metrics-toggle::before { - content: '▾ '; -} -.target-metrics-animate { - display: grid; - grid-template-rows: 0fr; - transition: grid-template-rows 0.25s ease; -} -.target-metrics-collapse.open .target-metrics-animate { - grid-template-rows: 1fr; -} -.target-metrics-animate > .target-metrics-expanded { - overflow: hidden; -} - -/* Timing breakdown bar */ +/* Timing breakdown bar — used by graph-editor and the api-input test + modal; the targets card uses its own .target-pipeline wrapper. */ .timing-breakdown { margin-top: 8px; padding: 6px 8px; @@ -2188,6 +2157,63 @@ ul.section-tip li { background: color-mix(in srgb, var(--ch-coral, var(--danger-color)) 10%, transparent); } +/* Inline chip variant — used by the pipeline strip on running target + cards. A bigger numeric (display-font-ish) sits beside a small mono + caps unit, so a chip can carry "127K · frames" without looking like + a label-shaped pill. The data values inside still update via + _patchTargetMetrics. */ +.mod-card .chip--inline { + gap: 4px; + padding: 3px 8px; +} +.mod-card .chip--inline > span { + font-family: var(--font-mono, monospace); + font-size: 0.78rem; + font-weight: 700; + color: var(--lux-ink, var(--text-color)); + font-variant-numeric: tabular-nums; + letter-spacing: 0; +} +.mod-card .chip--inline > small { + font-family: var(--font-mono, monospace); + font-size: 0.55rem; + font-weight: 600; + letter-spacing: 0.18em; + text-transform: uppercase; + color: var(--lux-ink-mute, var(--text-secondary)); +} + +/* ── Pipeline strip — replaces the old target-metrics-collapse. A + thin always-visible segmented timing bar plus a tight chip row + below it (timing total / frames / keepalive). The bar is the + diagnostic; the chips are the counters. */ +.mod-card .target-pipeline { + display: flex; + flex-direction: column; + gap: 8px; +} +.mod-card .target-pipeline .timing-bar { + height: 4px; + border-radius: 2px; + background: var(--lux-bg-0, var(--bg-color)); + box-shadow: inset 0 0 0 1px var(--lux-line, var(--border-color)); + margin: 0; + overflow: hidden; + gap: 0; +} +.mod-card .target-pipeline .timing-seg { + transition: flex 0.3s ease; + opacity: 0.85; +} +.mod-card .target-pipeline .timing-seg:hover { + opacity: 1; +} +.mod-card .target-pipeline-chips { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + /* ── Brightness fader (mod-card variant) ────────────────────────── */ .mod-fader { diff --git a/server/src/ledgrab/static/js/features/targets.ts b/server/src/ledgrab/static/js/features/targets.ts index 7b03618..30ce20d 100644 --- a/server/src/ledgrab/static/js/features/targets.ts +++ b/server/src/ledgrab/static/js/features/targets.ts @@ -874,37 +874,27 @@ function _cssSourceName(cssId: any, colorStripSourceMap: any) { // ─── In-place metric patching (avoids full card replacement on polls) ─── -function _buildLedTimingHTML(state: any) { +/** Builds just the inner segments of the timing bar — no wrapper. + * Each segment is flex-sized by its ms cost and tooltipped with its + * stage label. Used by both the initial render and the patcher. + * The wrapper `.timing-bar` lives in the card markup so the bar + * itself doesn't get replaced on every poll (preserves transitions). */ +function _buildLedTimingSegments(state: any): string { const isAudio = state.timing_audio_read_ms != null; - return ` -