v0.14.0 — ISS-006 time-scale slider values up to 1000x; tests use fastest time #14

Merged
kamilkrzywda merged 2 commits from feat/time-scale-slider-1000x into master 2026-09-19 11:16:55 +02:00
Owner

What (issue #6)

Time-scale slider values become 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 (was 1–64). Raising the max to 1000x lets e2e tests run at fastest time and finish faster.

  • lib/timeScale.ts — ladder [1,2,5,10,25,50,100,250,500,1000]; scaleToSlider maps off-ladder values to the nearest step by log distance (old formula assumed a power-of-two ladder)
  • lib/sim/engine.ts — MAX_TIME_SCALE 64 → 1000 (server-side clamp/validation); sim math is analytic in the clock, so any scale is exact (tick advance clamped to 2s × scale ≤ 33 game-min/tick)
  • app/api/sim/route.ts, lib/openapi.ts — bounds + error messages updated (spec: max 1000)
  • e2e (sim, actions, right-pane, panes, map-interactions) — SCALE = 60 → 1000; slider assertions End→1000×/Home→1×; mid-flight map test moved to a ~1420 km leg (Madrid–Barajas) with pre-departure refuel so the flight window at 1000x stays observable
  • unit: new clampTimeScale boundary suite + off-ladder mapping cases; 238/238 green locally, tsc clean

Version

  • package.json → 0.14.0; CHANGELOG entry added

Checks

  • local: tsc clean, unit 238/238
  • e2e verified by CI on this PR (isolated dind stack)
## What (issue #6) Time-scale slider values become **1, 2, 5, 10, 25, 50, 100, 250, 500, 1000** (was 1–64). Raising the max to 1000x lets e2e tests run at fastest time and finish faster. - `lib/timeScale.ts` — ladder `[1,2,5,10,25,50,100,250,500,1000]`; `scaleToSlider` maps off-ladder values to the nearest step by log distance (old formula assumed a power-of-two ladder) - `lib/sim/engine.ts` — `MAX_TIME_SCALE` 64 → 1000 (server-side clamp/validation); sim math is analytic in the clock, so any scale is exact (tick advance clamped to 2s × scale ≤ 33 game-min/tick) - `app/api/sim/route.ts`, `lib/openapi.ts` — bounds + error messages updated (spec: max 1000) - e2e (`sim`, `actions`, `right-pane`, `panes`, `map-interactions`) — `SCALE = 60 → 1000`; slider assertions End→`1000×`/Home→`1×`; mid-flight map test moved to a ~1420 km leg (Madrid–Barajas) with pre-departure refuel so the flight window at 1000x stays observable - unit: new `clampTimeScale` boundary suite + off-ladder mapping cases; **238/238 green** locally, tsc clean ## Version - `package.json` → **0.14.0**; CHANGELOG entry added ## Checks - local: tsc clean, unit 238/238 - e2e verified by CI on this PR (isolated dind stack)
kamilkrzywda added 1 commit 2026-09-19 10:55:40 +02:00
kamilkrzywda added 1 commit 2026-09-19 11:11:12 +02:00
kamilkrzywda merged commit 7db8fcc549 into master 2026-09-19 11:16:55 +02:00
kamilkrzywda deleted branch feat/time-scale-slider-1000x 2026-09-19 11:16:55 +02:00
Sign in to join this conversation.