From bffcb8bebf59942684fd2ff77f1fa6bd07459659 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 19:56:26 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20mobile-shots:=20phone-chrome=20p?= =?UTF-8?q?robe=20accepts=20a=20tall=20first=20fixture=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tracker-phone-chrome acceptance added in #17176 asserts that a row is fully visible at 375x667 with the section header at the top. The density fixture's first .ham-row is a whole work-item cluster (parent issue, child PR, decision, notes: ~418px) and never fits the 397px left below the chrome, so every dashboard PR fails mobile-shots at 375x667 regardless of its diff. Keep the intent (chrome stays short, a row shows without scrolling) but accept a first row taller than the remaining viewport when at least 120px of it is visible. Ignore the scratch Chrome profile the harness creates. Signed-off-by: Andrew Anderson --- .gitignore | 3 +++ .../webstatic/testdata/tracker-phone-chrome.js | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b23f86b2c9..894a37beb9 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ src/docs/design/_out/ # smoke test's socket + work dir. Build products, never source. src/crux/bin/ src/crux/.smoke/ + +# scratch Chrome profile from src/scripts/dashboard-mobile-shots.mjs +.chrome-dashboard-mobile-shots/ diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js index 210701156d..5504e73cdd 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-phone-chrome.js @@ -2,13 +2,15 @@ // Phone-only acceptance for the Activity monitor chrome (#17158): on a // portrait phone the compact filter bar replaces the toolbar, the chrome // between the section header and the first row stays short enough that a -// row is visible without scrolling, and the ⋯ Filters sheet carries the -// full toolbar and returns it on close. Desktop and landscape return a +// row is visible without scrolling (a fixture row is a whole work-item +// cluster, so a tall first row only has to show its header line), and the +// ⋯ Filters sheet carries the full toolbar and returns it on close. Desktop and landscape return a // skip marker; they are covered elsewhere. Restores scroll positions. (async ({ dedicatedPreview = false } = {}) => { if (!dedicatedPreview) throw new Error('Use a dedicated published-preview tab, not the user’s live dashboard'); const phoneMaxWidth = 640; const maxChromePx = 160; + const minRowPeekPx = 120; const failures = []; const assert = (ok, label) => { if (!ok) failures.push(label); }; const rect = el => el.getBoundingClientRect(); @@ -53,7 +55,14 @@ measurements.chrome = Math.round(rect(first).top - rect(header).bottom - measurements.fixtureNote); assert(measurements.chrome <= maxChromePx, 'chrome between the section header and the first row is ' + measurements.chrome + 'px (max ' + maxChromePx + ')'); measurements.rowsFullyVisible = rows.filter(row => { const box = rect(row); return box.top >= navbar - 1 && box.bottom <= innerHeight + 1; }).length; - assert(measurements.rowsFullyVisible >= 1, 'at least one row is fully visible with the section header at the top of the viewport'); + // The density fixture's first row is a parent issue with its child PR, + // decision and notes: taller than a 667px phone leaves below the chrome + // (#17176). Accept it when enough of it shows to read its header line. + const firstBox = rect(first); + measurements.firstRowPeek = Math.round(Math.min(firstBox.bottom, innerHeight) - Math.max(firstBox.top, navbar)); + const firstRowTooTall = firstBox.height > innerHeight - Math.max(firstBox.top, navbar); + assert(measurements.rowsFullyVisible >= 1 || (firstRowTooTall && measurements.firstRowPeek >= minRowPeekPx), + 'at least one row is fully visible with the section header at the top of the viewport (or the first row is taller than the space left and shows at least ' + minRowPeekPx + 'px, got ' + measurements.firstRowPeek + 'px)'); } const sticky = document.getElementById('activity-monitor-sticky'); if (sticky) {