Skip to content

feat(check): report small and low-contrast text and short stops in html films - #27

Merged
umiyosh merged 1 commit into
masterfrom
feat/text-checks
Oct 25, 2026
Merged

umiyosh merged 1 commit into
masterfrom
feat/text-checks

Conversation

@umiyosh

@umiyosh umiyosh commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the two checks #19 still asked for, text size and contrast, to motion-render check, and closes the gap in #23 where a stop shorter than 0.4 s was never reported.

Closes #23. Part of #19 (this completes its automated checks). Part of #16.

Changes

  • scripts/snapshot.js (page side): for every element with text of its own, measures
    • the font size as drawn, including transforms (a heading scaled up by a push-in counts at its drawn size)
    • the WCAG contrast ratio of its color over its background, composited from the page down through its ancestors' backgrounds. Text drawn at opacity under 0.9 is skipped: it is dimmed on purpose or fading in or out. A gradient or image background, or a color space other than sRGB, gives no ratio rather than a guess.
  • scripts/layout.ts: two new findings for still boxes, with the same two-samples-in-a-row rule as the others:
    • A is 20px, smaller than 24px
    • A has contrast 2.1:1, needs 4.5:1 (3:1 for text 40 px and up, following WCAG's lower bar for large text)
  • checkLayout samples every 0.1 s instead of 0.2 s, so a pose held for 0.2 s is reported (check: a stop shorter than 0.4 s is not reported #23). A one-minute film takes about 8 s to check (was about 3 s).
  • references/html-film.md: the new outputs and how to fix them (dark numbers on light badges; 24 px floor for sources and labels; faded text is not measured, so text meant to be read must not be faded).

What it found

  • WIF film (wif-v4): the step-number badges in the numbered flow, white digits on light teal and blue, at 3.7:1 and 1.9:1. This is the same problem hyperframes check found in the Phase 0 spike. No false positives.
  • A new film on catastrophic forgetting in fine-tuning, made end to end with this branch: layout: ok after one fix (a breathing chip sticking out of its dashed slot).

Test plan

  • make check: lint, typecheck, format, knip, quality gate (no new violations)
  • vitest run --coverage: 93 tests pass (layout.ts 100% lines)
  • New tests: small and faint text are reported and large text has the lower bar (unit); in a page, an 18 px source, a faint line, and a chip resting 0.3 s on a card's text are all reported (the last one is missed at 0.2 s sampling)
  • End to end on an account without Motion: narrate → bgm → kit → check → stills → sfx → build
  • CI

@umiyosh
umiyosh merged commit 5019a8f into master Oct 25, 2026
1 check passed
@umiyosh
umiyosh deleted the feat/text-checks branch October 25, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check: a stop shorter than 0.4 s is not reported

1 participant