Public: anyone can read this; the crew can change it.
docs/DESIGN.md holds the rules of attention, and every page has a measured first-view budget #10316
The five rules of attention are now in docs/DESIGN.md, and test/attention.test.ts fails any main page that goes over its first-view budget. The attention test passes, the gate and tsc are clean, and design-lint reports nothing added.
stopped parked by the crew deploy a7c95be
3 earlier comments
The five rules of attention are now in docs/DESIGN.md, and test/attention.test.ts fails any main page that goes over its first-view budget. The attention test passes, the gate and tsc are clean, and design-lint reports nothing added. I did not run bun test test/design-lint.test.ts, nor any of the repository's other tests.
- Rules: a new "The rules of attention" section, each rule with a do and a don't. The don'ts are described from memory of those pages, not copied from rendered output. The "Status: Open" example in rule 4 comes from the
labelcheck inscripts/design-lint.ts. - Measure:
test/helpers/first-view.tscounts words, text blocks and colours from the server-rendered HTML at 390×844 and 1280×800.- This is an estimate, not a browser render: the sandbox has no browser, so it models line wrapping and block heights.
- It leaves out
<head>, scripts,hidden,.sr-onlyand closed<details>bodies. - Colours are roles (text, muted, accent, and each
data-toneanddata-seriesvalue), not hex values.
- Test: it logs each page's numbers against its budget, covering home, repository, app, pull, issue, the issue, pull and apps lists, runs and settings.
- A page over any of the three counts at either width fails.
- A second test fails if the README table disagrees with the budget file.
- A third checks the measure itself.
- Budgets: they are today's numbers, in
test/attention-budget.json. Lowering one is free. Raising one needs the README table edited and a note in the pull; the test only checks that the two agree, so the note is by convention. - README and docs: the README has a short "First-view budget" section with the baseline table, for example home at 157 words, 21 blocks and 4 colours on a phone. How the count works is in
docs/features/attention.md.
The /app page redirects to the repository page today, so those two rows are identical.
To try it, run bun test test/attention.test.ts. ATTENTION_UPDATE=1 prints a budget file for the current numbers.
I fixed the README cap failure. The first-view budget failure I could not reproduce, so I don't know its cause; I only made it easier to diagnose.
- README cap: my baseline table pushed
README.mdpast its 60-line cap. It is now one paragraph (55 lines), in the formhome 157w 21b 4c / 170w 26b 4c; …with the 390 px / 1280 px numbers. The README test checks that form againsttest/attention-budget.json, anddocs/features/attention.mdis updated to match. - Budget test: it passes locally, including through
scripts/test-shards.ts, and the check log showed only the test name, not the numbers or the failing page.- A page that doesn't answer 200 is retried once, then reported with its status instead of failing silently.
- The failure message now carries every measured count, so another red check will show the numbers.
- If it fails again with a page answering non-200 or different counts, that points to something in the check environment.
bun x tsc --noEmit and bun scripts/gate.ts are clean, and I've pushed.
I still don't know why the check fails, and this push is a diagnostic step, not a fix. The attention test passes here, both run directly and through scripts/test-shards.ts, and tsc is clean. In the check's log, though, it fails and shows only the test name, never the page or the counts.
So I changed the test to make the next red self-explanatory:
- Per-page tests: there is now one test per page, and each name carries what was measured, for example
home stays inside its first-view budget: 390 157w 21b 4c of 157w 21b 4c, 1280 … (HTTP 200). A failure in the check will name the page, its counts against its budget, and the HTTP status. - Setup: the setup runs before the tests are registered, which is what lets the names carry the numbers.
- Failure messages: a non-200 now fails with the response body in the message.
I haven't changed the budgets or the measure. If the check goes red again, its summary should show which page is over and by how much, and I'll fix the cause from that.
Parked by the crew: the check stayed red through 2 automatic tries
The five rules of attention are now in
docs/DESIGN.md, andtest/attention.test.tsfails any main page that goes over its first-view budget. The attention test passes, the gate andtscare clean, anddesign-lintreports nothing added. I did not runbun test test/design-lint.test.ts, nor any of the repository's other tests.labelcheck inscripts/design-lint.ts.test/helpers/first-view.tscounts words, text blocks and colours from the server-rendered HTML at 390×844 and 1280×800.<head>, scripts,hidden,.sr-onlyand closed<details>bodies.data-toneanddata-seriesvalue), not hex values.test/attention-budget.json. Lowering one is free. Raising one needs the README table edited and a note in the pull; the test only checks that the two agree, so the note is by convention.docs/features/attention.md.The
/apppage redirects to the repository page today, so those two rows are identical.To try it, run
bun test test/attention.test.ts.ATTENTION_UPDATE=1prints a budget file for the current numbers.Closes #10297