From 8f9d373d7b979b72226e59f42d605b1b8dfdd39f Mon Sep 17 00:00:00 2001 From: MelekTaus Date: Fri, 2 Oct 2026 23:15:22 +0200 Subject: [PATCH] Scroll the + menu to Vector art before picking it in e2e 47 The suite to 7dd3ae1 (#154) was red in e2e 47 and stopped there. With the Joint the + menu has 25 entries and scrolls on a canvas 800 high. Vector art is its last entry and stood below the box, so the check found no row to click and the module threw. - The module scrolls the menu to the entry first, the way e2e 04 does since #154, and picks it inside the menu's box as before. - Nothing in src/ changes. e2e 47 was not part of the modules run for #154, and the suite to that commit was not waited for. The modules after 47 had not run in CI since then. Tests: - Full suite on melektaus-atx: 1692 checks, all pass, the check in e2e 47 among them. One of the 1692 belongs to the kept panel sizes, which were in the working tree and are not committed yet. Co-Authored-By: Claude Opus 5.5 --- tools/e2e/47-vectorart.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/e2e/47-vectorart.mjs b/tools/e2e/47-vectorart.mjs index dca12528..28919aee 100644 --- a/tools/e2e/47-vectorart.mjs +++ b/tools/e2e/47-vectorart.mjs @@ -1,6 +1,6 @@ import { colourDistance } from '../lib/harness.mjs'; import { FIND_HALVES, HALVES_LEFT, HALVES_RIGHT, PASTE_HALVES } from './lib/pictures.mjs'; -import { LANES, MAKE_OBJECT } from './lib/scaffold.mjs'; +import { inView, LANES, MAKE_OBJECT } from './lib/scaffold.mjs'; /** * Vector art (#129), stages 2 and 3: the drawing is rasterised and travels the picture path of #185. What @@ -574,9 +574,21 @@ export async function vectorArt(t) { ) ?? null ); }; + // The same as a hook expression, for a row the menu has to be scrolled to: the lowest hit between + // the box's sides, which is the entry and not the tab above it. + const menuRow = (text) => `(() => { + const box = __gm.overlayRect(); + const hits = (__gm.locateAll(${JSON.stringify(text)}) ?? []).filter( + (hit) => hit.x >= box.x && hit.x <= box.x + box.w && hit.y >= box.y, + ); + return hits.sort((a, b) => a.y - b.y).at(-1) ?? null; + })()`; + // Vector art is the last of the 25 entries the menu has since the Joint (#154); on a canvas 800 + // high the menu scrolls, and that one is scrolled to. await clickText('+'); const plusRows = (await json('__gm.menuRows()')) ?? []; + await inView(t, '__gm.overlayRect()', menuRow('Vector art')); const entry = await inOverlay('Vector art'); check( 'the + menu offers Vector art among the types that only live in the library',