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

opened this

Merged 17d 11h ago, live in production

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

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

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.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs