From 30090fc48eeadf67fda4730546f19804e77dba01 Mon Sep 17 00:00:00 2001 From: MelekTaus Date: Tue, 15 Sep 2026 11:36:04 +0200 Subject: [PATCH] A cap measured against the canvas needs a yardstick from the canvas, so the check stops carrying a number The height cap used to be a constant 420, and the check wrote that number down. Since #43 the cap is the canvas minus a tenth at either end, which is 640 on an 800px screen - so CI failed on a picker that is behaving exactly as intended. The check now reads the budget off the screen and reports rect, budget and screen height when it trips, so the next change to the margin cannot strand it again. --- tools/e2e/11-menus.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/e2e/11-menus.mjs b/tools/e2e/11-menus.mjs index 3f33c2a4..06dc2448 100644 --- a/tools/e2e/11-menus.mjs +++ b/tools/e2e/11-menus.mjs @@ -25,15 +25,18 @@ export async function menus(t) { await sleep(150); // 11a. A picker with 40+ entries is capped in height and stays fully on screen instead of - // running off the bottom edge. + // running off the bottom edge. The cap is a share of the canvas, not a constant: a tenth is + // left free at either end, so the number to beat is read off the screen rather than written + // down here – 40 rows would be well over a thousand pixels without it. const parentRow = await json("__gm.inspectorField('Parent')"); await click(parentRow.x, parentRow.y); const rect = await json('__gm.overlayRect()'); const screenHeight = await json('window.innerHeight'); + const budget = screenHeight - Math.round(screenHeight * 0.1) * 2; check( - 'a long parent picker is capped instead of growing with the object count', - rect && rect.h < 420, - JSON.stringify(rect), + 'a long parent picker is capped to the canvas budget instead of growing with the object count', + rect && rect.h <= budget, + JSON.stringify({ rect, budget, screenHeight }), ); check( 'the capped picker stays fully on screen',