Skip to content

fix(dashboard): Executions tile stops slicing its legend and says what it hides (#2228) - #2237

Merged
vybe merged 1 commit into
devfrom
feature/2228-executions-legend-clip
Aug 16, 2026
Merged

vybe merged 1 commit into
devfrom
feature/2228-executions-legend-clip

Conversation

@trinity-ability

Copy link
Copy Markdown
Contributor

Summary

  • The Executions tile's legend clamped with max-height: 26px — ~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.
  • Measuring the running tile found a second clip behind the same symptom: .it-body is overflow: hidden at a fixed CELL_H and offers 134px, while the tile already asked for ~138 before this change. Fixing the legend alone leaves the symptom on screen.
  • The legend is now a fixed two whole rows, the vertical budget is stated explicitly and fits, and anything that still does not fit is handed to a +N chip that names it.

The two clips

before after
.ex-legend row 2 sliced (cut 11px into a 13px row) fully visible
.it-body overflow 6px (4px before this branch) 0px

Changes

src/frontend/src/components/tiles/ExecutionsTile.vue

  • .ex-head pins line-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-chart 78px → 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-legend takes a fixed 28px (two 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.
  • Renders legend.shown plus a +N chip carrying the hidden swatches and naming them in its title.

src/frontend/src/utils/executionsTile.js

  • legendFit() packs keys into the available rows and returns {shown, hidden}. CSS can clamp but cannot report what it dropped.
  • The width model is pessimistic per key, not in aggregate: greedy packing wastes space at the end of each row, so a model 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 = 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_PAD make the chart's share of the budget explicit beside the legend's.

Test Plan

  • npx vitest run — 670 passed, incl. 40 for this tile
  • Source-parsing guards pin the CSS budget to the JS constants (a stylesheet and a constant cannot check each other; jsdom does no cascade resolution, so a mid-row clamp looks identical to a clean one under getComputedStyle — same rationale as gridTokens.spec.js)
  • vite build clean; raw-color ratchet unchanged (tokens only, no new token)
  • Verified in the running app with the full 11-key vocabulary:
check result
legend rows / sliced keys 2 / 0
keys hidden by the body 0
.it-body overflow 0px (was 6)
legend height @ 2 keys vs 11 keys 28px / 28px → chart never reflows
width model vs measured labels 0 violations across all 11
light + dark same geometry; chip resolves real tokens in both

Calibration 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

…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 vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vybe
vybe merged commit c5705c5 into dev Aug 16, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants