From 89dbf5690256e100407751519c1038f96b9a1d07 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 20:43:20 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20mobile-shots:=20phone-ergonomics?= =?UTF-8?q?=20probe=20measures=20the=20progress=20pill's=20extended=20hit?= =?UTF-8?q?=20area?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- .../webstatic/testdata/tracker-phone-ergonomics.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js b/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js index d749ff9f4a..62bc632337 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js @@ -30,9 +30,19 @@ const stripCell = el => el.matches('.ham-chevron-info, .ham-chevron-decision, .ham-chevron-copy .ham-decision-trigger'); const controls = [...section.querySelectorAll('button, a[href], input, select, summary, [role="button"], [role="menuitem"], [tabindex]:not([tabindex="-1"]):not(.ham-row):not(.ham-sub)')] .filter(el => visible(el) && !inlineText(el) && !stripCell(el)); + // A compact control may extend its hit area with an absolutely positioned + // empty ::before (the progress pill, #17183): its tap target is the pseudo + // box, not the painted box. Negative insets grow the rect. + const hitRect = el => { + const r = el.getBoundingClientRect(); + const b = getComputedStyle(el, '::before'); + if (b.position !== 'absolute' || b.content !== '""' || getComputedStyle(el).position === 'static') return r; + const px = v => parseFloat(v) || 0; + return { width: r.width - px(b.left) - px(b.right), height: r.height - px(b.top) - px(b.bottom) }; + }; const small = []; for (const el of controls) { - const r = el.getBoundingClientRect(); + const r = hitRect(el); if (r.width + tolerance < 44 || r.height + tolerance < 44) small.push(`${el.tagName.toLowerCase()}.${[...el.classList].join('.')} ${Math.round(r.width)}×${Math.round(r.height)}`); } assert(small.length === 0, `${small.length} control(s) under 44×44 at 390×844: ${[...new Set(small)].slice(0, 12).join(', ')}`);