summaryrefslogtreecommitdiff
path: root/scripts/.claude/ct-remove-mock-tidal.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/.claude/ct-remove-mock-tidal.yaml')
-rw-r--r--scripts/.claude/ct-remove-mock-tidal.yaml83
1 files changed, 83 insertions, 0 deletions
diff --git a/scripts/.claude/ct-remove-mock-tidal.yaml b/scripts/.claude/ct-remove-mock-tidal.yaml
new file mode 100644
index 0000000..86d4e76
--- /dev/null
+++ b/scripts/.claude/ct-remove-mock-tidal.yaml
@@ -0,0 +1,83 @@
+name: "Remove MockTidalCurrentGenerator"
+description: "LocationService generates random fake tidal current arrows near a hardcoded Solent coordinate (50.8, -1.3) every 60 seconds regardless of boat position. Remove the mock generator; leave the layer empty until a real tidal API is integrated."
+agent:
+ model: "sonnet"
+ working_dir: "/workspace/nav"
+ instructions: |
+ Context
+ -------
+ In LocationService.onCreate() there is a coroutine loop:
+ (android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt, lines ~113-119)
+
+ serviceScope.launch {
+ while (true) {
+ val currents = MockTidalCurrentGenerator.generateMockCurrents()
+ _tidalCurrentState.update { it.copy(currents = currents) }
+ kotlinx.coroutines.delay(60000)
+ }
+ }
+
+ MockTidalCurrentGenerator.generateMockCurrents() produces 10 TidalCurrent objects with:
+ - Random speedKnots (0–5 kn)
+ - Random directionDegrees (0–360°)
+ - Positions scattered within 0.05° of lat=50.8, lon=-1.3 (Solent, UK)
+ regardless of actual boat position.
+ (android-app/app/src/main/kotlin/org/terst/nav/MockTidalCurrentGenerator.kt)
+
+ TidalCurrentState has an isVisible flag (defaults false) and a currents list.
+ MapHandler.updateTidalCurrents() respects isVisible — when false it clears the layer.
+
+ Goal
+ ----
+ 1. Remove the mock generator loop from LocationService.onCreate()
+ 2. Delete MockTidalCurrentGenerator.kt
+ 3. Ensure _tidalCurrentState starts with isVisible=false and empty currents (the default)
+ 4. Remove the import of MockTidalCurrentGenerator from LocationService
+
+ Do NOT remove TidalCurrentState, _tidalCurrentState, or the tidalCurrentState public flow —
+ those are needed when a real tidal API is added later.
+ Do NOT remove ACTION_TOGGLE_TIDAL_VISIBILITY handling in onStartCommand — keep the
+ visibility toggle working for future use.
+
+ Step 1 — Remove the mock loop from LocationService
+ ---------------------------------------------------
+ In android-app/app/src/main/kotlin/org/terst/nav/LocationService.kt:
+
+ Delete the entire block (including the comment):
+ // Mock tidal current data generator
+ serviceScope.launch {
+ while (true) {
+ val currents = MockTidalCurrentGenerator.generateMockCurrents()
+ _tidalCurrentState.update { it.copy(currents = currents) }
+ kotlinx.coroutines.delay(60000) // Update every minute
+ }
+ }
+
+ Remove the import:
+ import org.terst.nav.MockTidalCurrentGenerator
+
+ Step 2 — Delete MockTidalCurrentGenerator.kt
+ ---------------------------------------------
+ Delete android-app/app/src/main/kotlin/org/terst/nav/MockTidalCurrentGenerator.kt
+
+ Step 3 — Build
+ --------------
+ cd android-app && ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug 2>&1 | tail -5
+ Confirm BUILD SUCCESSFUL with no references to MockTidalCurrentGenerator remaining.
+
+ Step 4 — Commit and push
+ ------------------------
+ git add -A
+ git commit -m "chore: remove MockTidalCurrentGenerator
+
+ The mock generator was producing 10 random tidal current arrows near a
+ hardcoded Solent coordinate (50.8, -1.3) every 60 seconds regardless of
+ boat position. Remove it entirely. The tidal overlay infrastructure
+ (TidalCurrentState, mapHandler.updateTidalCurrents) is retained for when
+ a real tidal current API is integrated."
+ git push github main && git push local main
+timeout: "15m"
+tags:
+ - "cleanup"
+ - "tidal"
+ - "mock-data"