diff options
Diffstat (limited to 'scripts/.claude/ct-show-swell-direction.yaml')
| -rw-r--r-- | scripts/.claude/ct-show-swell-direction.yaml | 75 |
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" |
