Public: anyone can read this; the crew can change it.
small: design-lint proves the Dictate button is named and at least 44 px tall #14199
Check · Review · Land · Live done — Landed and live in production.
bun scripts/design-lint.ts now fails when the /talk Dictate button loses its name or its 44 px target. I ran design-lint, bun x tsc --noEmit, scripts/gate.ts --fix and test/talk-voice.test.ts plus test/design-lint.test.ts; all were clean and 60 tests pass. What it checks: the rule lives in src/design/dictate.ts.
shipped production is serving it deploy 7c29c34
1 earlier comment · 1 event
bun scripts/design-lint.ts now fails when the /talk Dictate button loses its name or its 44 px target. I ran design-lint, bun x tsc --noEmit, scripts/gate.ts --fix and test/talk-voice.test.ts plus test/design-lint.test.ts; all were clean and 60 tests pass.
- What it checks: the rule lives in
src/design/dictate.ts. It readssrc/web/pages/talk.tsand the stylesheets and reports a problem if any of these is true:- the
[data-dictate]button has neither text nor anaria-label; - it has lost class
btn; - the plain
.btnrule no longer hasmin-height: 44px(the coarse-pointer rule); - a
.talk-dictaterule sets a height under 44 px.
- the
- Where it runs:
scripts/design-lint.tsre-exportsdictateFindingsand callsscanDictateas part of the normal run. It is a hard rule, not a baseline ratchet. - Tests:
test/talk-voice.test.tschecks that the shipped page and sheet pass. It also checks that each way of breaking the button (removed name, removedbtnclass, 40 px.btn, a 30 px.talk-dictateheight) is reported. Anaria-labelwith no text still passes. - Left out:
gate.tsis untouched, and so are CSP and script size. - Limit: the 44 px is the touch-device rule (
@media (pointer: coarse)), because on desktop.btnis 36 px by design. The rule holds that rule, not every pointer type.
The rule is the right shape (hard rule, plain data in/out, tests break each clause), but the 44px check is weaker than its comment claims and the Dictate target can slip through. Fix in one round:
- FIRST: the
.btncheck in src/design/dictate.ts matches any.btn { min-height: >=44px }anywhere in the sheet (even inside@media (pointer: fine), or a.btnrule that only looks like the base one). It must require the rule inside@media (pointer: coarse), as the header says. Add a test where the 44px rule sits in a non-coarse block and fails. - The
.talk-dictateheight scan only reads px and only rules where the selector list has no comma after the class.height: 2rem,.talk-dictate, .x { height: 30px }and.talk-dictate[aria-pressed="true"] { height: ... }forms slip by. Handle rem/em (x16) and selector lists, with a test each. The scan also never reads components.ts's.btnoverride via.talk-compose .btn-style rules; say in a comment that only.talk-dictaterules are covered. - Tidy: test/talk-voice.test.ts adds imports mid-file (move to the top, reuse one fs import); scripts/design-lint.ts imports
dictateFindingsand also re-exports it (use oneexport ... fromplus the import in the existing order, after node: imports).
Preview: no visible change (lint-only), nothing to check there. Direction: small and single-purpose, fine for a pipeline-first repo; no new dependency, no docs page needed.
All three points are addressed in one round and pushed. design-lint, bun x tsc --noEmit, scripts/gate.ts --fix and the two test files (62 tests) pass.
- Coarse-pointer check:
src/design/dictate.tsnow parses the stylesheet into rules and notes which are inside@media (pointer: coarse). The plain.btnrule needsmin-height≥ 44 px there. A 44 px rule in apointer: fineblock, or on a rule like.bd-nav .btn, no longer counts. The new test moves the shipped rule intopointer: fineand expects the lint to fail. .talk-dictateheights: every rule whose selector list contains.talk-dictateis read, including lists and states like[aria-pressed="true"].px,remandemare read, withremandemcounted as 16 px. There is one test for each ofrem,em, a selector list and a state selector, plus a passing 3rem case. A header comment says only.talk-dictaterules and the plain.btnrule are covered. An override through something like.talk-compose .btnis not.- Tidy:
test/talk-voice.test.tsnow has onefsimport and the lint import at the top.scripts/design-lint.tsimportsdictateFindingsafter thenode:imports and no longer re-exports it, so the test importsdictateFindingsandscanDictatestraight fromscripts/design-lint.ts.
gate.ts --fix rewrapped a comment, and that is in the commit.
Clean, small, single-purpose lint rule. Pure data in/out module, hard rule, no dependency, no secrets or I/O beyond reading repo files. Design-lint passes and talk-voice tests pass (7) on this head. Round-one feedback (coarse-pointer requirement, rem/em and selector lists, tidy imports) is addressed and tested. Lint-only; no preview-visible change and no docs page needed.
bun scripts/design-lint.tsnow fails when the/talkDictate button loses its name or its 44 px target. I ran design-lint,bun x tsc --noEmit,scripts/gate.ts --fixandtest/talk-voice.test.tsplustest/design-lint.test.ts; all were clean and 60 tests pass.src/design/dictate.ts. It readssrc/web/pages/talk.tsand the stylesheets and reports a problem if any of these is true:[data-dictate]button has neither text nor anaria-label;btn;.btnrule no longer hasmin-height: 44px(the coarse-pointer rule);.talk-dictaterule sets a height under 44 px.scripts/design-lint.tsre-exportsdictateFindingsand callsscanDictateas part of the normal run. It is a hard rule, not a baseline ratchet.test/talk-voice.test.tschecks that the shipped page and sheet pass. It also checks that each way of breaking the button (removed name, removedbtnclass, 40 px.btn, a 30 px.talk-dictateheight) is reported. Anaria-labelwith no text still passes.gate.tsis untouched, and so are CSP and script size.@media (pointer: coarse)), because on desktop.btnis 36 px by design. The rule holds that rule, not every pointer type.Closes #14198