From 9a3404581b113a41048be812b08cd8eca692cf70 Mon Sep 17 00:00:00 2001 From: jay23606 <4602056+jay23606@users.noreply.github.com> Date: Wed, 21 Oct 2026 22:39:36 -0400 Subject: [PATCH 1/2] Enlarge shortlist touch target --- site/public/styles.css | 4 +++- site/shortlist-touch-target.test.mjs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 site/shortlist-touch-target.test.mjs diff --git a/site/public/styles.css b/site/public/styles.css index 7dfd355..f826c31 100644 --- a/site/public/styles.css +++ b/site/public/styles.css @@ -560,8 +560,10 @@ input:focus-visible, /* "Open source" and "Entry and evidence" sit inside the card-wide title link, so a near miss opened the entry page. Padding cancelled by an equal negative margin grows each to about 44px without moving a thing. */ - .entry-links a { + .entry-links a, + .entry-links button { display: inline-block; + min-height: 44px; padding: 13px 6px; margin: -13px -6px; } diff --git a/site/shortlist-touch-target.test.mjs b/site/shortlist-touch-target.test.mjs new file mode 100644 index 0000000..ac1249a --- /dev/null +++ b/site/shortlist-touch-target.test.mjs @@ -0,0 +1,19 @@ +import assert from "node:assert/strict"; +import fs from "node:fs"; + +const css = fs.readFileSync(new URL("./public/styles.css", import.meta.url), "utf8"); +const touchRules = css.match(/@media\s*\(pointer:\s*coarse\)\s*\{([\s\S]*?)\n\}/)?.[1] ?? ""; +const targetRule = touchRules.match(/([^{}]+)\{([^{}]*)\}/g)?.find((rule) => + rule.split("{")[0].includes(".entry-links button") +); +assert.ok(targetRule, "coarse-pointer styles must include .entry-links button"); +const declarations = Object.fromEntries( + [...targetRule.split("{")[1].matchAll(/([\w-]+):\s*([^;]+);/g)].map(([, name, value]) => [name, value.trim()]) +); +assert.equal(Number.parseFloat(declarations["min-height"]), 44, "shortlist hit area must be at least 44px tall"); + +const padding = declarations.padding?.match(/^(-?\d+(?:\.\d+)?)px\s+(-?\d+(?:\.\d+)?)px$/); +const margin = declarations.margin?.match(/^(-?\d+(?:\.\d+)?)px\s+(-?\d+(?:\.\d+)?)px$/); +assert.ok(padding && margin, "touch target padding and margin must use pixel values"); +assert.equal(Number(padding[1]) + Number(margin[1]), 0, "vertical padding and margin must cancel to preserve layout"); +assert.equal(Number(padding[2]) + Number(margin[2]), 0, "horizontal padding and margin must cancel to preserve layout"); From 9b5ba481d0f3b44c8443bae418341c595d54b2bd Mon Sep 17 00:00:00 2001 From: TM Hospitality Strategies Date: Wed, 21 Oct 2026 23:01:24 -0400 Subject: [PATCH 2/2] site: drop the standalone CSS test; the suite runs checks.test.mjs and lib.test.mjs only The file was not referenced by npm test or ci.yml, so it never ran in CI, and the repo keeps behaviour tests in the two existing files rather than regex checks on the stylesheet. The CSS fix stays as is: measured under a 390px touch viewport, the shortlist toggle grows from 19px to 45px tall with no change to the card height. Co-Authored-By: Claude Fable 5.1 --- site/shortlist-touch-target.test.mjs | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 site/shortlist-touch-target.test.mjs diff --git a/site/shortlist-touch-target.test.mjs b/site/shortlist-touch-target.test.mjs deleted file mode 100644 index ac1249a..0000000 --- a/site/shortlist-touch-target.test.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import assert from "node:assert/strict"; -import fs from "node:fs"; - -const css = fs.readFileSync(new URL("./public/styles.css", import.meta.url), "utf8"); -const touchRules = css.match(/@media\s*\(pointer:\s*coarse\)\s*\{([\s\S]*?)\n\}/)?.[1] ?? ""; -const targetRule = touchRules.match(/([^{}]+)\{([^{}]*)\}/g)?.find((rule) => - rule.split("{")[0].includes(".entry-links button") -); -assert.ok(targetRule, "coarse-pointer styles must include .entry-links button"); -const declarations = Object.fromEntries( - [...targetRule.split("{")[1].matchAll(/([\w-]+):\s*([^;]+);/g)].map(([, name, value]) => [name, value.trim()]) -); -assert.equal(Number.parseFloat(declarations["min-height"]), 44, "shortlist hit area must be at least 44px tall"); - -const padding = declarations.padding?.match(/^(-?\d+(?:\.\d+)?)px\s+(-?\d+(?:\.\d+)?)px$/); -const margin = declarations.margin?.match(/^(-?\d+(?:\.\d+)?)px\s+(-?\d+(?:\.\d+)?)px$/); -assert.ok(padding && margin, "touch target padding and margin must use pixel values"); -assert.equal(Number(padding[1]) + Number(margin[1]), 0, "vertical padding and margin must cancel to preserve layout"); -assert.equal(Number(padding[2]) + Number(margin[2]), 0, "horizontal padding and margin must cancel to preserve layout");