Repository navigation
🐛 dashboard: keep Overview KPI tiles inside the phone viewport - #16602
Closed
clubanderson wants to merge 1 commit into
Closed
clubanderson wants to merge 1 commit into
clubanderson wants to merge 1 commit into
Conversation
The nowrap .overview-kpi-stale pill widened the single-column .overview-headline grid past the viewport, so every KPI tile, subline and sparkline was laid out at ~483px on a 430px phone and clipped. Labels/sublines also used var(--fs-2xs), which has no :root value and fell back to 16px. Let the pill wrap inside the card, clamp headline children to the track (min-width:0 / max-width:100%), wrap sublines, cap sparklines at 100%, and use --fs-base / --fs-md for label/subline at <=720px. Fixes #16601 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16601
Root cause
On a 430px phone the spoke Overview panel's KPI tiles were laid out ~483px wide: sublines were clipped at the card edge, sparklines (
width:100%) overflowed the tile, and the whole grid was wider than the viewport. Label/subline text rendered at 16px..overview-headlineis a single auto-column grid..overview-kpi-stalewaswhite-space: nowrap, so its min-content width ("refreshing after restart (3m ago) · 0/10 repos scanned · showing snapshot …") stretched the grid track, and every sibling (.overview-kpis, tiles, sparklines) was laid out at that width..overview-kpi-label/.overview-kpi-sublineusevar(--fs-2xs)(467ca6a, 🌱 dashboard: generate index.html from per-area sources #15300), but--fs-2xsis only defined inside.config-modaland the TV-density popout scope — never at:root— so the tiles inherited the 16px body size.Measured with headless Chrome at a 430px viewport (old v6 image 3820712 and v5 HEAD d5013b7 behave identically; the "2 days ago" screenshot differed only because the pill was not shown/zoom):
.overview-kpiswidth.overview-kpi-stale--fs-base)--fs-md)Change (
static-src/css/overview.css, bundle regenerated viamake dashboard-gen).overview-headline > * { min-width:0; max-width:100% },.overview-kpis { min-width:0 }.overview-kpi-stale:white-space: normal; overflow-wrap: anywhere; justify-self: start.overview-kpi { min-width:0 },.overview-kpi-subline { overflow-wrap: anywhere }max-width:100%; min-width:0@media (max-width:720px): label →--fs-base, subline →--fs-md(existing tokens; no rawfont-size, style ratchet unchanged)Desktop is unaffected except that a stale pill too long for the card now wraps instead of widening it.
Tests
cd src && go test ./pkg/dashboard/... -run 'Ratchet|Static|Snapshot|SharedAsset'✅node --test 'src/pkg/dashboard/**/*.test.js'— 302/302 ✅make dashboard-gen-check✅