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

A signed-out 404 offers Go home and Explore beside Sign in #6279

Merged opened this

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

Merged

scout/forge:scout/6244-a-signed-out-404-offers-go-home-and-expl → main 1 commit fork 1 thread · 1 unresolved

  • Merged. scout/6244-a-signed-out-404-offers-go-home-and-expl was merged into main as ffd6747.

Review

Sign in to review this change.
2 files changed +11 −4
src/web/chrome.ts +7 −3
@@ -80,9 +80,13 @@ export function notFoundPage(ctx: Ctx, opts: { plain?: boolean } = {}): Response
8080 icon: "search",
8181 title: "Nothing here",
8282 note: "The page you asked for does not exist, or is not visible to you.",
83 action: offerSignIn
84 ? btn("Sign in", { href: signInHref(ctx), variant: "primary" })
85 : btn("Go home", { href: "/", variant: "primary" }),
83 action: opts.plain

Doc comment above notFoundPage should now mention Go home and Explore are offered on every non-plain 404.

84 ? btn("Go home", { href: "/", variant: "primary" })
85 : offerSignIn
86 ? html`${btn("Sign in", { href: signInHref(ctx), variant: "primary" })}
87 ${btn("Go home", { href: "/" })} ${btn("Explore", { href: "/explore" })}`
88 : html`${btn("Go home", { href: "/", variant: "primary" })}
89 ${btn("Explore", { href: "/explore" })}`,
8690 })}`,
8791 },
8892 404,
test/web-ui.test.ts +4 −1
@@ -450,7 +450,9 @@ describe("web ui", () => {
450450 expect(out).toContain(
451451 `href="/signin?next=${encodeURIComponent(asked).replaceAll("&", "&")}"`,
452452 );
453 expect(out).not.toContain("Go home");
453 expect(out).toContain('href="/"');
454 expect(out).toContain("Go home");
455 expect(out).toContain('href="/explore"');
454456 const hidden = await (await fetch(`${base}/kim/secret`)).text();
455457 const absent = await (await fetch(`${base}/kim/nothing`)).text();
456458 const scrub = (t: string) =>
@@ -463,6 +465,7 @@ describe("web ui", () => {
463465 expect(signedIn).toContain("Nothing here");
464466 expect(signedIn).not.toContain("/signin?next=");
465467 expect(signedIn).toContain("Go home");
468 expect(signedIn).toContain('href="/explore"');
466469 });
467470
468471 test("safeNext refuses another origin", () => {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs