diff options
| author | Peter Stone <thepeterstone@gmail.com> | 2026-04-03 08:05:24 +0000 |
|---|---|---|
| committer | Peter Stone <thepeterstone@gmail.com> | 2026-04-03 08:05:24 +0000 |
| commit | 5d358cd570075d36a61f9a37bb80c64f8a0a7e2a (patch) | |
| tree | fa03f40d3c6a96da726b591d269c152adbdf7210 /scripts/.claude/ct-show-wind-direction.yaml | |
| parent | 9417a7c6b08da362ad97e85973b7570e05d4f0b5 (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-show-wind-direction.yaml')
| -rw-r--r-- | scripts/.claude/ct-show-wind-direction.yaml | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/scripts/.claude/ct-show-wind-direction.yaml b/scripts/.claude/ct-show-wind-direction.yaml new file mode 100644 index 0000000..3ac9276 --- /dev/null +++ b/scripts/.claude/ct-show-wind-direction.yaml @@ -0,0 +1,92 @@ +name: "Display forecast wind direction (TWD) in instrument sheet" +description: "MarineConditions.windDirDeg is fetched from Open-Meteo and stored in the model but never displayed anywhere. Show it as a sub-label under the TWS cell." +agent: + model: "sonnet" + working_dir: "/workspace/nav" + instructions: | + Context + ------- + fetchCurrentConditions() in WeatherRepository populates MarineConditions.windDirDeg + from the Open-Meteo hourly winddirection_10m field (in degrees true). + (android-app/app/src/main/kotlin/org/terst/nav/data/repository/WeatherRepository.kt, line ~63) + (android-app/app/src/main/kotlin/org/terst/nav/data/model/MarineConditions.kt, line 9) + + In MainActivity.observeDataSources(), the marineConditions collector reads windSpeedKt + (displays as TWS) but never reads windDirDeg: + (android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt, marineConditions collector) + + The instrument sheet layout has a TWS cell: + (android-app/app/src/main/res/layout/layout_instruments_sheet.xml) + <TextView android:id="@+id/value_tws" style="@style/InstrumentPrimaryValue" /> + + Goal + ---- + Show wind direction as a secondary line below the TWS value (e.g. "045°") using the + same pattern used for curr_dir below curr_spd in the conditions section. + + Step 1 — Add value_twd TextView to layout + ------------------------------------------ + In android-app/app/src/main/res/layout/layout_instruments_sheet.xml, + find the TWS LinearLayout: + + <LinearLayout ... android:gravity="center" android:padding="8dp"> + <TextView style="@style/InstrumentLabel" android:text="TWS" /> + <TextView android:id="@+id/value_tws" style="@style/InstrumentPrimaryValue" tools:text="—" /> + </LinearLayout> + + Add a third child TextView for the direction: + + <LinearLayout ... android:gravity="center" android:padding="8dp"> + <TextView style="@style/InstrumentLabel" android:text="TWS" /> + <TextView android:id="@+id/value_tws" style="@style/InstrumentPrimaryValue" tools:text="—" /> + <TextView android:id="@+id/value_twd" style="@style/InstrumentLabel" tools:text="—" /> + </LinearLayout> + + Step 2 — Add valueTwd field to InstrumentHandler + ------------------------------------------------- + In android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt: + + Add constructor parameter: + private val valueTwd: TextView + + Add twd parameter to updateDisplay(): + twd: String? = null + + Add in the updateDisplay body: + twd?.let { valueTwd.text = it } + + Step 3 — Wire in MainActivity + ------------------------------ + In android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt, + in setupHandlers(), add to InstrumentHandler constructor: + valueTwd = findViewById(R.id.value_twd) + + In setupHandlers(), add "—" initial value: + instrumentHandler?.updateDisplay(..., twd = "—") + + In observeDataSources(), in the marineConditions collector, add: + instrumentHandler?.updateDisplay( + tws = c.windSpeedKt?.let { "%.1f".format(Locale.getDefault(), it) } ?: "—", + twd = c.windDirDeg?.let { "%.0f°".format(Locale.getDefault(), it) } ?: "—" + ) + + Step 4 — Build + -------------- + cd android-app && ANDROID_HOME=/opt/android-sdk ./gradlew assembleDebug 2>&1 | tail -5 + Confirm BUILD SUCCESSFUL. + + Step 5 — Commit and push + ------------------------ + git add android-app/app/src/main/res/layout/layout_instruments_sheet.xml \ + android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt \ + android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt + git commit -m "feat(instruments): display forecast wind direction (TWD) under TWS cell + + windDirDeg was fetched from Open-Meteo and stored in MarineConditions + but never shown. Adds value_twd sub-label below the TWS primary value." + git push github main && git push local main +timeout: "15m" +tags: + - "instruments" + - "wind" + - "forecast" |
