Replaces the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real pause that leaves the time scale untouched, plus an auto-resume when you start a flight.
lib/sim/engine.ts — when the last plane in flight lands, the sim now sets paused = true instead of resetting timeScale to 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.
lib/game/actions.ts — flyPlane() now writes sim_state.paused = false, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).
Net effect: dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.
Tests
Unit: rewrote the auto-slow block in lib/sim/engine.test.ts for pause semantics (last landing → paused=true, scale unchanged; a landing with another plane still flying → no pause); added a flyPlane() test that dispatch on a paused sim clears paused and leaves the scale untouched.
E2E: renamed e2e/auto-slow.spec.ts → e2e/pause-on-landing.spec.ts, asserting simState.paused === trueandtimeScale === 1000 after landing, plus auto-unpause on /fly.
Cross-cutting fix: the per-spec setScale fast-forward helpers in actions, hover, map-interactions, relocation, and right-pane specs now also send paused:false, since a landing pauses the sim. Deliberate pause-behavior tests (frozen-clock assertions) are untouched.
Version
v0.23.2 → v0.24.0 (minor — behavioral change to core sim time controls + new auto-resume).
## What changed
Replaces the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real **pause** that leaves the time scale untouched, plus an **auto-resume** when you start a flight.
- `lib/sim/engine.ts` — when the last plane in flight lands, the sim now sets `paused = true` instead of resetting `timeScale` to 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.
- `lib/game/actions.ts` — `flyPlane()` now writes `sim_state.paused = false`, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).
Net effect: dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.
## Tests
- Unit: rewrote the auto-slow block in `lib/sim/engine.test.ts` for pause semantics (last landing → `paused=true`, scale unchanged; a landing with another plane still flying → no pause); added a `flyPlane()` test that dispatch on a paused sim clears `paused` and leaves the scale untouched.
- E2E: renamed `e2e/auto-slow.spec.ts` → `e2e/pause-on-landing.spec.ts`, asserting `simState.paused === true` **and** `timeScale === 1000` after landing, plus auto-unpause on `/fly`.
- Cross-cutting fix: the per-spec `setScale` fast-forward helpers in `actions`, `hover`, `map-interactions`, `relocation`, and `right-pane` specs now also send `paused:false`, since a landing pauses the sim. Deliberate pause-behavior tests (frozen-clock assertions) are untouched.
## Version
v0.23.2 → **v0.24.0** (minor — behavioral change to core sim time controls + new auto-resume).
Closes #41.
Replace the ISS-011 auto-slow with pause-on-landing: when the last plane
in flight lands, tickOnce sets sim_state.paused=true WITHOUT touching
timeScale (speed preserved). flyPlane() now clears paused before
persisting so starting a flight resumes a paused sim — inside runAction(),
tick + unpause + dispatch are atomic under the sim lock.
Tests: engine.test.ts auto-slow block rewritten for pause semantics; new
flyPlane test asserts dispatch clears paused with speed untouched. E2E:
auto-slow.spec.ts renamed to pause-on-landing.spec.ts asserting the new
behavior (paused=true AND timeScale still 1000 after landing; /fly clears
paused). Cross-cutting fix: every per-spec setScale helper now POSTs
{timeScale, paused:false} — a scale-only fast-forward after a landing would
otherwise leave the clock frozen. Deliberate mid-test pauses untouched.
kamilkrzywda
scheduled this pull request to auto merge when all checks succeed 2026-09-20 11:52:26 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changed
Replaces the old "auto-slow to 1×" behavior (v0.19.0 / ISS-011) with a real pause that leaves the time scale untouched, plus an auto-resume when you start a flight.
lib/sim/engine.ts— when the last plane in flight lands, the sim now setspaused = trueinstead of resettingtimeScaleto 1×. The stored speed is preserved; the trigger condition (last plane in flight) and no-auto-restore semantics are unchanged.lib/game/actions.ts—flyPlane()now writessim_state.paused = false, so dispatching a flight auto-resumes a paused sim (atomic under the sim lock).Net effect: dispatch resumes → planes fly → last landing pauses (speed kept) → next dispatch resumes again.
Tests
lib/sim/engine.test.tsfor pause semantics (last landing →paused=true, scale unchanged; a landing with another plane still flying → no pause); added aflyPlane()test that dispatch on a paused sim clearspausedand leaves the scale untouched.e2e/auto-slow.spec.ts→e2e/pause-on-landing.spec.ts, assertingsimState.paused === trueandtimeScale === 1000after landing, plus auto-unpause on/fly.setScalefast-forward helpers inactions,hover,map-interactions,relocation, andright-panespecs now also sendpaused:false, since a landing pauses the sim. Deliberate pause-behavior tests (frozen-clock assertions) are untouched.Version
v0.23.2 → v0.24.0 (minor — behavioral change to core sim time controls + new auto-resume).
Closes #41.
Replace the ISS-011 auto-slow with pause-on-landing: when the last plane in flight lands, tickOnce sets sim_state.paused=true WITHOUT touching timeScale (speed preserved). flyPlane() now clears paused before persisting so starting a flight resumes a paused sim — inside runAction(), tick + unpause + dispatch are atomic under the sim lock. Tests: engine.test.ts auto-slow block rewritten for pause semantics; new flyPlane test asserts dispatch clears paused with speed untouched. E2E: auto-slow.spec.ts renamed to pause-on-landing.spec.ts asserting the new behavior (paused=true AND timeScale still 1000 after landing; /fly clears paused). Cross-cutting fix: every per-spec setScale helper now POSTs {timeScale, paused:false} — a scale-only fast-forward after a landing would otherwise leave the clock frozen. Deliberate mid-test pauses untouched.