Skip to content

Run the weekly destination check, and gate the header's layout shift and contrast - #230

Merged
tony merged 3 commits into
mainfrom
feat/p025-header-links
Nov 1, 2026
Merged

tony merged 3 commits into
mainfrom
feat/p025-header-links

Conversation

@tony

@tony tony commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The port header's repository, package and API links and its searchable Packages menu already shipped in #181. I audited them against the P025 brief before writing anything, and this PR covers what the audit found missing: the weekly check that proves those links resolve has been red since its first run, and nothing gated the header's layout shift or its dark-scheme contrast, both of which the brief names as acceptance.

What the audit found

On the live Rust page, and for all 16 ports, the header matches main: the repository, package host and API reference are ordinary links, and a native <details> Packages disclosure lists every other package, module, product and companion with a registry mark, a label and one line of detail. It filters as the reader types, moves between rows with the arrow keys, closes on Escape with focus returned, and is a plain list without JavaScript. It reuses data-doc-picker rather than adding a menu (HeaderPicker.astro, portHeaderLinks), and the current row has no accent bar.

  • Links resolve. Of the 141 distinct URLs on the 16 live landing pages, 133 answer 200 to a plain request. Four crates.io pages answer 404 to a request without Accept: text/html and 200 with it, and the crates.io API names the crate and its repository. Four npm pages answer 403 to a bot, and registry.npmjs.org lists each package with its dist-tags. The committed evidence records 141 passing destinations and 8 deliberately unlinked ones (conan, vcpkg, two Hex and two LuaRocks companions, and two javadoc.io pages that land on a version list), and verify-destinations.negative.mjs plants a 404, a 200 about another package and a renamed repository and requires each to fail.
  • Tests exist and pass. Nine header suites (304 tests) cover the data, the rendered markup in both shells and the happy-dom behavior of the menu script: filtering, empty state, arrow keys, Escape, focus return and one open picker at a time.
  • Rendered in a fresh browser profile on the Rust landing page at 320, 375, 768, 1024 and 1440 pixels, light and dark, with and without JavaScript: no horizontal scroll at any of them, the bar 96 pixels at 320 and 375 (the language picker takes its own row) and 52 pixels from 768, the open panel inside the viewport, and a layout-shift total of 0 attributed to the page. Panel names measured 14.4:1 in light and 15.0:1 in dark, and detail lines 6.2:1 and 9.7:1.

What changes

  • The weekly destination check runs. The first scheduled run, 40326763466, failed in both API steps with ERR_MODULE_NOT_FOUND for web-tree-sitter, because the job never installed the workspace that verify-api-destinations.mjs imports. The header steps passed, and the red run hid that. verify-destinations.yml now sets up pnpm, then Node with its cache, then runs pnpm install --frozen-lockfile, as test.yml does. verify-destinations-workflow.test.ts holds the order one promise per clause and plants five breaks: no install, an install before Node, an install after the verifier, no pnpm, and pnpm after Node. Against the previous workflow file it fails on the new promises.
  • The header gate measures layout shift and contrast in both schemes. checkHeaderLinksRender runs from --global-header and the full matrix. In light and dark, at 320 and 1440 pixels, with and without JavaScript, it requires the page to be in the scheme asked for, every text it samples to be drawn (a selector that finds nothing visible fails), at full opacity, with 4.5:1 contrast over the surfaces beneath it. With JavaScript it flushes the browser's pending layout shifts a few frames after the page enhances itself and requires none attributed to the header. checkHeaderLinksRenderFail runs the unbroken page first, then a bar that moves two frames after enhancement, a light grey detail line on the light panel, a dark grey one on the dark panel (each passing in the other scheme), a faint chip label, a half-opaque detail line and a heading nothing draws, and requires each to fail by the problem it names. The passes take 3 to 5 seconds and the controls 4 to 5.
  • Two stale comments now say 80rem, where the component said 70rem against the rule that hides the labels below 80rem, and say a kind's heading, where the picker stylesheet said a product's. CONTRIBUTING.md and docs/ci.md describe both.

Screenshots

Taken with Playwright's Chromium in a fresh context per shot, saved under /home/d/tmp-wave/p025/shots/ and not uploaded. They were taken on the header of d2d48767f; #226 since changed only DocsLayout.astro among the header's files. For each of 320, 375, 768, 1024 and 1440 pixels, in light and dark, with and without JavaScript, there is a closed bar, an open Packages panel, and with JavaScript the panel filtered by mcp.

  • At 1440 the bar shows GitHub, crates.io, docs.rs, Packages with its label, then Search and the colour control. The panel hangs from its trigger's right edge with a focused search box and three groups: source, packages and API reference.
  • At 1024 and 768 each chip shows its mark alone. The panel is 380 pixels wide and stays inside the viewport.
  • At 375 and 320 the chips and the Packages trigger sit in the Menu panel. With JavaScript the panel opens as a popover with 8 pixels of margin on each side. Without it the panel opens in the flow of the Menu and the chips stack one to a row.
  • Filtering by mcp leaves tmux-mcp once under each of Source, Packages and API reference, and the footer line names the port and its repository.

