From 1198bfa55859aeeef360cc4a9459ea819c5daf1a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Jul 2026 00:49:46 +0000 Subject: [PATCH 1/2] Replay: auto theme default + speed and glide-ratio trail colour modes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Theme defaults to auto ('system') when nothing is stored — follows prefers-color-scheme live. Explicit dark/light choices are untouched. - New 'Speed' trail colouring: per-vertex smoothed ground speed (prefix-sum path length over the same +/-3-fix window as vario, computed at load), rendered on the sequential ramp from SPEED_MIN to SPEED_MAX (18-108 km/h; the floor isn't 0 because nobody flies below stall speed, which would waste the ramp's bottom third). Useful for reading strategy: thermalling drift vs cruise vs full-bar glides. - New 'Glide ratio' trail colouring: red (poor) -> yellow -> green (good), scaled logarithmically over 2..32 so a 4->8 improvement reads as strongly as 16->32. Climbing/level segments render flat in the themed vario-zero colour - glide is effectively infinite there. - Colour-scale legend covers both modes (speed in the user's units; glide as ratios with the geometric-mean midpoint and a 'climb = grey' note). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01DZpFYsCEyR7ck3bWmQNhCr --- docs/3d-flight-replay-notes.md | 11 +++-- web/frontend/src/replay.html | 6 ++- web/frontend/src/replay/flight-scene.ts | 54 ++++++++++++++++++++++--- web/frontend/src/replay/main.ts | 20 +++++++-- web/frontend/src/replay/track-data.ts | 17 +++++++- 5 files changed, 94 insertions(+), 14 deletions(-) diff --git a/docs/3d-flight-replay-notes.md b/docs/3d-flight-replay-notes.md index 9e72ba10..613c1560 100644 --- a/docs/3d-flight-replay-notes.md +++ b/docs/3d-flight-replay-notes.md @@ -15,9 +15,14 @@ viewer was built from) as background. ## 1. What was built - A page `/replay` showing all ~32 pilots of Corryong Cup 2026 Task 1 - with synchronized playback, pilot identity, altitude/vario colouring, task + with synchronized playback, pilot identity, trail colouring (pilot / + altitude / vertical speed [default] / **speed** / **glide ratio**), task geometry, gaggle detection, and a selectable backdrop (abstract vs Mapbox - terrain). + terrain). Speed and glide colour from a per-vertex smoothed ground speed + computed at load (prefix-sum path length over the same ±3-fix window as + vario). The glide ramp is **logarithmic** over `GLIDE_LO..GLIDE_HI` (2…32 — + a 4→8 improvement reads as strongly as 16→32); climbing/level segments + render flat in the themed vario-zero colour (glide is effectively ∞ there). - **Per-pilot live metrics** (see §5.15): rank badges pinned to the marker cones, and a draggable metrics callout (altitude / climb / ground speed / glide ratio) with a leader line to the pilot's cone. There is deliberately @@ -431,7 +436,7 @@ remains only for the gaggle-ribbon hovers (GaggleUI). **Theme (dark / light / auto)**: a switch in the control drawer, stored as `theme` in the same `glidecomp:preferences` record ('system' = auto, follows -`prefers-color-scheme` live). Light mode uses an **off-white** background +`prefers-color-scheme` live; **auto is the default** when nothing is stored). Light mode uses an **off-white** background (`#f2f0e9`, deliberately not full white). Mechanics: main.ts toggles a `light` class on ``; the page's own `