Repository navigation
fix(dashboard): Executions tile stops slicing its legend and says what it hides (#2228) - #2237
Conversation
…t it hides (#2228) The legend clamped itself with `max-height: 26px` — about 1.7 rows at its 15px pitch — so `overflow: hidden` cut row two through the glyphs instead of hiding it, and any key past the clamp vanished with no `+N` and no tooltip, leaving colours in the chart with no decoder anywhere on the tile. Measuring the running tile found a SECOND clip behind the same symptom, which fixing the legend alone leaves on screen: `.it-body` is `overflow: hidden` at a fixed CELL_H and offers 134px, while the tile already asked for ~138 before this change. Whatever the legend does, the body shaves its last row off. So the vertical budget is now stated explicitly and fits: - `.ex-head` pins `line-height: 1` (baseline-aligning 20px and 12px text made it 22.1px, and every px here comes out of the legend at the far end); - `.ex-chart` drops 78px -> 70px, exactly CHART_HEIGHT + COL_GAP + RAIL_HEIGHT + padding. It stood 4px above its tallest possible column — dead space paid for at the legend's expense; - `.ex-legend` takes a fixed 28px, two whole rows. HEIGHT, not max-height: a ceiling grows with the key count and would resize the chart every time a bucket appeared or went quiet. CSS can clamp but cannot report what it dropped, so `legendFit` in the pure module packs the keys into those rows and hands the remainder to a `+N` chip that carries the hidden swatches and names them in its title. Its width model is pessimistic per KEY, not in aggregate: greedy packing wastes space at the end of each row, so a model that is generous overall but tight on one name still lets a real third row form. Over-reserving shows an unnecessary `+N`; under-reserving loses keys silently. LEGEND_WIDTH is CELL_W - 50, not - 46: counting only InfoTile's padding and forgetting its 1px borders claims 338px for an element that measures 334 — error in the one direction that manufactures a third row. Verified in the running app: with all eleven keys the legend holds 2 rows, 0 sliced, 0 hidden by the body, and body overflow is 0 (was 6); the legend measures 28px with 2 keys and with 11, so the chart never reflows; both themes resolve real token colours. Calibration figures in the comments are measured, not estimated. 40 unit tests, incl. source-parsing guards pinning the CSS budget to the JS constants, since a stylesheet and a constant cannot check each other. Fixes #2228 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
vybe
left a comment
There was a problem hiding this comment.
Validated per /validate-pr.
Correctness of the fix: two clips, both real. The max-height: 26px clamp landing mid-row (26px is not a whole multiple of the 15px pitch) is the reported symptom; the .it-body overflow at fixed CELL_H is the one that would have left the symptom on screen after a legend-only fix. Fixing both together is the right call.
The width model's bias is correct and correctly argued. legendFit/keyWidth are pessimistic per key, not in aggregate — which is the load-bearing distinction, since greedy packing wastes space at the end of each row and an aggregate-only margin still lets a real third row form. The asymmetry is stated and the safe direction chosen: over-reserve shows an unnecessary +N, under-reserve loses keys silently. LEGEND_WIDTH = CELL_W - 50 (padding plus the 1px borders) rather than - 46 is the same discipline — 46 claims 338px for an element that measures 334.
pack() reviewed for termination: the used === 0 force-place means a key wider than a whole row is clipped by CSS rather than spinning the packer; the two-pass chip reservation avoids truncating sets that fit without a chip. No unbounded loop.
Accepted trade-off: at the full 11-key vocabulary the model shows +2 where the browser would fit them. Documented, and it gives up the last keys in stack order (Other, failed) — the right end to lose from, with the failure count already stated in the headline and both named in the chip's title.
CI: fully green, all 20 non-skipped checks including e2e and all six pytest legs. Frontend-only diff, zero backend surface.
Scan: no secrets, no host paths, no mode/symlink changes. Bug fix → descriptive commit only per the tiered-docs rule; correctly no architecture/feature-flow change.
Source-parsing guards pinning the CSS budget to the JS constants are the right shape here — jsdom does no cascade resolution, so a mid-row clamp and a clean one are indistinguishable under getComputedStyle.
Summary
max-height: 26px— ~1.7 rows at its 15px pitch — sooverflow: hiddencut row two through the glyphs instead of hiding it, and any key past the clamp vanished with no+Nand no tooltip..it-bodyisoverflow: hiddenat a fixedCELL_Hand offers 134px, while the tile already asked for ~138 before this change. Fixing the legend alone leaves the symptom on screen.+Nchip that names it.The two clips
.ex-legendrow 2.it-bodyoverflowChanges
src/frontend/src/components/tiles/ExecutionsTile.vue.ex-headpinsline-height: 1— baseline-aligning 20px and 12px text made the box 22.1px, and every px here comes out of the legend at the far end of a fixed-height tile..ex-chart78px → 70px =CHART_HEIGHT + COL_GAP + RAIL_HEIGHT + padding. It stood 4px above its tallest possible column: dead space paid for at the legend's expense..ex-legendtakes a fixed 28px (two rows).height, notmax-height— a ceiling grows with the key count and would resize the chart every time a bucket appeared or went quiet.legend.shownplus a+Nchip carrying the hidden swatches and naming them in itstitle.src/frontend/src/utils/executionsTile.jslegendFit()packs keys into the available rows and returns{shown, hidden}. CSS can clamp but cannot report what it dropped.+N; under-reserving loses keys silently.LEGEND_WIDTH = CELL_W - 50, not- 46: counting only InfoTile's padding and forgetting its 1px borders claims 338px for an element that measures 334 — error in the one direction that manufactures a third row.CHART_HEIGHT/RAIL_HEIGHT/COL_GAP/CHART_PADmake the chart's share of the budget explicit beside the legend's.Test Plan
npx vitest run— 670 passed, incl. 40 for this tilegetComputedStyle— same rationale asgridTokens.spec.js)vite buildclean; raw-color ratchet unchanged (tokens only, no new token)2/00.it-bodyoverflow0px(was6)28px/28px→ chart never reflowsCalibration figures in the comments are measured, not estimated — my first pass had them wrong in the unsafe direction, which is how the 334-vs-338 width error surfaced.
Notes
Per CLAUDE.md tiered docs, a bug fix needs a descriptive commit message only — no
architecture.md/ feature-flow change. Behaviour on today's fleets is unchanged apart from the fix: eight keys still render without a chip.Fixes #2228
🤖 Generated with Claude Code