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

forked from trevato/cs

The support line moves behind the door, and the panel becomes the shell's #344

shipped production is serving it opened this has it
opened this

#329 gave the shooter a line a person can paste, and its own pull says which box of #310 it left unticked: "the diagnostics panel is still only on the shooter's page, not /range and /example". The reason is the direction's: src/client/support.ts is a pure function of plain facts that names no weapon, no round and no map, and it sits in the shooter, where #328's rule means src/range/ and src/example/ may not import it. The markup is the shooter's too — <details id="support"> is written into src/pages/game.ts:410.

This issue moves both, and changes nothing a visitor sees.

Done looks like

  • [ ] src/engine/support.ts holds supportLine, Facts, Running, NO_PICTURE and NO_PICTURE_SAYS — moved, not rewritten — and src/client/support.test.ts moves beside it with every assertion it has today still passing.
  • [ ] Nothing in Running names a game's concept. Every member stays optional, because the example has no pointer, no keyboard lock and no scoreboard; a field that is the shooter's alone stays in the shooter and is appended there.
  • [ ] The name arrives at the door: exported from src/engine/index.ts with the docstring the neighbours have, src/engine/boundary.test.ts's pinned list and src/engine/surface.json regenerated with bun run scripts/surface.ts --write, the version moved as #191 requires, and GUIDE.md gains its paragraph and its seam-table row.
  • [ ] The panel is the shell's: the <details>, its summary, its sentence, the #supportline paragraph and the copy button move from src/pages/game.ts into src/pages/shell.ts, handed in as data by a page that wants one. A page that runs nothing — the 404, the 500 — asks for none and gets no element, the way the script and the <noscript> line already work.
  • [ ] The shooter is unchanged from the outside: / renders the same panel with the same ids (support, supportline, copysupport), and src/client/main.ts imports from the door instead of ./support.ts.
  • [ ] The engine's own rules hold: no work at import time and no browser global touched (purity.test.ts, page.test.ts stay green), and the pull states each committed bundle's size before and after — a module the shooter already ships should not grow the range's bundle by more than the bytes it uses.
  • [ ] Tests that would fail without this: src/pages/shell.test.ts asserts the exact ids when a page asks for the panel and no element when it does not; the range's and the example's source-reading bundle tests accept support through the door.

Files I expect to change

src/engine/support.ts (moved) and src/engine/support.test.ts, src/engine/index.ts, src/engine/surface.json, src/engine/boundary.test.ts, src/engine/GUIDE.md, src/pages/shell.ts and its test, src/pages/game.ts and its test, src/client/main.ts, src/client/support.ts and src/client/support.test.ts (deleted).

Risks

  • Running is where a game's vocabulary leaks into the engine. Keep it plain, and let each game write its own words after the line if it must.
  • If any CSS moves with the panel, src/policy.ts hashes the exact style text into the CSP — move the rule, then let the hash follow, and check / still renders styled.
  • This is a move. A diff that also rewrites the sentence is a diff nobody can review against #329's tests.

Suggested: Vesper.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs