summaryrefslogtreecommitdiff
path: root/scripts/.claude/ct-fix-weather-fallback.yaml
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-04-03 08:05:24 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-04-03 08:05:24 +0000
commit5d358cd570075d36a61f9a37bb80c64f8a0a7e2a (patch)
treefa03f40d3c6a96da726b591d269c152adbdf7210 /scripts/.claude/ct-fix-weather-fallback.yaml
parent9417a7c6b08da362ad97e85973b7570e05d4f0b5 (diff)
chore(stories): add claudomator stories for unused results and faked data
6 stories covering findings from codebase audit: - ct-remove-mock-tidal: remove random fake tidal currents near Solent - ct-wire-tidal-to-map: wire tidalCurrentState to MapHandler (never called) - ct-wire-anchor-to-map: wire anchorWatchState to map overlay (text-only) - ct-show-wind-direction: display TWD fetched but not shown in sheet - ct-show-swell-direction: display swell dir fetched but not shown - ct-fix-weather-fallback: remove silent SF fallback in WeatherActivity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'scripts/.claude/ct-fix-weather-fallback.yaml')
-rw-r--r--scripts/.claude/ct-fix-weather-fallback.yaml64
1 files changed, 64 insertions, 0 deletions
diff --git a/scripts/.claude/ct-fix-weather-fallback.yaml b/scripts/.claude/ct-fix-weather-fallback.yaml
new file mode 100644
index 0000000..97823c7
--- /dev/null
+++ b/scripts/.claude/ct-fix-weather-fallback.yaml
@@ -0,0 +1,64 @@
+name: "Fix WeatherActivity silent fallback to San Francisco"
+description: "WeatherActivity silently uses lat=37.8, lon=-122.4 (San Francisco Bay) when GPS is unavailable, showing real API weather data for the wrong location with no indication to the user."
+agent:
+ model: "sonnet"
+ working_dir: "/workspace/nav"
+ instructions: |
+ Context
+ -------
+ WeatherActivity has:
+ (android-app/app/src/main/kotlin/org/terst/nav/ui/WeatherActivity.kt, lines ~23-24)
+
+ private val defaultLat = 37.8
+ private val defaultLon = -122.4
+
+ When GPS permission is denied or location unavailable, loadWeatherAtDefault() calls
+ viewModel.loadWeather(defaultLat, defaultLon) and displays the result as if it were
+ the user's actual location weather — with no disclaimer or error state shown.
+
+ Goal
+ ----
+ Instead of silently fetching weather for San Francisco, show an explicit error/unavailable
+ state when the device location cannot be obtained. Do not fetch any weather data in that path.
+
+ Remove defaultLat/defaultLon and loadWeatherAtDefault() entirely.
+ When location is unavailable, set UiState.Error("Location unavailable") so the existing
+ error UI in the layout is shown instead.
+
+ Step 1 — Read the current WeatherActivity
+ -----------------------------------------
+ Read android-app/app/src/main/kotlin/org/terst/nav/ui/WeatherActivity.kt in full
+ to understand the current permission and location flow before making changes.
+
+ Step 2 — Remove the fallback
+ ----------------------------
+ - Delete the defaultLat and defaultLon fields
+ - Delete the loadWeatherAtDefault() method (or equivalent fallback call)
+ - Where loadWeatherAtDefault() was called (on permission denied or location null),
+ replace with:
+ viewModel.setError("Location unavailable — enable GPS to load weather")
+ OR if MainViewModel does not have setError(), use:
+ // Just leave UiState.Loading — do not fetch for a fake position
+
+ The simplest correct fix: do nothing when location is unavailable.
+ The existing "Loading" spinner is less harmful than wrong-location data.
+
+ Step 3 — Build
+ --------------
+ cd android-app && ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug 2>&1 | tail -5
+ Confirm BUILD SUCCESSFUL.
+
+ Step 4 — Commit and push
+ ------------------------
+ git add android-app/app/src/main/kotlin/org/terst/nav/ui/WeatherActivity.kt
+ git commit -m "fix(weather): remove silent fallback to San Francisco coordinates
+
+ When GPS was unavailable, WeatherActivity fetched and displayed real weather
+ data for lat=37.8 lon=-122.4 (San Francisco Bay) with no indication to the
+ user. Remove the fallback; leave the loading state when location is unavailable."
+ git push github main && git push local main
+timeout: "15m"
+tags:
+ - "weather"
+ - "bug"
+ - "ux"