From af0b0fcd33469e1a36e3bce694eeb1298007fd07 Mon Sep 17 00:00:00 2001 From: Tomek Zebrowski Date: Sun, 23 Aug 2026 19:45:31 +0200 Subject: [PATCH] feat: give the registry chart the modal height and dedupe saved runs Acceleration Runs Registry: the chart now flexes to fill the modal (full 92vh, wider max-width) instead of sitting at a fixed 320px under a boxed Launch Conditions panel. Those readings moved above the chart as a one-line chip strip, and the run list is capped lower since it is a picker, not the content. The full height is only claimed once a chart is on screen, so the picker-only state is not a mostly empty tall box. Saving a run that is already in the registry is now a no-op with an alert rather than another identical row: saved runs carry the absolute launch timestamp (runStartTime) as identity, with a fallback to the run figures for records written before that field existed. --- .../acceleration-registry-modal.css | 91 ++++++++++++------- .../acceleration-registry-modal.html | 29 +++--- .../acceleration-registry-modal.ts | 5 + src/app/core/acceleration.service.spec.ts | 54 +++++++++++ src/app/core/acceleration.service.ts | 40 ++++++++ 5 files changed, 172 insertions(+), 47 deletions(-) diff --git a/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.css b/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.css index 42b016b..7b02a98 100644 --- a/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.css +++ b/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.css @@ -1,17 +1,33 @@ .accel-registry-content { - width: 90vw; - max-width: 900px; - max-height: 85vh; + width: 92vw; + max-width: 1100px; + max-height: 92vh; display: flex; flex-direction: column; } +/* Only claim the full viewport height once a chart is on screen -- otherwise + the picker-only state would render as a mostly empty tall box. */ +.accel-registry-content.has-result { + height: 92vh; +} + +/* Override the global .modal-body max-height so the body owns the leftover + modal height and the chart (the only flexible child) can absorb it. */ +.accel-registry-content .modal-body { + flex: 1; + min-height: 0; + max-height: none; +} + .accel-registry-list { display: flex; flex-direction: column; gap: 8px; - max-height: 40vh; + /* Capped low on purpose: the list is a picker, the chart is the content. */ + max-height: 26vh; overflow-y: auto; + flex-shrink: 0; } .accel-registry-row { @@ -53,21 +69,27 @@ } .accel-registry-result { - margin-top: 20px; - padding-top: 20px; + margin-top: 12px; + padding-top: 12px; border-top: 1px solid var(--grid); + display: flex; + flex-direction: column; + gap: 10px; + flex: 1; + min-height: 0; } .accel-registry-chart-wrapper { position: relative; - height: 320px; + flex: 1; + min-height: 320px; } .accel-registry-stats-table { width: 100%; - margin-top: 15px; border-collapse: collapse; font-size: 0.85em; + flex-shrink: 0; } .accel-registry-stats-table th, @@ -94,7 +116,7 @@ flex-wrap: wrap; justify-content: center; gap: 8px; - margin-top: 10px; + flex-shrink: 0; } .accel-gearshift-chip { @@ -106,39 +128,42 @@ padding: 3px 10px; } -.accel-context-panel { - margin-top: 12px; - padding: 12px 15px; - border: 1px solid var(--border); - border-left: 3px solid var(--accent); - border-radius: 8px; - background: color-mix(in srgb, var(--accent) 6%, transparent); - max-width: 320px; -} - -.accel-context-title { +/* Launch conditions sit as a one-line chip strip above the chart rather than + a side panel underneath it, so the chart keeps the full body height. */ +.accel-context-strip { display: flex; + flex-wrap: wrap; align-items: center; gap: 6px; - font-size: 0.72em; + flex-shrink: 0; +} + +.accel-context-strip-title { + display: inline-flex; + align-items: center; + gap: 5px; + font-size: 0.7em; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.03em; - margin-bottom: 8px; -} - -.accel-context-rows { - display: flex; - flex-direction: column; - gap: 4px; + margin-right: 2px; + /* Stacked on two lines so the label costs one chip's worth of width. */ + line-height: 1.15; + white-space: nowrap; + flex-shrink: 0; } -.accel-context-row { - display: flex; - justify-content: space-between; - gap: 8px; - font-size: 0.82em; +.accel-context-chip { + display: inline-flex; + align-items: baseline; + gap: 6px; + max-width: 100%; + font-size: 0.75em; + padding: 3px 10px; + border: 1px solid var(--border); + border-radius: 999px; + background: color-mix(in srgb, var(--accent) 6%, transparent); } .accel-context-name { diff --git a/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.html b/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.html index 0fcb53c..d0dd3c5 100644 --- a/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.html +++ b/src/app/analyzer/acceleration-registry-modal/acceleration-registry-modal.html @@ -2,6 +2,7 @@