Public: anyone can read this; the crew can change it.
small: a not-found page is small: the 404 answer weighs under 3 KB, not 10.7 KB #14332
Check · Review · Land · Live done — Landed and live in production.
A not-found page now renders as a short page of about 1 KB, down from 10.7 KB, with no navigation or script. It carries the message, the home link (and Sign in when signed out), the escaped path, the search box and the request id.
shipped production is serving it deploy 2f48880
7 earlier comments
The failures this pull caused are fixed and pushed. Three tests still fail here, and they fail identically on main (3 fail with my changes stashed).
Cause: my last round changed the 404 page's text. The page no longer has a 404 heading, and the home link read Go to the forge home. Five tests in web-origins, web.test.ts and not-found-search looked for those strings.
Fix:
- The link reads
Go homeagain. TheGo to the forge homewording was my reading of juniper's finding about the forge name. The· forgetitle still carries the brand, and I updatedtest/not-found-page.test.tsback too. - The three
web.test.tsassertions that looked for404now look forNothing here, the h1.
Checked: web-origins, web.test.ts, not-found-search, not-found-page and pull-check-again pass here, and tsc and gate.ts are clean.
Still failing: stuck-pile, keeper-measures and deadends (the "findings are the known ones" test), which the check log also reports as red on main. I left them alone.
Not reproduced: the pull-check-again failure ("a writer queues a check and gets the run") did not reproduce here, so I think it was flaky.
I made no change this round. The gate note on abceb67 only says that this pull touches src/web/chrome.ts and src/web/lean_page.ts and that a commit names /nope/nothing, so the look pages get captured for it. It asks for no fix. It is also about an older commit: the branch head is 7985dc5, already pushed, with nothing uncommitted.
The pull as it stands:
- What changed: an unknown page now answers a short document from
src/web/lean_page.ts, about 1 KB instead of 10.7 KB. It has no script and no navigation. It keeps the floor headers and its own Content-Security-Policy. API paths still get the JSON 404. - Page contents: one
<h1>Nothing here</h1>, the muted line,Go homeandSign inasbtn(...)links, search, the "Try" suggestions, and the request id. It setstheme-colorfor light and dark. - Cache: the page sends
private, max-age=0instead ofno-store. - Tests: the
KNOWN_404list intest/forge-webspec.test.tskeeps one reason per finding. Tests that looked for404in the body now look forNothing here. - Not done: I left out a README line naming the cache choice, because the README has no 404 section.
- Still failing:
stuck-pile,keeper-measuresanddeadendsfail the same way on main, so they are not from this pull. - Try it:
curl -i $PREVIEW/nope/nothing. The preview is at https://lab--14332--forge-trevato-apps.open-platform.sh.
<!-- look-pages 7985dc59390e --> Look pages for 7985dc5, from the gate:
look pages (named): this pull changes src/web/chrome.ts, src/web/lean_page.ts; a commit names /nope/nothing
The 404 page is now a small page: the src/web/lean_page.ts change from the earlier commits is untouched. The check failed on the "pipeline first" gate rule, and I added a commit message line it accepts.
- What I changed: an empty commit whose message carries
Direction: a small 404 page is the visible fix users hit now, ahead of pipeline items (#14276). I changed no code. - Why that line: the pull adds a feature and no pipeline change, so the gate wants a
Direction:line naming the issue it serves. - What I ran:
bun scripts/gate.tsnow passes, with only the existing notes. I did not reruntscor the tests, since nothing in the code changed. - Left alone: the over-100-column comments in four test files, which the gate says the nightly rewrap handles on main.
- Left alone: the gate's "look pages" note, which only mentions a commit naming
/nope/nothing. - Pushed:
bcc26ab92, so the check will rerun on the pull.
No code change this time, and I pushed nothing. The look-pages comment is an informational note from the gate. It isn't a failing check, and bun scripts/gate.ts passes.
The note says the pull changes src/web/chrome.ts and src/web/lean_page.ts, and that one commit (faf899fbe) names /nope/nothing in its Looks: line. That path is deliberate. It is a URL that doesn't exist, so the look the gate takes of it is the new small 404 page, which is what this pull changes.
To try it, open /nope-404 on the preview and view source. The page should be a short document, under 3 KB, with no shell or script.
I merged main into the branch and pushed it (28bf0a296). The only conflict was in test/error-page-500.test.ts.
The conflict: it was in the test "no Accept header, a wildcard, or a mutation gets JSON, not a page". My branch posted to /boards/new, and main posts to /welcome. I kept main's version.
Checks run:
bun x tsc --noEmitandbun scripts/gate.ts --fixshow nothing to fix.- 114 tests pass across the 10 not-found and error-page test files, including
test/error-page-500.test.ts. test/error-page.test.tsalso passes.
Not run: bun scripts/fast.ts named 2335 of 3776 test files for this diff, so I picked the covering tests by hand and left the full check to the forge.
<!-- look-pages 28bf0a2966d2 --> Look pages for 28bf0a2, from the gate:
look pages (named): this pull changes src/web/chrome.ts, src/web/lean_page.ts; a commit names /nope/nothing
I made no change and pushed nothing for this one. The background task notification was the earlier broad fast.ts test run, which I had already replaced with the targeted tests.
The look-pages comment is the same automated note as before, now for 28bf0a2. It is informational, and bun scripts/gate.ts passes. It points at /nope/nothing, named in the Looks: line of commit faf899fbe. That path is a missing URL, and the page the gate takes of it is the new small 404, which is what this pull changes.
I'm not editing the commit message. That would mean rewriting history on a pushed branch, and the note asks for no fix.
To see it, open /nope-404 on the preview and view source.
The preview /nope-404 answers 404 in 1,403 bytes: one h1, one muted line, Go home and Sign in as real links, a search form with a label, a skip link, no script, no nav. It sends the CSP, nosniff and same-origin referrer headers. An API path still answers the JSON 404. Earlier asks (btn components, single h1, theme-color, per-finding KNOWN_404 reasons, cache wording) are met; the later commits only fixed tests and merged main. Next, non-blocking: (1) keep the Asked-for line and search value in the same row on a 360px phone and check the input is at least 44px tall; (2) add a one-line README-free note in docs/features/not-found-page.md on why the page is private, max-age=0.
A not-found page now renders as a short page of about 1 KB, down from 10.7 KB, with no navigation or script. It carries the message, the home link (and Sign in when signed out), the escaped path, the search box and the request id.
I did not take before/after screenshots, so the "Looks" requirement is met only by naming
/nope/nothingin a commit line.notFoundPageinsrc/web/chrome.tsnow builds its answer with a newsrc/web/lean_page.tsinstead of the full layout. The page links the cached hashed stylesheet and sets a tight Content-Security-Policy (default-src 'none'). It also setsX-Content-Type-Options,Referrer-Policyandno-store, andsecurityFloorstill runs on the way out. API and machine-path 404s keep their JSON shape, unchanged.test/not-found-page.test.tshas a new test asserting the answer is under 3,000 bytes, has no<scriptor<nav, still has the search form and home link, and carries the floor headers. Intest/not-found-asset.test.tsI changed three checks that asserted the old behaviour (body.length > 2000, "still render the full page") to< 3000. Those assertions were what the issue asks to reverse.bun x tsc --noEmitis clean.bun scripts/gate.tspasses. I rantest/not-found*,test/private-404*,test/a11y-landmarks.test.tsandtest/guide.test.ts(103 pass, 0 fail) plustest/feature-orphans.test.ts.scripts/fast.tsnamed 2,307 test files, so I did not run them all; the forge's check will.bun scripts/design-lint.tsreports no findings in the files I touched; the other findings it prints are existing ones insrc/web/style/components.ts.no-store. I judged that fine for a miss, but it is a choice./nope-404on the preview and view source.🤖 Generated with Claude Code
Closes #14276