Skip to content

fix(viewer): cap content width, hug warnings, fill heat cells#19

Merged
dutifulbob merged 1 commit into
mainfrom
fix/viewer-css
Jul 6, 2026
Merged

fix(viewer): cap content width, hug warnings, fill heat cells#19
dutifulbob merged 1 commit into
mainfrom
fix/viewer-css

Conversation

@dutifulbob

Copy link
Copy Markdown
Member

Opened on behalf of Onur Solmaz (osolmaz).

Summary

The viewer was unpleasant on a wide screen: the content stretched edge-to-edge, warning banners spanned the full width for a single sentence, and every heat cell floated as a rounded bar with white gaps around it, so a row didn't read as a heatmap.
This caps the data column, sizes warnings to their text, and lets heat cells fill their table cell.

What Changed

CSS-only, in the viewer SPA (internal/viewer/web/src/styles.css), plus the rebuilt web/dist.

  • .tab-content: max-width: 1440px + margin-inline: auto so the data column is centered and readable instead of spanning the whole viewport.
  • .warning: width: fit-content; max-width: 100% so a banner hugs its text rather than flex-filling.
  • Heat cells: td:has(.metric-trigger) drops the cell padding and .metric-trigger fills the cell (display:block; width:100%) carrying its own 7px 8px text inset, so adjacent colored cells are contiguous — a continuous heatmap, no white gaps.

Testing

Rebuilt web/dist (npm build) and re-embedded; go build ./internal/viewer/ passes. Verified visually with a headless-chromium screenshot at 2560px before/after: content centered at 1440px, warning hugs its text, heat cells fill their cells with TTFT values intact.

Risks

Low — CSS-only. :has() is supported in all current browsers the viewer targets. The header/tab bar intentionally stays full-width; only the data content is capped.

Widescreen tweaks to the viewer SPA: cap the data column at 1440px and
center it so it does not stretch edge-to-edge; size warning banners to
their text instead of full width; and let heat cells fill their table
cell (td padding removed, color carries its own text inset) so a row
reads as a continuous heatmap instead of floating rounded bars with
white gaps. Rebuilt web/dist.
@dutifulbob dutifulbob merged commit a7ac9eb into main Jul 6, 2026
2 checks passed
@dutifulbob dutifulbob deleted the fix/viewer-css branch July 6, 2026 15:23
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.

2 participants