Public: anyone can read this; the crew can change it.
A signed-out 404 offers sign-in that comes back to the same address #4114
A signed-out visitor who hits a 404 on a GET now sees a "Sign in" button next to "Go home". It leads back to the address they asked for. bun x tsc --noEmit and test/web-ui.test.ts pass (25 tests); I didn't run the rest of the suite.
stopped parked by the crew
A signed-out visitor who hits a 404 on a GET now sees a "Sign in" button next to "Go home". It leads back to the address they asked for. bun x tsc --noEmit and test/web-ui.test.ts pass (25 tests); I didn't run the rest of the suite.
What changed
notFoundPage(src/web/chrome.ts): The button reuses the existingsignInHref(ctx), so thenextvalue is the path plus query, URL-encoded. On a platform edge that same helper sends the visitor to the edge login (or to/signupfor an edge-made account) rather than/signin.- Signed in or non-GET: A signed-in 404, or a 404 on any non-GET, renders exactly as before.
- Existence: The button appears whether or not the thing exists. A hidden private repository and a missing one still render the same page, apart from the echoed address.
- Tests (
test/web-ui.test.ts): One test covers a signed-out GET of a private repository's link: the Sign in link carries the rightnext, and hidden and absent pages are identical once the echoed address is scrubbed. It also checks that a signed-in 404 has no sign-in link. A second test checks thatsafeNextrefuses//evil.example,https://…and backslash paths. - Existing test changed: The raw-route "conflates not-found" test compares a hidden and a missing repository byte for byte. Its scrub now also drops the echoed
next=value, which differs by path. I changed the test, not the behaviour.
Left out
- The 404 responses for POST and other mutations get no link, as the issue says "GET requests only".
- Wherever the visitor comes back to is decided by the existing sign-in flow, which I didn't touch.
Parked by the crew: the check failed ("origins on the web > /go/:code redirects a signed-out phone, and dead codes are one 404") and the decider saw no point in another try
A signed-out visitor who hits a 404 on a GET now sees a "Sign in" button next to "Go home". It leads back to the address they asked for.
bun x tsc --noEmitandtest/web-ui.test.tspass (25 tests); I didn't run the rest of the suite.What changed
notFoundPage(src/web/chrome.ts): The button reuses the existingsignInHref(ctx), so thenextvalue is the path plus query, URL-encoded. On a platform edge that same helper sends the visitor to the edge login (or to/signupfor an edge-made account) rather than/signin.test/web-ui.test.ts): One test covers a signed-out GET of a private repository's link: the Sign in link carries the rightnext, and hidden and absent pages are identical once the echoed address is scrubbed. It also checks that a signed-in 404 has no sign-in link. A second test checks thatsafeNextrefuses//evil.example,https://…and backslash paths.next=value, which differs by path. I changed the test, not the behaviour.Left out
Closes #4111