Skip to content

Fix horizontal overflow on public Test pages at narrow viewports - #37

Merged
ItsJazii merged 1 commit into
mainfrom
fix/test-detail-mobile-overflow
Aug 25, 2026
Merged

Fix horizontal overflow on public Test pages at narrow viewports#37
ItsJazii merged 1 commit into
mainfrom
fix/test-detail-mobile-overflow

Conversation

@ItsJazii

@ItsJazii ItsJazii commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Problem

On public Test pages (/tests/[slug]), a 390px-wide screen stretched to ~760px+ and forced sideways scrolling.

Two independent overflow sources, confirmed by four independent reproductions:

  1. Unwrapped <pre> content — the prompt / system prompt / settings blocks in the TEST DETAILS section render in <pre> inside .context-grid with default white-space: pre, and the grid cards default to min-width: auto. One long unbroken line (URL, seed, minified value) pins the grid — and the whole page — to that line's width.
  2. Image-evidence box minimum width.artifact-image combines min-height: 280px with aspect-ratio: 16/10, forcing a 448px minimum width below ~472px viewport, so any Test with image evidence still side-scrolled after fixing the pre path alone.

Fix (CSS only, app/globals.css, +35 lines)

  • min-width: 0 on .context-grid > article, .showcase-hero > div, .showcase-spec (and its rows) so grid/flex items can shrink below content width.
  • .context-grid > article > pre: pre-wrap, overflow-wrap: anywhere, word-break: break-word, overflow-x: auto — wraps long lines instead of widening the page (matches the existing .run-evidence pre / .transcript-panel pre patterns).
  • .artifact-image { min-height: 0 } inside a max-width: 640px media query placed after the base rule — same specificity, later declaration wins; media queries add no specificity, so placement matters (verified: placed in the earlier media block, the override loses to the base rule at line ~2763 and the overflow remains).
  • overflow-wrap: anywhere on .showcase-spec strong/small for long model names/versions.

Desktop layout unchanged.

Proof (390px viewport, pageWidth = document.documentElement.scrollWidth, overflow = scrollWidth > clientWidth)

Run Harness Before After Overflow after
This PR's branch (git-applied patch, real repo CSS) Chrome CDP device-metrics 1013px 390px false
Independent repro A Chrome CDP 770px 375px false
Independent repro B Chrome CDP, own fixture 698px 390px false
Independent repro C Playwright 2603px 390px false

Different BEFORE magnitudes reflect different fixture content (width follows the longest unbroken line) — same mechanism, same fix. Second path in isolation: 460px overflow → 390px clean with the .artifact-image override.

Before/after screenshots (390px @2x, this exact patch): see benchmax-elife-before-overflow.png / benchmax-elife-after-fix.png (shared with the team; will attach here when the upload endpoint recovers).


Open in Devin Review

Two independent overflow sources on /tests/[slug] at ~390px:

1. Prompt/system-prompt/settings render in <pre> blocks inside
   .context-grid with default white-space:pre and grid items defaulting
   to min-width:auto, so one long unbroken line pins the grid (and the
   whole page) to that line's width. Add min-width:0 to the grid cards
   and pre-wrap/overflow-wrap to the pre, matching the existing
   .run-evidence/.transcript-panel pre patterns.

2. .artifact-image combines min-height:280px with aspect-ratio:16/10,
   forcing a 448px minimum width below ~472px viewport. Add a
   min-height:0 override inside a max-width:640px media query placed
   after the base rule so it wins the cascade (media queries add no
   specificity).

Also guard .showcase-hero > div and .showcase-spec rows (long model
names/versions) with min-width:0 and overflow-wrap:anywhere.

Verified at a true 390px viewport (Chrome CDP device-metrics override,
pageWidth = documentElement.scrollWidth): before 1013px overflow,
after 390px no overflow. Independent confirmations: 770->375,
698->390, 2603->390 across three separate harnesses.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@ItsJazii
ItsJazii merged commit e0e6d90 into main Aug 25, 2026
2 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.

1 participant