summaryrefslogtreecommitdiff
path: root/scripts/.claude/ct-show-swell-direction.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-show-swell-direction.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-show-swell-direction.yaml')
-rw-r--r--scripts/.claude/ct-show-swell-direction.yaml75
1 files changed, 75 insertions, 0 deletions
diff --git a/scripts/.claude/ct-show-swell-direction.yaml b/scripts/.claude/ct-show-swell-direction.yaml
new file mode 100644
index 0000000..6021bf0
--- /dev/null
+++ b/scripts/.claude/ct-show-swell-direction.yaml
@@ -0,0 +1,75 @@
+name: "Display swell direction in instrument sheet"
+description: "MarineConditions.swellDirDeg is fetched from Open-Meteo and stored but never shown. The Swell cell shows height and period but drops the direction."
+agent:
+ model: "sonnet"
+ working_dir: "/workspace/nav"
+ instructions: |
+ Context
+ -------
+ fetchCurrentConditions() populates MarineConditions.swellDirDeg from
+ swell_wave_direction (degrees true from Open-Meteo).
+ (android-app/app/src/main/kotlin/org/terst/nav/data/model/MarineConditions.kt, line 13)
+
+ The instrument sheet expanded section has a Swell column:
+ (android-app/app/src/main/res/layout/layout_instruments_sheet.xml)
+ <LinearLayout vertical gravity=center>
+ <TextView style="InstrumentLabel" text="Swell" />
+ <TextView id="value_swell_ht" style="InstrumentPrimaryValue" /> <!-- e.g. "0.8 m" -->
+ <TextView id="value_swell_per" style="InstrumentLabel" /> <!-- e.g. "8 s" -->
+ </LinearLayout>
+
+ MainActivity's marineConditions collector sets swellHt and swellPer but ignores swellDirDeg:
+ (android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt, marineConditions collector)
+
+ InstrumentHandler.updateConditions() has swellPer but no swellDir parameter.
+ (android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt)
+
+ Goal
+ ----
+ Show swell direction by updating value_swell_per to contain both direction and period
+ (e.g. "045° / 8 s"), avoiding the need for a fourth TextView in an already-tight column.
+ Alternatively add a third sub-label TextView — use whichever fits better visually.
+
+ The simplest approach: combine direction and period into value_swell_per as "DIR° / Xs".
+
+ Step 1 — Update updateConditions() in InstrumentHandler
+ --------------------------------------------------------
+ In android-app/app/src/main/kotlin/org/terst/nav/ui/InstrumentHandler.kt,
+ the swellPer parameter already exists. No layout change needed if we combine
+ direction + period into that field.
+
+ Step 2 — Update the marineConditions collector in MainActivity
+ --------------------------------------------------------------
+ In android-app/app/src/main/kotlin/org/terst/nav/MainActivity.kt,
+ in observeDataSources(), update the swellPer line in updateConditions() to combine
+ direction and period:
+
+ swellPer = when {
+ c.swellDirDeg != null && c.swellPeriodS != null ->
+ "%.0f° / %.0f s".format(Locale.getDefault(), c.swellDirDeg, c.swellPeriodS)
+ c.swellPeriodS != null ->
+ "%.0f s".format(Locale.getDefault(), c.swellPeriodS)
+ c.swellDirDeg != null ->
+ "%.0f°".format(Locale.getDefault(), c.swellDirDeg)
+ else -> "—"
+ }
+
+ 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/MainActivity.kt
+ git commit -m "feat(instruments): show swell direction alongside swell period
+
+ swellDirDeg was fetched from Open-Meteo and stored in MarineConditions
+ but never displayed. Combines direction and period in the swell sub-label
+ as e.g. '045° / 8 s'."
+ git push github main && git push local main
+timeout: "15m"
+tags:
+ - "instruments"
+ - "swell"
+ - "forecast"