Tap-target check expects a pin button per WAN host row (closes #46)
check / check (push) Successful in 3m50s
check / check (push) Successful in 3m50s
The viewport harness's tap-target check required at least 10 visible pin buttons while 26 render, so pin buttons missing from up to 16 rows went unnoticed. It now expects one per WAN host row. The host row count the harness gathers, which the app-rendered check also reads, counts only the WAN host rows, since the local host rows have no pin button. Each control's minimum is now worked out from the gathered facts. TODO.md's harness entry no longer says every check guards itself: the overflow, viewport-edge and clipped-text checks rely on app-rendered. Model: opus-5-5
This commit was merged in pull request #96.
This commit is contained in:
+14
-13
@@ -15,7 +15,8 @@ export const MIN_TAP_TARGET_PX = 44;
|
||||
|
||||
// The controls named in the definition of done, plus the pause button.
|
||||
// Each carries the smallest number of *visible* instances the page has to
|
||||
// contain for the tap-target oracle to be measuring anything at all.
|
||||
// contain, worked out from the facts gathered from that page, for the
|
||||
// tap-target oracle to be measuring every control it should.
|
||||
//
|
||||
// Without those floors the check is inert: `undersized` is empty both when
|
||||
// every control is large enough and when the selectors have gone stale and
|
||||
@@ -24,13 +25,12 @@ export const MIN_TAP_TARGET_PX = 44;
|
||||
// for all three singleton controls vanishing at once — so the floor is per
|
||||
// selector, and one stale selector out of four fails the check.
|
||||
export const INTERACTIVE_CONTROLS = [
|
||||
{ selector: "#pause-btn", minCount: 1 },
|
||||
{ selector: "#interval-select", minCount: 1 },
|
||||
// One per pinnable host row. `app-rendered` already requires at least
|
||||
// 10 host rows, so a count below that means the pin buttons stopped
|
||||
// being rendered per row rather than that there were fewer hosts.
|
||||
{ selector: ".pin-btn", minCount: 10 },
|
||||
{ selector: "#debug-toggle", minCount: 1 },
|
||||
{ selector: "#pause-btn", minCount: () => 1 },
|
||||
{ selector: "#interval-select", minCount: () => 1 },
|
||||
// One per WAN host row, so pin buttons missing from even one row fail
|
||||
// the check rather than only a drop below some fixed number.
|
||||
{ selector: ".pin-btn", minCount: (facts) => facts.wanRowCount },
|
||||
{ selector: "#debug-toggle", minCount: () => 1 },
|
||||
];
|
||||
|
||||
export const INTERACTIVE_SELECTORS = INTERACTIVE_CONTROLS.map(
|
||||
@@ -105,8 +105,8 @@ export function evaluateChecks(facts, viewport, probes) {
|
||||
// never rendered. Everything below is only meaningful if this holds.
|
||||
check(
|
||||
"app-rendered",
|
||||
facts.rowCount >= 10 && facts.numericLatencies >= 5,
|
||||
`${facts.rowCount} host rows, ${facts.numericLatencies} showing a numeric latency`,
|
||||
facts.wanRowCount >= 10 && facts.numericLatencies >= 5,
|
||||
`${facts.wanRowCount} WAN host rows, ${facts.numericLatencies} showing a numeric latency`,
|
||||
);
|
||||
|
||||
const viewportWidth = Math.min(facts.innerWidth, facts.documentClientWidth);
|
||||
@@ -162,7 +162,8 @@ export function evaluateChecks(facts, viewport, probes) {
|
||||
seen.set(target.selector, (seen.get(target.selector) ?? 0) + 1);
|
||||
}
|
||||
const missing = INTERACTIVE_CONTROLS.filter(
|
||||
(control) => (seen.get(control.selector) ?? 0) < control.minCount,
|
||||
(control) =>
|
||||
(seen.get(control.selector) ?? 0) < control.minCount(facts),
|
||||
);
|
||||
|
||||
const undersized = facts.tapTargets.filter(
|
||||
@@ -184,11 +185,11 @@ export function evaluateChecks(facts, viewport, probes) {
|
||||
const detail = [];
|
||||
if (missing.length > 0) {
|
||||
detail.push(
|
||||
"oracle is not measuring the page: " +
|
||||
"oracle is not measuring every control: " +
|
||||
summarise(
|
||||
missing,
|
||||
(c) =>
|
||||
`${c.selector} matched ${seen.get(c.selector) ?? 0} visible element(s), expected at least ${c.minCount}`,
|
||||
`${c.selector} matched ${seen.get(c.selector) ?? 0} visible element(s), expected at least ${c.minCount(facts)}`,
|
||||
4,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user