From bd1392ac4eb3aee62fd1c98e0bafcb4f68319d67 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 1 Jul 2026 06:55:49 +0000 Subject: docs(agent): update code-map for layer redesign (OCEAN, ATON, TSS, new picker) Updated Last updated field to 2026-07-01. Added ui/aton/ subsection with AtonData and AtonRepository entries. Updated MapLayerManager to describe MapBasePreset values (OCEAN/SATELLITE/CHARTS/HYBRID) and ATON/TSS prefs. Updated LayerPickerSheet to describe Windy-style card layout and 13-param constructor. Updated MapHandler with ATON/TSS layer methods. Added AtonDataTest to testing guide. Co-Authored-By: Claude Sonnet 4.6 --- .agent/code-map.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.agent/code-map.md b/.agent/code-map.md index e5b28a1..7232110 100644 --- a/.agent/code-map.md +++ b/.agent/code-map.md @@ -1,7 +1,7 @@ # Code Map & Context Tips **Purpose:** Bootstrap context for any new agent session. Read this before touching code. -**Last updated:** 2026-06-30 +**Last updated:** 2026-07-01 --- @@ -214,6 +214,13 @@ Data-only classes (no logic): `WindData`, `HeadingData`, `BoatSpeedData`, `Depth | `FishingModeManager.kt` | Persists `isActive` pref; `computeTarget()` returns cross-current bearing toward estimated temp break | | `FishingOverlayView.kt` | Custom `FrameLayout` inflating `view_fishing_overlay.xml`; `bind(FishingTarget)` updates all text views | +### `ui/aton/` + +| File | Role | +|------|------| +| `AtonData.kt` | Stateless object: `colorFor(type)` (Light→red, Float/Buoy→green, Daybeacon/Range→yellow, else→white), `parseStation(json)` → Feature, `parseResponse(json)` → List. Uses `org.json.JSONObject`. | +| `AtonRepository.kt` | `suspend getFeatures(): List` — 24h disk cache at `filesDir/aton_cache.json`, falls back to stale cache if network unavailable. Fetches from NOAA ATON API. | + ### `ui/` (top level) | File | Role | @@ -221,9 +228,9 @@ Data-only classes (no logic): `WindData`, `HeadingData`, `BoatSpeedData`, `Depth | `MainViewModel.kt` | Top-level app state | | `MobHandler.kt` | MOB activation logic; always-on-top button handler | | `InstrumentHandler.kt` | Routes NMEA/GPS data to instrument display widgets | -| `MapHandler.kt` | MapLibre map setup, overlay rendering, track display, fishing bearing line | -| `MapLayerManager.kt` | Layer visibility: satellite, charts, wind, SST, depth (GEBCO WMS), seamarks, FADs toggle | -| `LayerPickerSheet.kt` | Bottom sheet: layer toggle UI; constructor takes `onSstChanged` in addition to existing callbacks | +| `MapHandler.kt` | MapLibre map setup, overlay rendering, track display, fishing bearing line. ATON: `setupAtonLayer(style, visible)` + `updateAtonLayer(features)` + `setAtonLayerVisible(style, visible)`. TSS: `setupTssLayer(style, context, visible)` + `setTssLayerVisible(style, visible)`. | +| `MapLayerManager.kt` | Layer visibility manager; `MapBasePreset` now has 4 values (OCEAN, SATELLITE, CHARTS, HYBRID) with Esri World Ocean Base as OCEAN preset. ATON/TSS pref keys (`atonEnabled`, `tssEnabled` — pref-only, no Style param). All raster layer defaults are false. | +| `LayerPickerSheet.kt` | Windy-style card-based picker (2×2 base map cards + 2-col overlay toggle cards). Full-height bottom sheet with `onCreateDialog` override and `STATE_EXPANDED`. Constructor has 13 params including `onAtonChanged` and `onTssChanged`. | | `FadData.kt` | 18 Hawaii Island DLNR FAD positions in decimal degrees; `toFeatures()` returns GeoJSON for MapHandler | | `NavLogger.kt` | In-app debug log (primary debugging tool — prefer over ADB) | | `LocationPermissionHandler.kt` | Runtime location permission request flow | @@ -343,6 +350,7 @@ Key test files by domain: | GRIB storage | `test-runner/.../data/storage/GribFileManagerTest.kt` | | Fishing / rig advisor | `android-app/.../ui/fishing/RigAdvisorTest.kt` (2 tests) | | Fishing / mode manager | `android-app/.../ui/fishing/FishingModeManagerTest.kt` (1 test) | +| ATON / layer data | `android-app/.../ui/aton/AtonDataTest.kt` (7 JVM tests: colorFor mappings, parseStation, parseResponse) | --- -- cgit v1.2.3