Change pause on plane landing to slow down to 1x and resume again last selected speed if no planes are on ground. Slow down to 1x when any plane is on land (unless speed is changed manualy) #57

Closed
opened 2026-09-20 15:24:07 +02:00 by kamilkrzywda · 1 comment
Owner
No description provided.
kamilkrzywda changed title from Change pause on plane landing to slow down to 1 and resume last selected speed if no planes are on ground. Slow down to 1x when any plane is on land (unless speed is changed manualy) to Change pause on plane landing to slow down to 1x and resume again last selected speed if no planes are on ground. Slow down to 1x when any plane is on land (unless speed is changed manualy) 2026-09-20 15:24:27 +02:00
Author
Owner

Done in v0.30.0 (PR #61, merge commit 57cc670, deployed to https://flight.dev.kkhost.pl).

What changed:

  • Landing no longer pauses the sim — it now slows time down to 1× whenever a plane lands while any plane is on the ground (lib/sim/engine.ts tickOnce; chained planes that immediately start their next queued leg stay airborne and don't trigger the slowdown).
  • New persisted column sim_state.last_selected_time_scale (guarded ALTER + one-shot backfill from the current scale for existing installs) remembers your last manually selected speed.
  • When a dispatch takes the last grounded plane airborne, the sim resumes that last selected speed automatically (flyPlane).
  • Manually changing the speed updates the resume target (last intent wins — this is the "unless changed manually" rule; no extra flag needed). Pause remains a manual-only control and is untouched by landings.

No client changes required — the slider/label re-read timeScale from each poll, so the slowdown and resume are visible automatically. Tests: engine/actions/sim-route unit suites rewritten for the new semantics, legacy-DB backfill covered in the migration test, and e2e/pause-on-landing.spec.ts renamed to e2e/slow-on-landing.spec.ts asserting slow-to-1× on landing + resume of the last selected speed on dispatch.

Done in **v0.30.0** (PR #61, merge commit `57cc670`, deployed to https://flight.dev.kkhost.pl). What changed: - Landing no longer pauses the sim — it now **slows time down to 1×** whenever a plane lands while any plane is on the ground (`lib/sim/engine.ts` tickOnce; chained planes that immediately start their next queued leg stay airborne and don't trigger the slowdown). - New persisted column `sim_state.last_selected_time_scale` (guarded ALTER + one-shot backfill from the current scale for existing installs) remembers your last manually selected speed. - When a dispatch takes the **last grounded plane** airborne, the sim resumes that last selected speed automatically (`flyPlane`). - Manually changing the speed updates the resume target (last intent wins — this is the "unless changed manually" rule; no extra flag needed). Pause remains a manual-only control and is untouched by landings. No client changes required — the slider/label re-read `timeScale` from each poll, so the slowdown and resume are visible automatically. Tests: engine/actions/sim-route unit suites rewritten for the new semantics, legacy-DB backfill covered in the migration test, and `e2e/pause-on-landing.spec.ts` renamed to `e2e/slow-on-landing.spec.ts` asserting slow-to-1× on landing + resume of the last selected speed on dispatch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/Flight-Ops#57