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) 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: Add a third child TextView for the direction: 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"