diff options
| author | Claude <noreply@anthropic.com> | 2026-04-23 23:10:11 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-04-23 23:10:11 +0000 |
| commit | e1db9200e9d44c10450361cc8984a45b2eda87b7 (patch) | |
| tree | 21bdfca02491e6ff4cde7a22673c821c0a03e108 /scripts/.claude/ct-wire-tidal-to-map.yaml | |
| parent | 55509f579b4d074f01237dd90791b6d25aaec3cd (diff) | |
| parent | eb78d317c722234a7ef2c501c68c9aa730ec2758 (diff) | |
Merge origin/main — unite all work onto one branch
Brings in dev log (NavLogger), UnitPrefs, MapLayerManager, HUD views,
conditions throttling, track save/load pipeline, improved ParticleWindView
(antimeridian-aware, dynamic particle count), Snackbar error surfacing,
and all other main-branch work from the prior session.
Combined with master's hardware source flags, vessel registry, crew
management, thermal alarm, CPA collision alerts, and track stats.
Also documents primary branch policy in CLAUDE.md and .agent/config.md:
all work merges to main, never master.
https://claude.ai/code/session_011h2dXbgXg3PesQMmQUNTCW
Diffstat (limited to 'scripts/.claude/ct-wire-tidal-to-map.yaml')
| -rw-r--r-- | scripts/.claude/ct-wire-tidal-to-map.yaml | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/.claude/ct-wire-tidal-to-map.yaml b/scripts/.claude/ct-wire-tidal-to-map.yaml new file mode 100644 index 0000000..b5a1923 --- /dev/null +++ b/scripts/.claude/ct-wire-tidal-to-map.yaml @@ -0,0 +1,75 @@ +name: "Wire tidal current state to map overlay" +description: "LocationService.tidalCurrentState is emitted but never collected in MainActivity — MapHandler.updateTidalCurrents() is never called, so the tidal arrow layer is always empty" +agent: + model: "sonnet" + working_dir: "/workspace/nav" + instructions: | + Context + ------- + LocationService exposes a public StateFlow: + LocationService.tidalCurrentState: StateFlow<TidalCurrentState> + (android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt, companion object, line ~354) + + MapHandler has a fully-implemented method: + fun updateTidalCurrents(state: TidalCurrentState) + (android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt, line ~155) + + MainActivity.observeDataSources() + (android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt) + never subscribes to tidalCurrentState, so updateTidalCurrents() is never called. + The tidal arrow overlay on the map is always empty regardless of what data arrives. + + The map style must be loaded before calling updateTidalCurrents — use loadedStyleFlow + as a gate, the same way updateTrackLayer is gated (see the combine() pattern already + in observeDataSources for track points). + + Goal + ---- + Subscribe to LocationService.tidalCurrentState in MainActivity.observeDataSources() + and forward each emission to mapHandler?.updateTidalCurrents(state). + + The subscription should be gated on loadedStyleFlow being non-null (style loaded), + matching the pattern used for track points. + + Step 1 — Add the observer + ------------------------- + In android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt, + inside observeDataSources(), add after the existing collectors: + + lifecycleScope.launch { + loadedStyleFlow.filterNotNull().collect { + LocationService.tidalCurrentState.collect { state -> + mapHandler?.updateTidalCurrents(state) + } + } + } + + Or equivalently using combine(), consistent with the track pattern: + + lifecycleScope.launch { + loadedStyleFlow.filterNotNull() + .combine(LocationService.tidalCurrentState) { _, state -> state } + .collect { state -> mapHandler?.updateTidalCurrents(state) } + } + + No import changes needed — LocationService is already imported. + + Step 2 — Build + -------------- + cd android-app && ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug 2>&1 | tail -5 + Confirm BUILD SUCCESSFUL. + + Step 3 — Commit and push + ------------------------ + git add android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt + git commit -m "fix(map): wire tidal current state to map overlay in MainActivity + + LocationService.tidalCurrentState was emitted but never collected. + Subscribe in observeDataSources() gated on style load, forwarding + each TidalCurrentState to mapHandler.updateTidalCurrents()." + git push github main && git push local main +timeout: "15m" +tags: + - "map" + - "tidal" + - "wiring" |
