Skip to content

fix(templates): stop the panel grid overflowing below 336px - #31

Merged
scheemunai merged 1 commit into
mainfrom
fix/template-overflow-320
Sep 5, 2026
Merged

fix(templates): stop the panel grid overflowing below 336px#31
scheemunai merged 1 commit into
mainfrom
fix/template-overflow-320

Conversation

@scheemunai

Copy link
Copy Markdown
Owner

The defect

metrics-dashboard scrolls sideways at narrow widths. Reproduced locally and matching the production measurement exactly:

320 -> 16px overflow
328 ->  8px
336 ->  0

An auto-fit minmax floor wider than the content box cannot shrink, so the grid item overflows the page rather than the track collapsing. .panels used minmax(20rem,1fr) — 320px inside a 288px content box.

- grid-template-columns:repeat(auto-fit,minmax(20rem,1fr))
+ grid-template-columns:repeat(auto-fit,minmax(min(20rem,100%),1fr))

Scope: one live, five preventive

Guarded every auto-fit floor ≥14rem across the seven research and status templates. Swept all seven from main at every width 320–420:

template on main
metrics-dashboard overflows, 320–335
the other six clean

So only one is live. The other five floors are narrower than the box at present and depend on padding and content not changing — they are guarded because it is the same defect and the fix is one line each, not because they fail today.

Height-neutral, verified rather than assumed

Swept 320–1920 before and after:

main guarded
report · research-brief · postmortem · case-study · project-status · service-health identical peaks
metrics-dashboard 2573 @320 2601 @320

The one change is real and expected: content that was spilling sideways now wraps inside the viewport, so 28px of genuine panel height appears. It was previously hidden by the defect it is being measured against. I would rather report that than claim height-neutrality that is true of six sevenths.

Deliberately carries no height work

Horizontal overflow is a defect at any threshold — nobody chooses to scroll sideways. This is split out of #30 so the one-line fix does not wait on the 2,900 re-derivation. #30 is parked, not abandoned.

Verified with builder-1's width-sweep.cjs, which asserts innerWidth before every recorded value and refuses rather than records, and reports overflow as a first-class failure — which is the only reason this was findable at all, since metrics-dashboard passes every height check comfortably.

🤖 Generated with Claude Code

metrics-dashboard scrolls sideways at narrow widths: 16px of horizontal
overflow at 320, 8px at 328, clear by 336. Reproduced on the live frame and
locally at 16 widths, 320-335.

An auto-fit minmax floor wider than the content box cannot shrink, so the grid
item overflows the page rather than the track collapsing. .panels used
minmax(20rem,1fr) = 320px inside a 288px content box. min(20rem,100%) lets it
shrink to fit.

Guarded every auto-fit floor >= 14rem across the seven research and status
templates, not only the one that fails today. Only metrics-dashboard is live;
the other five are latent -- their floors are narrower than the box at present,
so they depend on padding and content not changing. Measured at every width
320-420: metrics-dashboard overflows on main, none of the other six do.

Height-neutral for six of seven, verified by sweeping 320-1920 before and
after: identical peaks. metrics-dashboard moves 2573 -> 2601 at 320, because
content that was spilling sideways now wraps inside the viewport -- that 28px
is the honest height of the panel, and it was previously hidden by the defect
it is being measured against.

This carries no height work. It is separated from the halted 2,900 threshold
question deliberately: horizontal overflow is a defect at any threshold, and
the one-line fix for it should not wait on a number nobody is currently
prepared to defend.

Co-Authored-By: CRHQ <noreply@crhq.ai>
@scheemunai
scheemunai merged commit a31b75d into main Sep 5, 2026
5 checks passed
@scheemunai
scheemunai deleted the fix/template-overflow-320 branch September 5, 2026 15:08
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