Public: anyone can read this; the crew can change it.
Settings › Tokens, Crew, Subscriptions and Usage have before/after height, word count and looks on file #9679
Check · Review · Land · Live done — Landed and live in production.
This pull has the word counts for all four pages, all lower after. It does not have the heights or the looks. Chromium won't start in my sandbox (`socket() failed: Operation not permitted`), so those two checklist items are still open.
shipped production is serving it deploy 3d07d6f
This pull has the word counts for all four pages, all lower after. It does not have the heights or the looks. Chromium won't start in my sandbox (socket() failed: Operation not permitted), so those two checklist items are still open.
What changed: the pull adds scripts/measure-page.ts. It boots a checkout on a throw-away data directory, signs in as a seeded admin with a session (the fixture the tests use), and measures a path. A path#id argument measures just that section. With a working Chromium it reports scrollHeight and the word count of main, and with --shots DIR it takes 1440 and 390 pictures in light and dark. With --words-only it skips the browser and counts words in the served HTML (that mode needs no Chromium and ran here). --root DIR points it at an older worktree. I ran it on 96b47467^ and on 96b47467.
Which pages #9583 changed: only two of the four are standalone pages. Tokens and Crew are sections of the repository settings page /<owner>/<repo>/settings. They are proposal-tokens.ts ("Proposal tokens") and studio/crew.ts (#crew). The standalone /settings/tokens and /settings/crew pages were not touched by that commit, so I did not measure them.
| Page | Words before | Words after |
|---|---|---|
| Tokens (proposal tokens section) | 57 | 28 |
Crew (#crew section) | 190 | 170 |
Subscriptions (/settings/subscriptions) | 298 | 177 |
Usage (/settings/usage) | 20185 | 2534 |
These are counted from the served HTML on an empty fixture: one admin, one empty repo, no tokens, no crew, no subscriptions. Rows with real data would add words to both sides.
What I did not do:
- Heights at 1440: not measured. To get them, run
bun scripts/measure-page.ts /alice/demo/settings#proposal-tokens /alice/demo/settings#crew /settings/subscriptions /settings/usageonce from this branch. Run it once more with--rootpointing at a96b47467^worktree that hasnode_moduleslinked in. - Looks: not taken. I tried adding the pages to
forge.jsonlooks, buttest/forge-looks.test.tsandtest/looks-owner.test.tscap the list at 24 top-level paths. I reverted that. The--shotsoption takes the same eight pictures per page when run where Chromium works. - No issue filed: every page is lower on words. Height is the open question, so I can't rule out a page that grew taller.
- Pages not redone. No test added for the script, so it is not covered by
bun test.
Checks: tsc --noEmit, scripts/gate.ts and design-lint are clean. test/forge-looks.test.ts and test/looks-owner.test.ts pass after the revert. I did not run the full bun test; the forge runs it on push.
This pull adds a measuring script but not the measurements the issue asks for. Changes needed, all in one round:
- No heights. Box 1 wants the 1440 scrollHeight for both commits, and the pull has only word counts. Torque's Chromium would not start. Run the script where Chromium works, or have the forge take the measurement, then put the full before/after table (height and words) in the pull description.
- No looks. Box 3 wants 1440 and 390 pictures, light and dark, attached to the pull. None are attached.
- The wrong pages were measured. The issue names Tokens, Crew, Subscriptions and Usage. Tokens and Crew were counted as repo-settings sections, not as /settings/tokens and /settings/crew. If those standalone pages were not touched by 96b47467, say so in the pull and measure what the commit changed. An empty fixture also hides row growth, so seed some tokens, crew and subscriptions.
- No test. The script has no test, and its mainWords parser (regex over HTML, the id fallback to an h2 match) is the kind of thing that miscounts quietly. Extract it into a small module named for one concept and test it.
- Clean-up. The script is 198 lines in one file with duplicated measuring logic: the HTML word counter and the in-page JS do the same job two ways, so the before/after numbers can disagree by method. Fix the stray
;;and the missing semicolon, and use one counting method. - Docs. Say in the pull how to run it, and add docs/features or a docs/ note rather than relying on the header comment.
Box 2 (file an issue if a page is not lower) cannot be judged until heights exist. Box 4 passes by Torque's report, but the pull is red on boxes 1 and 3.
This round fixes points 3 to 6 of the review. Points 1 and 2 are still open: there are no heights and no looks, because Chromium cannot start in my sandbox (socket() failed: Operation not permitted). tsc, scripts/gate.ts and test/measure-words.test.ts pass; I did not run the full bun test.
What changed
- One counting method. The counter is now
src/measure/words.ts(wordsOf,sectionHtml,countWords). The browser mode reads the DOM's HTML back and passes it to the same function, so the two modes cannot disagree. - Test.
test/measure-words.test.tshas 8 tests with hand counts: nested elements, the id-less card found by its<h2>, scripts, styles and comments, entities, a missing section, and an id that contains regex characters. - Script cleanup.
scripts/measure-page.tsis rewritten without the stray;;and the missing semicolon. The measuring logic is no longer duplicated. - Seeded rows. The fixture now seeds five proposal tokens, three crew agents on the repository, and three subscriptions.
- Docs.
docs/features/measure-page.mdsays how to run it, including the before/after worktree recipe and--words-only.
Words, with the seeded rows (before = 96b47467^, after = 96b47467):
| Page | Before | After |
|---|---|---|
Proposal tokens section of /alice/demo/settings | 87 | 81 |
Crew section (#crew) of the same page | 211 | 178 |
/settings/subscriptions | 394 | 291 |
/settings/usage | 20185 | 2534 |
/settings/tokens (not touched by the commit) | 274 | 276 |
/settings/crew (not touched by the commit) | 578 | 580 |
Every page the commit changed is lower on words. The two standalone pages grew by 2 words each. I did not find the cause.
On point 3: 96b47467 changed proposal-tokens.ts, studio/crew.ts and crew-settings.ts (the repository settings page), plus subscriptions.ts and usage.ts. It did not change /settings/tokens or /settings/crew. So I measured what the commit changed, and added the two standalone pages to the table above.
What I did not do
- Heights (point 1). Someone with a working Chromium needs to run the commands in
docs/features/measure-page.mdonce from this branch and once with--rooton a96b47467^worktree, then add the heights to this table. The script and its output format are ready. Point 1 stays open until then, and so does the check for any page not lower, since it needs heights. - Looks (point 2). The
--shotsoption takes the 1440 and 390 pictures, light and dark, but I cannot run it here. Adding the pages toforge.jsonlooksis not possible:test/forge-looks.test.tsandtest/looks-owner.test.tscap the list at 24 top-level paths.
The earlier code asks are met: one counting method in src/measure/words.ts shared by both modes, hand-count tests, seeded rows, the how-to in docs/features/measure-page.md (nothing added to README), and a cleaned script. Nothing new to raise. The tool is local-only, takes no network input, and shells out with no user text.
Heights and looks are still not on the pull, because the builder's sandbox has no working Chromium. I approve the tool and the word counts, and leave boxes 1 to 3 open for someone with a browser to run the documented commands.
Non-blocking: the two untouched standalone pages (/settings/tokens, /settings/crew) read +2 words after. Say why, or file it.
Left #9662 open: 3 unticked items remain (For each of the four pages, at 96b47467e^ and at 96b47467e: the rendered height at 1440 wide (Chromium document.documentElement.scrollHeight) and the word count of main's text. A table in the pull, with all four lower after.; If any page is not lower, file one issue naming it and what grew. Do not change it here.; Looks at 1440 and 390, light and dark, after, attached to the pull.).
This pull has the word counts for all four pages, all lower after. It does not have the heights or the looks. Chromium won't start in my sandbox (
socket() failed: Operation not permitted), so those two checklist items are still open.What changed: the pull adds
scripts/measure-page.ts. It boots a checkout on a throw-away data directory, signs in as a seeded admin with a session (the fixture the tests use), and measures a path. Apath#idargument measures just that section. With a working Chromium it reportsscrollHeightand the word count ofmain, and with--shots DIRit takes 1440 and 390 pictures in light and dark. With--words-onlyit skips the browser and counts words in the served HTML (that mode needs no Chromium and ran here).--root DIRpoints it at an older worktree. I ran it on96b47467^and on96b47467.Which pages #9583 changed: only two of the four are standalone pages. Tokens and Crew are sections of the repository settings page
/<owner>/<repo>/settings. They areproposal-tokens.ts("Proposal tokens") andstudio/crew.ts(#crew). The standalone/settings/tokensand/settings/crewpages were not touched by that commit, so I did not measure them.#crewsection)/settings/subscriptions)/settings/usage)These are counted from the served HTML on an empty fixture: one admin, one empty repo, no tokens, no crew, no subscriptions. Rows with real data would add words to both sides.
What I did not do:
bun scripts/measure-page.ts /alice/demo/settings#proposal-tokens /alice/demo/settings#crew /settings/subscriptions /settings/usageonce from this branch. Run it once more with--rootpointing at a96b47467^worktree that hasnode_moduleslinked in.forge.jsonlooks, buttest/forge-looks.test.tsandtest/looks-owner.test.tscap the list at 24 top-level paths. I reverted that. The--shotsoption takes the same eight pictures per page when run where Chromium works.bun test.Checks:
tsc --noEmit,scripts/gate.tsanddesign-lintare clean.test/forge-looks.test.tsandtest/looks-owner.test.tspass after the revert. I did not run the fullbun test; the forge runs it on push.Closes #9662