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-anchor-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-anchor-to-map.yaml')
| -rw-r--r-- | scripts/.claude/ct-wire-anchor-to-map.yaml | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/scripts/.claude/ct-wire-anchor-to-map.yaml b/scripts/.claude/ct-wire-anchor-to-map.yaml new file mode 100644 index 0000000..9ef8513 --- /dev/null +++ b/scripts/.claude/ct-wire-anchor-to-map.yaml @@ -0,0 +1,82 @@ +name: "Wire anchor watch state to map overlay" +description: "LocationService.anchorWatchState is collected in MainActivity but only updates SafetyFragment text — MapHandler.updateAnchorWatch() is never called, so the anchor point and radius circle never appear on the map" +agent: + model: "sonnet" + working_dir: "/workspace/nav" + instructions: | + Context + ------- + LocationService.anchorWatchState: StateFlow<AnchorWatchState> + (android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt, companion, line ~353) + + MapHandler.updateAnchorWatch(state: AnchorWatchState) is fully implemented — it shows + an anchor icon and radius circle on the map, or clears them when inactive: + (android-app/app/src/main/kotlin/org/terst/nav/ui/MapHandler.kt, line ~139) + + In MainActivity.observeDataSources(), anchorWatchState IS collected, but only + to update a text field in SafetyFragment: + LocationService.anchorWatchState.collect { state -> + safetyFragment.updateAnchorStatus(...) + } + There is no call to mapHandler?.updateAnchorWatch(state) anywhere. + + AnchorWatchState: + (android-app/app/src/main/kotlin/org/terst/nav/AnchorWatchData.kt) + data class AnchorWatchState( + val isActive: Boolean, + val anchorLocation: Location?, + val watchCircleRadiusMeters: Double, + val setTimeMillis: Long + ) + + The map style must be loaded before calling updateAnchorWatch — gate on loadedStyleFlow. + + Goal + ---- + In the existing anchorWatchState collector in observeDataSources(), add a call to + mapHandler?.updateAnchorWatch(state) alongside the existing safetyFragment update. + Gate the map call on the style being loaded. + + Step 1 — Update the existing collector + --------------------------------------- + In android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt, + find the anchorWatchState collector in observeDataSources(): + + lifecycleScope.launch { + LocationService.anchorWatchState.collect { state -> + safetyFragment.updateAnchorStatus(if (state.isActive) "Active: ${state.watchCircleRadiusMeters}m" else "Inactive") + } + } + + Replace with: + + lifecycleScope.launch { + LocationService.anchorWatchState.collect { state -> + safetyFragment.updateAnchorStatus(if (state.isActive) "Active: ${state.watchCircleRadiusMeters}m" else "Inactive") + if (loadedStyleFlow.value != null) { + mapHandler?.updateAnchorWatch(state) + } + } + } + + No import changes needed. + + 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 anchor watch state to map overlay + + The anchorWatchState collector in observeDataSources() was only updating + SafetyFragment text. Now also calls mapHandler.updateAnchorWatch(state) + when the map style is loaded, showing the anchor icon and radius circle." + git push github main && git push local main +timeout: "15m" +tags: + - "map" + - "anchor" + - "wiring" |
