Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ADR 0007: Operator-grade interface rules for the viewer and the book

Context

ADR 0004 chose the renderer stack but said nothing about the interface around the scene: the on-screen display, telemetry plots, playback controls and debug overlays (#40, #41). The project follows an operator-grade interface standard: dense, token-driven layouts built for a named operator, with a list of banned generic styling (gradients, large radii, decorative color, emoji, slow motion).

Two parts of the project draw pixels without being interface chrome. The 3D scene renders physical light, and a physically based sky is a gradient by nature. The README hero is a marketing graphic. The book is a public site generated by mdBook, which already loads KaTeX from a CDN (ADR 0005).

Decision

  • Scope. Interface chrome follows the standard: everything in viewer/src that is not the rendered scene, including elements drawn over it, and the book’s own additions in docs/theme. The rendered scene (sky, lighting, materials, post-processing) is exempt from the surface bans. The README hero (assets/readme) is exempt as a marketing graphic.
  • Tokens. Every color, size and spacing value in interface code comes from one token file: viewer/src/styles/tokens.css for the viewer (created with the shell in #34) and docs/theme/tokens.css for the book. A color literal anywhere else is a defect.
  • Stack. The viewer is plain TypeScript and CSS around three.js, with no component library. Adopting one is a new decision record.
  • Assets. The viewer self-hosts every asset it loads: fonts, environment maps, textures and the WebAssembly module. No request leaves the site’s origin, so a local build works offline. The book keeps KaTeX from jsDelivr, pinned by version and subresource-integrity hashes: it is only read online, and self-hosting would add about 1 MB of fonts to the repository.
  • Enforcement. npm run lint:ui scans viewer/src and docs/theme for the banned patterns on every pull request. Viewer changes also go through the visual loop at 1366×768, 1920×1080 and 2560×1440, which the visual regression suite (#42) automates.

Consequences

  • The scan is mechanical, so a ban cannot be broken by accident; it can only be changed by editing the scan, which is reviewed.
  • Interface work starts from an operator statement and a token file, which adds a step before the first panel is built.
  • The exemption for the scene must be applied honestly: a gradient behind a HUD panel is chrome, not sky.
  • The offline viewer needs its fonts and environment maps committed or fetched at build time, with their licenses recorded.

Alternatives considered

  • Apply the surface bans to the scene too. This would forbid a physically based sky and tone-mapped lighting, which are the point of the renderer.
  • Self-host KaTeX in the book. It only helps readers without network access, who cannot load the book from GitHub Pages anyway.
  • A component library for the viewer. The interface is a few dense panels over a canvas; a library’s layout and theming would be overridden more than used.