Open questions the spec leaves unanswered

  • Product pages. The header's direct links are the library's on every page of a port, including the MCP and Workspace pages, and each product's own package is a row in the Packages menu. header-links.test.ts pins this on purpose. The brief can be read as asking for a product page to lead with its own package. That would change what portHeaderLinks takes and what the page passes it.
  • "Registry badge". A row's badge is its host's mark (the crates.io, npm or PyPI glyph), not text.
  • Julia and C++ show a GitHub link only, because the inventory records no package host or API reference for them.
  • Versions. Every external link is unversioned. The brief asks for exact versions where a host supports them, and nothing here adds them.
  • javadoc.io moves its bytes between requests, so its identity check rests on Maven Central and the page title, as the research recorded.

Checks and review

On the head, in a clean worktree: the nine header suites (304 tests), oxlint on the changed scripts and test, and node site/scripts/check-dev.mjs --global-header, which runs the existing header gates and the two new ones. I dispatched the weekly workflow from this branch (run 41300689362). The install now succeeds, the header destination verification passes against every live host, and the committed evidence is within its age bound. The standard-library and SDK step now gets past its import and checks 811 destinations, then fails by its own rule: 52 are unverifiable because en.cppreference.com answers every runner request with 403, and the rule allows 40. That bound is a separate decision (exempt that host, raise the bound, or check cppreference some other way), so this PR leaves it, and the weekly run stays red until it is settled.

An independent reviewer read the first head and approved with nits, with four should-fix findings: the dark controls could not tell the schemes apart, most samples could be silently empty, a fixed 400 ms wait stood in for delivery of layout shifts, and the docblock claimed to measure bar growth. All four are fixed, with the scheme proved from the page surface, every selector required, a flush of pending records and the claim narrowed. The same reviewer re-checked the new head and approved with nits, which are fixed except two it left open: the rest-state colour of the trigger label is not sampled, and a shift caused by opening the panel is not read.

tony added 3 commits November 1, 2026 04:55
why: The first scheduled run, 40326763466 on 2026-10-26, failed in both
API steps with ERR_MODULE_NOT_FOUND for web-tree-sitter, imported from
packages/api-model/src/parser.ts. The job checked out the repository and
set up Node but never installed the workspace, so the API verifier
stopped at its first import. The header destination steps before it
passed, and the red run hid that.

what:
- Set up pnpm, cache it with setup-node and run pnpm install
  --frozen-lockfile before the verifiers, as test.yml does
- Hold the order in the workflow test, one promise per clause: pnpm
  before Node, which caches it; the install after Node; the install
  before the API verifier. Five planted breaks name them: no install,
  an install before Node, an install after the verifier, no pnpm, and
  pnpm after Node
- Say in docs/ci.md why the job installs the workspace

Verified: the workflow test passes, and with the previous workflow file
put back it fails on the new promises and on the comment-only control.
Not verified here: a live run of the workflow, which needs a dispatch.
why: The header gate measured that the port links fit from 280 to 1920
pixels and that the Packages disclosure opens, closes and returns focus.
It never measured a layout shift, and it ran in the default light scheme
only, so the disclosure's text could lose contrast in dark, or a late
script could nudge the bar, without a check noticing.

what:
- Add checkHeaderLinksRender: in light and dark, at 320 and 1440 pixels,
  with and without JavaScript, the open panel's name, detail line,
  heading and title and the chips' labels must each be drawn, at full
  opacity, with 4.5:1 text contrast over the surfaces beneath them. A
  selector that finds nothing visible fails, and so does a page whose
  surface is not in the scheme asked for
- With JavaScript, wait a few frames after the page enhances itself,
  flush the browser's pending layout shifts and require that none is
  attributed to the header. The bar's height stays with the existing
  link check. A call that passes script or css for a page with scripting
  off throws, because a style tag added there never returns
- Add checkHeaderLinksRenderFail: an unbroken run, then a bar that moves
  two frames after enhancement, a light grey detail line on the light
  panel, a dark grey one on the dark panel (each passing in the other
  scheme), a faint chip label, a half-opaque detail line and a heading
  nothing draws must each fail by the problem they name
- Run both from --global-header and from the full matrix beside the
  existing header-link check, and describe them in CONTRIBUTING.md

Measured on the Rust landing page at 320, 375, 768, 1024 and 1440 pixels
in a fresh browser profile: no horizontal scroll, header shift 0 with
JavaScript, panel name and detail contrast between 6.2:1 and 15.0:1.
The passes take 3 to 5s and the controls 4 to 5s; four consecutive runs
of both agreed.
why: The component comment said the chips show their mark alone below
70rem, but the rule in global.css and the test that pins it hide the
labels below 80rem. The picker stylesheet called a group's heading a
product's, though the groups are source, packages and API reference.

what:
- Correct the comment to 80rem
- Say a kind's heading, not a product's
@tony
tony merged commit 8493763 into main Nov 1, 2026
2 of 4 checks passed
@tony
tony temporarily deployed to docs-preview-cleanup November 1, 2026 14:58 — with GitHub Actions Inactive
tony added a commit that referenced this pull request Nov 1, 2026
why: This branch predates the MCP and workspace showcases (#227), which
the landing tabs now reuse (#239).

what:
- Brings in #227 (showcases, tmux-layout renderer) and #230 unchanged.

This branch was successfully deployed

1 inactive deployment
docs-preview-cleanup — 5fa299b6 Deployed Nov 1, 2026 by tony via cleanup #203
docs-preview — 5fa299b6 Deployed Nov 1, 2026 by tony via publish-preview / publish #1079
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant