Skip to content

docs(website): redesign docs.vorpal.build - #578

Open
erikreinert wants to merge 49 commits into
mainfrom
claude/project-thread-p2c85c-redesign
Open

erikreinert wants to merge 49 commits into
mainfrom
claude/project-thread-p2c85c-redesign

Conversation

@erikreinert

Copy link
Copy Markdown
Member

Summary

The approved docs.vorpal.build redesign (Gate 4), in one PR. It replaces the stacked PRs #569 to #577; the commits keep that step order.

  1. CI guardrails: page size budgets, axe accessibility checks, Lighthouse and lychee link checks, all as jobs in .github/workflows/vorpal.yaml. Upgrades to Astro 7.4.13 and Starlight 0.43.1, with Sätteri Markdown.
  2. Foundation: design tokens mapped onto Starlight's --sl-* variables, plus type and colour in light and dark.
  3. Site shell: header, sidebar, footer and page title overrides; a global SDK picker (Python by default).
  4. Components: SDK groups, callouts, cards and diagrams. Mermaid is replaced with build-time diagrams.
  5. Reference: CLI, configuration and error references generated from data, with a drift check.
  6. Content pages: Quickstart (now runs vorpal prepare before the first locked build), dev environment guide, TLS, SDK hubs, How Vorpal compares (every row sourced), 404, and corrected architecture copy. Files move only through the registry; the CLI sends build requests to the worker and streams logs.
  7. Search and Markdown: a Pagefind dialog that returns flags, keys and errors as their own results; a .md copy of every page; /llms.txt and /llms-full.txt.
  8. Home hero, Prism and Journey: "Real code in. Identical builds out." with the three-stage hero, Prism on Concepts > Artifacts, and Journey on a new Concepts > How a build runs page.
  9. Versions: a frozen 0.6 snapshot at /v/0.6/, a version switcher, a snapshot banner, an Unreleased badge and version-scoped search. script/website-versions/snapshot.mjs must be run at each release; the build fails if the latest release has no snapshot.

Checks

  • The site builds with Bun only, and two builds give identical output.
  • All pages are within budget, with 0 axe violations and an empty baseline.
  • Every step's PR passed the full vorpal workflow, including the four-SDK artifact builds.

Notes

  • Merging deploys to docs.vorpal.build, because Cloudflare Pages builds production from main.
  • If content changes before merge, re-run the snapshot script.

Generated by Claude Code

Bump astro 6.4.8 -> 7.4.13, @astrojs/starlight 0.38.2 -> 0.43.1,
sharp 0.34.5 -> 0.35.5 and wrangler 4.162.0 -> 4.167.0, pinned exactly.

Astro 7 renders Markdown and MDX with Sätteri instead of remark/rehype,
and the legacy `markdown.rehypePlugins` key now needs
@astrojs/markdown-remark. Instead of pulling the unified stack back in:

- Set `markdown.processor` to `satteri()` from @astrojs/markdown-satteri
  (now a direct dependency, 0.4.10) and drop the deprecated
  `markdown.gfm` (GFM is on by default).
- Port the table-region plugin to a Sätteri hast plugin. It produces the
  same 68 regions and accessible names as before.
- Sätteri's smart punctuation turns `--` into an en dash, where
  SmartyPants made an em dash. Turn its dashes off and add an em-dashes
  plugin, so the rendered text of every page is unchanged.

Upstream changes visible in the output: Starlight's sidebar pane now
reserves a scrollbar gutter (`scrollbar-gutter: stable`), which narrows
the content column by the scrollbar width on systems with classic
scrollbars, and the build warns that the optional `i18n` collection and
a custom 404 entry are absent (both fall back to Starlight's defaults).
The vorpal-website artifact still builds with only Bun on the PATH.
Add a website workflow that runs on pull requests touching website/,
the checks or the workflow. It builds the site with Bun 1.4.4 (the
artifact's version) and runs, in two parallel jobs:

- Size budgets (script/website-checks/size.mjs): gzip HTML, CSS, JS,
  fonts and first-load requests per page, against the Stage 2 budgets
  per page type (doc, reference, home), and a third-party host allow
  list. Today's only third-party host, cdn.jsdelivr.net (Mermaid), is a
  recorded exception.
- Accessibility (a11y.mjs): axe WCAG 2.0-2.2 A/AA over 8 representative
  pages, light and dark, at 390 and 1280 px, against a baseline of known
  violations. The baseline holds one: Starlight's search button name
  (label-content-name-mismatch) at desktop width.
- Links and anchors: lychee 0.24.2 with --include-fragments, offline,
  over dist/. External links stay with test-website-docs.
- Lighthouse CI on 4 pages (mobile, 3 runs, median): CLS <= 0.05 fails;
  LCP <= 2.0 s, TBT <= 100 ms and category scores warn, since Mermaid
  from jsDelivr keeps LCP near 2.7 s until it is removed.

The tooling has its own package.json and bun.lock in
script/website-checks, outside website/, so the vorpal-website
artifact's sources and bun install are unchanged.
Add a Cloudflare Pages _headers file that serves /_astro/* with
Cache-Control: public, max-age=31536000, immutable. Astro puts a
content hash in every file name there, so a change always gets a new
URL.
Keep every CI job in one workflow file. The size, axe and lychee checks
become test-website-checks, and Lighthouse becomes
test-website-lighthouse. Both run on pull requests and, like before,
do not depend on the Vorpal artifact builds. A small
test-website-changes job diffs the PR against its base, and the two
check jobs run only when website/, script/website-checks/ or
vorpal.yaml change. Remove website.yaml.
Apply the redesign's design system (docs-redesign stage 4) to the
existing Starlight layout. No page layouts change yet.

Tokens (src/styles/tokens.css):
- Colour, type, space, radii, layout and motion tokens as --vp-*
  custom properties, light by default and dark under
  [data-theme='dark'] (or the system setting when no theme is applied,
  without JavaScript). Motion durations are 0 under reduced motion.
- Map them onto Starlight's variables (--sl-color-*, --sl-font*,
  --sl-text-*, --sl-content-width, --sl-nav-height), so built-in
  components follow them. Note and tip asides are neutral, caution uses
  the warning colour, danger the error colour.
- Every text pair is at least 4.5:1 in both themes; the lowest is the
  light accent on --vp-hover at 4.69:1.
- Replace the old purple theme in custom.css.

Code: two Expressive Code themes (src/code-themes.mjs) built from the
five syntax tokens, switched on [data-theme]. Every token is at least
5.4:1 on the code background, so minSyntaxHighlightingColorContrast is
4.5 and they render as specified (EC's default of 5.5 re-tinted some).
EC still darkens strings slightly on marked lines, where the background
is darker.

Fonts: Instrument Sans and JetBrains Mono as subset WOFF2 files in
src/fonts (Latin, wght 400-700 only, no hinting; 26 + 13 KB), made by
script/website-fonts/subset.py from @fontsource-variable 5.3.0. Astro's
fonts config (local provider) adds font-display: optional and
metric-matched fallback faces; a Head override preloads both files.
The build needs no network and no new dependency.

Theme select: an override of Starlight's ThemeSelect with the same key
(starlight-theme) and values (auto, light, dark), in the design's order
Auto, Light, Dark; other open tabs now follow a change.
Add the fields the redesigned page shell reads: kind, summary, since,
unreleased, wide, lastUpdated and related (references to other docs
pages). All are optional, so every existing page validates unchanged.
lastUpdated keeps Starlight's own type (date or boolean).
…rdrails' into claude/project-thread-p2c85c-foundation
Step 3 of the docs redesign. Starlight component overrides that keep
Starlight's own Search, SocialIcons, ThemeSelect, SidebarPersister,
SidebarSublist, Pagination and route data:

- Header: logo, six sections, Search, SDK select (stores vorpal-sdk),
  version switcher (details: main and 0.6.0), GitHub, theme. Sections are
  inline from 72rem, a native "Sections" disclosure from 50rem, and one
  modal Menu dialog below 50rem (disclosure without JavaScript).
- Route middleware narrows the sidebar to the current section and keeps
  Previous/Next only in Get started.
- PageTitle: breadcrumb, h1 (keeps _top), summary, kind badge, "Applies
  to" line from package.json, Unreleased/Since badges from frontmatter,
  and "On this page" as a disclosure below 72rem and on wide pages.
- Footer: Related from frontmatter, Edit this page, Last updated from
  frontmatter only, and a no-JS site map from the sidebar config.
- Search's Ctrl K hint moves beside the button, fixing axe
  label-content-name-mismatch; the a11y baseline is now empty.
The vorpal-*-* pattern in .gitignore matched src/vorpal-route-data.ts, so
the file was never committed and CI could not resolve it.
Docs redesign step 4 (content pieces):

- SdkGroup: one example in each SDK, read from src/examples/<topic>/.
  All four panels are in the HTML under real headings; <html data-sdk>,
  set by an inline script first in <head> from ?sdk=, the stored
  `vorpal-sdk` choice or Python, shows one before first paint. Tabs use
  manual activation, keep the clicked tab in place and dispatch
  `vorpal:sdk`; the header select and Menu radios share the choice.
  Used on Concepts > Jobs (adds the Python example).
- CLI blocks (```bash prompt) draw the `$` with CSS, so Copy never takes
  it; ```text output blocks are titled "Expected output" and show
  <placeholders> dashed (an Expressive Code plugin). Used on Quickstart.
- Callouts: Starlight asides become role="note" with the design's word
  and icon (caution reads "Warning"); :::planned[ENG-364] adds a Planned
  note with its Linear id. Used on Architecture, Quickstart, Processes.
- A Satteri plugin keyed on frontmatter `kind` wraps headings with
  explicit ids into bench steps (container query at 760px), Check / Fix /
  Verify causes and reference entries, so the TOC and Pagefind still see
  the headings. Quickstart uses steps; Configuration's settings keys are
  reference entries with <Props>; a draft-only specimen page shows causes.
- Diagram frame: static, token-themed SVG with role="img" and an
  "In words" list. The four Mermaid diagrams are now hand-made SVG, and
  the Mermaid script from jsDelivr is gone.
- Theme: the Auto / Light / Dark segmented radio group replaces the
  select (same `starlight-theme` key and values). Without JavaScript,
  pages and code blocks follow prefers-color-scheme instead of dark.
- Expressive Code settings move to ec.config.mjs so <Code> shares them.
Mermaid no longer loads from jsDelivr, so no page may load from a third
party. Lighthouse LCP now passes (1.1 to 1.7 s median, mobile lab) and
fails the check above 2.0 s. The axe check also scans Concepts > Jobs,
which has an SDK example group.
A cargo test walks Cli::command() and writes website/src/data/cli/main.json:
every command, argument and flag with its value name, default, env var,
possible values, conflicts and help. Defaults computed on the host (the
system, VORPAL_SOCKET_PATH) become stable placeholders, so the file is the
same on every machine. The test fails when the committed file and the CLI
differ; regenerate with VORPAL_CLI_REFERENCE_WRITE=1.

releases/0.6.0.json is the same data generated at the 0.6.0 tag.
…figuration

- One page per command under Reference > CLI, rendered from the generated
  data plus a hand-written overlay (overlay.yaml); the build fails when a
  flag has no overlay text or an overlay entry has no flag. Unreleased and
  Since marks come from diffing main.json against the release data.
- The CLI overview keeps the old single-page anchors (#vorpal-build and
  section ids) through row ids and a small redirect script.
- An errors content collection renders the Error reference with stable
  #err- ids; each message cites its source file and line.
- The configuration reference gets one anchored entry per key (16 keys).
- CI: a named drift step in the build job, and test-website-reference,
  which checks every quoted message against the Rust and SDK sources and
  reports CLI changes since the latest release.
The repo-root lychee.toml excludes ^file://, which is how --root-dir
resolves internal links in website/dist, so the check excluded all of
them. Point the website check at its own config.
…rdrails' into claude/project-thread-p2c85c-foundation
…ndation' into claude/project-thread-p2c85c-shell
…ll' into claude/project-thread-p2c85c-components
…ponents' into claude/project-thread-p2c85c-reference
…groups

- nav: Self-hosting becomes a real section; SDK hubs form an extra
  group that narrows the sidebar and shows in the Menu and site map
  but not in the header.
- SdkGroup: a slot per SDK fills a panel with prose instead of code.
- CSS for the facts box, "If this fails" lines, inline Planned marks,
  index lists, comparison rows with sources, and the 404 search form.
- A not-found page kind.
vorpal init writes no Vorpal.lock and build runs locked, so a first
build of a remote source fails as unpinned (agent.rs requires_unlock_to_pin;
command.rs --unlock defaults to false). Add a step that pins the sources
with vorpal prepare before the build. The config program for each SDK
comes from the init templates. Keeps the existing content: --path,
--rebuild, inspecting the output and the immutable store warning.
One how-to with the example in all four SDKs, built from the four SDK
guides' development environment sections, which stay in place. Those
guides are now titled "Every guide in <SDK>" so they no longer share a
title with the SDK hubs.
- Self-hosting: set up TLS and client trust, with trust per SDK, a
  localhost tunnel alternative, undo and security notes.
- SDK hubs for Python, TypeScript, Go and Rust: install, the layout
  vorpal init writes, facts, and links to every guide with that SDK
  chosen.
Every row about another tool cites that tool's documentation; every
Vorpal entry links to the page that documents it.
Add a build-flow diagram: the config program declares artifacts to the
agent daemon, which pushes sources to the registry; the worker pulls
and pushes through the registry; the CLI pulls archives from it and
sends the worker only build requests. Fix the agent section, which said
the CLI submits artifacts to the agent.
The 404 page searches for the missing path's words, routes by
situation and lists every page. Add the new pages to the sidebar and
to the accessibility check.
npm's website returns 403 to link checkers, so the TypeScript SDK hub's
link to @altf4llc/vorpal-sdk failed test-website-docs.
After the build, write /<path>.md for every page (title, summary,
body, Related), and /<path>.<sdk>.md with only one SDK's examples, from
the rendered article: the CLI, error and configuration references are
rendered from data, so their .mdx source holds no text. Code comes from
Expressive Code's copy data, the original source. Links become absolute.

/llms.txt lists the .md copies by sidebar section; /llms-full.txt is
every page in one file. Pages link their copy with rel=alternate, and
_headers serves them as UTF-8.
Replace Starlight's search and Pagefind's Default UI with the design's
dialog: title, section and type tag per result, flags, keys and errors
as results of their own, pages to start from, and routes when nothing
matches. Pagefind loads when the dialog first opens, so it is outside
the first-load budget; doc pages drop from 30 to 5 KB of JS.

Ctrl or Cmd K opens it, one Escape closes it, Up and Down move through
the results. The page's live region moves into the open dialog to
announce the count. The 404 page's search form opens it pre-filled.
The footer links the page's Markdown copy; with JavaScript, Copy as
Markdown puts it on the clipboard and announces it. The checks' static
server serves .md as text/markdown.
The .md copies and llms files repeat the HTML pages' links, and
llms-full.txt shows code as plain text, so lychee read example
addresses such as http://localhost:4321/ as links. Skip those files in
the external check and exclude localhost addresses.
The approved hero (stage 3 rev 10) as Hero.astro: the stage 1 picture in
HTML, its CSS scoped under .vp-hx on the site tokens, and the scene module
(src/scripts/hero.js) loaded after load or on the first interaction.

- The Planned mark after "sandboxed steps" reads "macOS sandboxing
  planned, ENG-364" to screen readers.
- The CLI sends the worker a build request and gets its logs back, drawn
  as outlined messages; files still move only through the registry.
- Announcements use the page's live region, and only after the reader acts.
The hero, routes by situation, the SDK group beside the terminal block,
the comparison strip and How the scene maps. The page header is left out
on Home (the hero holds the h1), the Markdown copy skips the scene, and
the old carousel, docs menu and landing styles go.
One artifact written with each SDK's builders, its canonical JSON and the
JSON's SHA-256. The end state, digest included, is rendered at build time
with the same functions the browser runs (prism-core.js); the interactive
part loads after load or on first interaction. Its language follows the
site SDK both ways, and CSS shows the chosen card before first paint.
The Prism sits under Content addressing; the new #reproducible section is
where the Home hero's macOS Planned mark points.
One vorpal build of the Python template through the real parts, with
What if scenarios, ported once from the stage 4 template. The scene,
controls and text version are HTML; the module loads near the viewport or
on first interaction (a click that comes first is replayed), and a tiny
inline script closes the text version before first paint.
The scripts load as one deferred module with their loader instead of a
dynamic import, which also pulled in Vite's preload helper, and Prism asks
sdk.ts for an SDK change by event instead of importing it, which split
sdk.ts out of the header's script. The work still starts after load or on
first interaction. Prism and How a build runs stay within 15 requests.
Snapshots of the docs for a release line live at /v/<x.y>/
(critique-engineering M3). src/versions.mjs lists them from
src/snapshots/versions.json and maps paths between main and a snapshot.
script/website-versions/snapshot.mjs writes a snapshot when a release
is cut: the pages, the data they render (examples, CLI overlay, error
entries), the release's CLI data and the frozen sidebar. Nothing at build
time writes to src/.

The sidebar moves to src/sidebar.mjs so the script can freeze it.
- Starlight's sidebar gets one group per snapshot; route data shows it
  only on that snapshot's pages, and hides it on main's.
- Links on a snapshot's pages stay in the snapshot: middleware rewrites
  root-absolute links to pages the snapshot has, in dev and build, before
  Pagefind and the Markdown copies read the HTML.
- A snapshot's pages render its frozen data: the release's CLI JSON
  (marked against that release), its CLI overlay, error entries and SDK
  examples.
- Snapshot pages are noindex and left out of the sitemap
  (@astrojs/sitemap with a filter, in place of Starlight's default).
- The build fails when the latest release has no snapshot.
Written by script/website-versions/snapshot.mjs. 0.6.0 is the latest
release (website/package.json, the 0.6.0 tag). Between the 0.6.0 tag and
main nothing changed in the CLI or the SDKs (only README.md and the
TypeScript template's bun.lock), and the CLI data for main equals
releases/0.6.0.json, so the current docs are the docs for 0.6.0.
- The header's version switcher (a native details element) and the
  Menu list main and every snapshot, each linking the same page there,
  or that version's home when it has no such page.
- A snapshot's pages open with a note: the release they document and a
  link to the same page on main (or in the latest release, for an older
  snapshot). Their meta line reads 'Applies to 0.6.0'.
- On main, a page that the latest release's snapshot does not have shows
  the Unreleased badge and 'Applies to main', so the first badge appears
  the first time main differs from the release (team decision 4).
- Every page carries a Pagefind version filter.
- The footer's version line and release notes follow the page's version.
The dialog filters Pagefind results by the page's version filter, so
search on /v/0.6/ returns only 0.6 pages and search on main only main's.
The dialog says which docs it searches.
/llms.txt stays main's, the latest docs, without snapshot pages, and
points to each snapshot's /v/<x.y>/llms.txt. Each snapshot gets its own
llms.txt and llms-full.txt from its frozen sidebar. Markdown copies of
snapshot pages come from the same code path as main's.
A snapshot's pages take the budget of the page they copy: home and
reference rules also match /v/<x.y>/. axe scans the 0.6 home and a CLI
reference page with the banner.
A bordered note on the bench background, like the callouts, with the
link in the accent colour; it had no styles of its own.
Comment thread script/website-checks/size.mjs Fixed
@erikreinert
erikreinert marked this pull request as ready for review November 24, 2026 14:55

This branch has not been deployed

No deployments
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.

2 participants