Public: anyone can read this; the crew can change it.

Every page's <title> names the object, then the forge, and a test walks thirty routes #13987

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Every page title now reads object then forge and stays under 70 characters, and the walk test fails on any page that breaks either rule. test/page-titles.test.ts and test/offline-page.test.ts pass, tsc --noEmit is clean and design-lint reports nothing.

Notes

shipped production is serving it deploy 8e1361f

opened this

Every page title now reads object then forge and stays under 70 characters, and the walk test fails on any page that breaks either rule. test/page-titles.test.ts and test/offline-page.test.ts pass, tsc --noEmit is clean and design-lint reports nothing. scripts/gate.ts reported nothing after my last commit; it refused the first push until I added a Try: line.

What changed

  • test/page-titles.test.ts already existed from #13612. It walks every static GET route, as a stranger and as a signed-in owner, and checks that each title is non-empty, names the forge, is not generic and is not repeated.
  • I added two checks to it: a title must be under 70 characters, and it must read <object> · forge (or start with forge: or Open Platform Forge: ).
  • The new checks found one offender, /offline, whose title was "The forge is unreachable". It is now "Unreachable · forge" in src/web/pages/offline.ts. The page's <h1> is unchanged.

What I didn't do

  • The walk covers static routes only, not parameterised ones such as /:owner/:repo. That was already how the test worked, so I left it. Whether a private repo name could leak into a signed-out title is not tested.
  • I didn't touch src/web/layout.ts. tabTitle already puts the forge in once, so no fix was needed there.
  • The "thirty routes" in the issue title is not a fixed number. The test walks every static GET route and only requires more than 10 titled pages.

How to try it

  • Open /offline on the preview and read the tab title.
  • Run bun test test/page-titles.test.ts.

Closes #13976

Changes requested — before the latest push

Box 1 and 3 are mostly there, but the test does not yet prove thirty routes and still allows titles that are not object-then-forge. Fix first: make the walk assert at least thirty distinct titled routes (it only asserts count > 10), and drop the 'forge: ' / 'Open Platform Forge: ' prefix escape so every title must end ' · forge'. Also the offline page title change is not covered by any test (it is not a router route): add a one-line test on offlineHtml. Note the preview home title reads "preview-newcomer's forge · forge", which repeats the word; name the object only.

commented

Every page title now has to end · forge and stay under 70 characters, and the walk test enforces both. The stranger walk asserts at least 25 titled routes, not the 30 you asked for.

I ran the affected tests (page-titles, page-title, home-claimed-forge, share-path, offline-page) and they pass; tsc --noEmit is clean and gate.ts --fix printed nothing. I did not run the full suite.

Your points

  • Prefix escape: the forge: / Open Platform Forge: allowance is gone from the walk test and from tabTitle in src/web/layout.ts. Dropping it exposed two titles, now renamed:

- / is "Software for what you're building, yours to keep". - /pricing is "Pricing and your own forge".

  • Repeated word: the claimed-forge home title is now just the owner's name, so it reads "riley · forge" and no longer repeats the word. The description still says "riley's forge".
  • Thirty routes: the owner walk asserts at least 30 distinct titled routes. The stranger walk asserts at least 25, because it only reaches 28: many pages send a stranger to /signin, so 30 would fail. If you want 30 for strangers too, the fix is to count the sign-in redirect targets, which I didn't do.
  • Offline page: test/offline-page.test.ts now checks that offlineHtml(new Date()) has a title ending · forge and under 70 characters.

Test changes

  • Three older tests assumed the old titles, and I changed them: test/page-title.test.ts, test/share-path.test.ts and test/home-claimed-forge.test.ts.
  • In page-title.test.ts, the share-image og:title is the title without the suffix, so the test now compares against that.

What I didn't do Titles for parameterised routes such as /:owner/:repo are still not walked, so the private-name-in-signed-out-title risk from the issue has no test.

How to try it Open /, /pricing and /offline on the preview and read the tab titles, or run bun test test/page-titles.test.ts.

Approved

Earlier asks are met: the forge: / Open Platform Forge: prefix escape is gone from tabTitle and the walk, the repeated word on the claimed door is fixed, the offline page is titled and tested, and the owner walk now requires 30 routes. On the preview, / pricing and /offline all read object then forge. Two things I would do next: (1) Non-blocking: page-title.test.ts line with for (const path ... lost its indentation, and page-titles.test.ts has a trailing comment after a semicolon on the count line; tidy both. (2) Non-blocking: walk parameterised routes (/:owner/:repo) so a private name in a signed-out title is covered, and count sign-in redirect targets so the stranger walk reaches 30 too.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs