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

Every page has a skip link and a visible focus ring, checked by one test over all layouts #13017

opened this

Merged 21d 10h ago, live in production

This pull adds test/a11y-landmarks.test.ts and no source change. The skip link, the focus ring and the landmark were already in layout.ts and style/base.ts, so nothing in src/ needed fixing.

Notes

opened this

This pull adds test/a11y-landmarks.test.ts and no source change. The skip link, the focus ring and the <main id="main"> landmark were already in layout.ts and style/base.ts, so nothing in src/ needed fixing.

What the test checks

  • Layouts: it boots the app and fetches seven paths, covering the signed-out shell, sign-in and sign-up, the explorer, search, the not-found page and a missing repository. Each HTML response must have <a class="skip" href="#main"> as its first link and exactly one <main id="main">. A non-HTML response (a redirect target that isn't a page) is skipped silently rather than failed.
  • Stylesheet: :focus-visible draws a 2px accent outline on every control. .skip sits off-screen (top: -48px) until focused, which is absolute-positioned, so it adds no layout shift.

Checks run

  • The new test passes (9 of 9).
  • bun x tsc --noEmit is clean.
  • bun scripts/design-lint.ts is green.
  • bun scripts/gate.ts is clean.

I did not run bun test test/mcp-size.test.ts, since the change doesn't touch the MCP.

Not done

  • Static pages: the offline page, the maintenance page and the app holding page have a <main> (or none) but no skip link. They have nothing to skip past, so I left them alone.
  • Bare layout: it has no topbar and so no skip link by design; the test doesn't cover it.
  • Pictures: the before/after pictures at 390 and 1280 px, light and dark, are not on this pull, because nothing visible changed.

The two non-passing items are the pictures and the unrun MCP-size test (it doesn't apply here).

🤖 Generated with Claude Code

Closes #13007

3 earlier comments
commented

This pull adds test/a11y-landmarks.test.ts and no source change. The skip link, the focus ring and the <main id="main"> landmark were already in layout.ts and style/base.ts, so nothing in src/ needed fixing.

What the test checks

  • Layouts: it boots the app and fetches seven paths, covering the signed-out shell, sign-in and sign-up, the explorer, search, the not-found page and a missing repository. Each HTML response must have <a class="skip" href="#main"> as its first link and exactly one <main id="main">. A non-HTML response (a redirect target that isn't a page) is skipped silently rather than failed.
  • Stylesheet: :focus-visible draws a 2px accent outline on every control. .skip sits off-screen (top: -48px) until focused, which is absolute-positioned, so it adds no layout shift.

Checks run

  • The new test passes (9 of 9).
  • bun x tsc --noEmit is clean.
  • bun scripts/design-lint.ts is green.
  • bun scripts/gate.ts is clean.

I did not run bun test test/mcp-size.test.ts, since the change doesn't touch the MCP.

Not done

  • Static pages: the offline page, the maintenance page and the app holding page have a <main> (or none) but no skip link. They have nothing to skip past, so I left them alone.
  • Bare layout: it has no topbar and so no skip link by design; the test doesn't cover it.
  • Pictures: the before/after pictures at 390 and 1280 px, light and dark, are not on this pull, because nothing visible changed.

The two non-passing items are the pictures and the unrun MCP-size test (it doesn't apply here).

🤖 Generated with Claude Code

commented

I rewrapped the 120-column header comment in test/a11y-landmarks.test.ts to fit 100 columns and pushed the fix as fc4a8fd3a.

bun scripts/gate.ts now passes. The gate reads committed content, so it kept reporting the old line until I committed the change. bun test test/a11y-landmarks.test.ts still passes, 9 of 9. I did not re-run tsc after the rewrap, since only a comment changed; the forge's check on this push will run it.

The pull otherwise stands as described before. It adds one test and no change to src/, because the skip link, the focus ring and <main id="main"> were already there. The before/after pictures are still not on the pull, because nothing visible changed.

🤖 Generated with Claude Code

commented

The test now covers the signed-in layouts too, and it caught a real bug on /asks. I fixed that in the same round. The new test passes 17 of 17, tsc, design-lint and bun scripts/gate.ts are clean, and test/asks-one-list.test.ts plus test/forge-needs-one-stack.test.ts pass (13).

What changed

  • Bug fix on /asks: src/web/studio/asks_page.ts wrapped its body in a second <main> inside the shell's own, so the page had two landmarks. It is now a <div class="stack">.
  • Item 1: each path now asserts that the status is 200 or 404 (the not-found shell) and the content-type is HTML. The silent return is gone.
  • Item 2: the test signs in as the admin and fetches /, /feed, /asks, /notes, /talk, /map, /settings, /system and /family. The signed-out list stays at six paths.
  • Item 3: the test now requires exactly one <main … id="main"> and exactly one id="main" anywhere in the page, so the two checks can't pass on different elements.
  • Item 5: the CSS checks read the served stylesheet (the /assets/forge-<hash>.css URL), collapse whitespace, and match with \s*. A reformat no longer breaks them.
  • Item 6: a header comment in the test says why the static shells and the bare layout are left out.

/board is excluded. The board wall renders as a bare layout with its own header and no topbar, so it has no skip link by design. It is named in the test's comment rather than silently dropped.

Item 4 (pictures): not attached. The only visible change is /asks swapping a tag, and /asks is not in forge.json app.looks, so the forge's before/after pictures can't be taken for it. A commit message carries a No look: line stating that, which satisfies the gate. Please agree on the issue that this is a test-only change plus one tag fix.

Push history: my first push this round (b663379ff) went up with the gate still red because the commit lacked a Try: / Looks: line. I couldn't amend and force-push, so I added an empty commit with the No look: line. The gate is green at da1919752.

🤖 Generated with Claude Code

commented

Left #13007 open: 1 unticked item remain (before/after pictures at 390 and 1280 px, light and dark, are on the pull).

Sign in to join this conversation.

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

Keyboard shortcuts

Docs