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

forked from trevato/cs

The fake page answers any media query it is told: the engine stops naming the shooter's two, and the phone is asked about one way #366

stopped no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error) opened this
opened this

Intent: the engine's fake page answers any media query a test names, and the engine's page stops knowing which two queries the shooter happens to ask.

Why now: #361 made fakePage in src/engine/page.ts:481-487 answer (pointer: coarse) and (prefers-reduced-motion: reduce) by string comparison, and it added a PageOptions field for each. The engine now carries a list of the shooter's questions. A second game that asks (prefers-color-scheme: dark) or (hover: none) has to edit the engine to test itself. Separately, the literal "(pointer: coarse)" is written five times across three games (src/client/main.ts:574,1200, src/range/main.ts:214,269, src/example/main.ts:99), and nothing makes those copies agree.

Done looks like

  • [ ] PageOptions takes media?: Readonly<Record<string, boolean>>. matchMedia(q) answers media[q] === true, and a query the page was not told about is false, as it is now.
  • [ ] coarse and reducedMotion are removed from PageOptions, and every caller moves to media in the same change: the stage helpers and boot/bundle/main tests of all three games (src/client/stage.test-helper.ts, src/example/stage.test-helper.ts, src/client/main.test.ts, src/client/bundle.test.ts, src/example/boot.test.ts, src/engine/page.test.ts, and the example in src/engine/GUIDE.md). No test changes what it asserts, only how it builds its page.
  • [ ] The engine exports the coarse-pointer query once (e.g. COARSE_POINTER = "(pointer: coarse)"), and all five call sites in the three games use it. REDUCED_MOTION_QUERY stays in src/client/motion.ts, because that one is the shooter's.
  • [ ] src/engine/page.test.ts covers three cases: a named query answers true, an unnamed one answers false, and a query named false answers false.
  • [ ] surface.json and GUIDE.md record the change. Removing two options is a breaking change to the surface, so bump it the way the guide says. The boundary, purity and cost tests stay green.
  • [ ] bun run test passes.

Files I expect to change: src/engine/page.ts, src/engine/page.test.ts, src/engine/index.ts, src/engine/surface.json, src/engine/GUIDE.md, the stage helpers and tests listed above, src/client/main.ts, src/range/main.ts, src/example/main.ts.

Risks

  • It touches many test files at once. Do it with one mechanical rename and no other edits in the same commit, so review is a diff of constructors.
  • The shipped bundles must not grow a module-scope side effect. A string constant is fine; scripts/cost.test.ts will say if it isn't.

Suggested builder: Torque. Test doubles and the engine's surface are their ground (compare #331, #332).

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs