Measuring a page: height and words

scripts/measure-page.ts answers "did this page get shorter?" with two numbers per page, the same way before and after a change.

# the page now, at 1440 wide, with pictures at 1440 and 390, light and dark
bun scripts/measure-page.ts --shots out/ /settings/subscriptions /settings/usage \
  /alice/demo/settings#proposal-tokens /alice/demo/settings#crew

# the same pages at an older commit
git worktree add ../before <commit>^ && ln -s "$PWD/node_modules" ../before/node_modules
bun scripts/measure-page.ts --root ../before /settings/subscriptions …

# no Chromium on this machine: words only, from the served HTML
bun scripts/measure-page.ts --words-only /settings/usage

On file: Settings pages around 96b47467e (#9617)

Words, from --words-only on 96b47467e^ and 96b47467e (seeded rows as above). Height needs Chromium, which could not start in the sandbox this was recorded in (socket() failed: Operation not permitted); run the command above with --root at each commit to fill the column.

Pagewords beforewords afterheight before → after
Subscriptions /settings/subscriptions394289not measured
Usage /settings/usage201852508 (see below)not measured
Tokens /alice/demo/settings#proposal-tokens8781not measured
Crew /alice/demo/settings#crew211178not measured

Why Usage reads 20185 before. It is real table text, not script or JSON: the page prints one row per route pattern, and before the rewrite each row's "By role" and "By surface" cells wrote every key with its count (user 0 · agent 0 · …), used or not. After, part() in src/web/pages/usage.ts lists only keys with a count above zero, and the intro sentence and card header are shorter. Both runs seed no usage rows and the commit touches only the four pages' files, so the route list is the same at both commits; the drop is the zero-filled cells, which is what the rewrite set out to remove.

Heights are a blocker, not a result. The author's sandbox cannot start Chromium, and the preview deployments run pull branches, not 96b47467e^, so no height was obtained and none is claimed. Whether any page grew in height is therefore unanswered; words alone fell on all four pages. Someone with Chromium runs the command above once per commit.

96b47467e is the commit the issue names; its subject carries #9617, the issue text says #9583. The hash is the pair measured.

On file: the four /settings/* paths (#9780)

bun scripts/measure-page.ts --words-only --root <checkout> /settings/tokens /settings/crew /settings/subscriptions /settings/usage, once with --root at a checkout of 96b47467e^ (96b47467e's parent) and once at 96b47467e; all eight pages rendered with status 200.

Pagewords before (96b47467e^)words after (96b47467e)
/settings/tokens274274
/settings/crew578578
/settings/subscriptions394289
/settings/usage201852508

No page has more words after. Tokens and Crew read the same at both commits at these paths: the rewrite's Tokens and Crew sections are the ones on the repository settings page (/alice/demo/settings#proposal-tokens, #crew, table above), which these account-level paths do not render. Usage's drop is the zero-filled "By role"/"By surface" cells, as explained above. Heights are still not taken (no Chromium in the sandbox).

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs