Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / weather / AGENTS.md

AGENTS.md6.3 KiBRenderedCodeRaw
1# AGENTS.md — weather/ (':weather')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `weather/` + allowed shared modules. Do not root-scan.
4
5_Install: ./install weather (dev by default)._
6<!-- last-reviewed: 2026-10-16 -->
7- Gradle: :weather / dir: weather/
8- Package roots present: ui, data, domain, platform, network, intents, widget
9- Entry files: MainActivity.kt, Route.kt, Navigation.kt
10- Deps: :library:network, :library:widgets, :library:map, :library:room
11- Metadata: metadata_data/weather.md (present)
12- Rust: yes / screenshotTest: yes
13
14## Overview
15**Purpose:** Material You weather — Open-Meteo hourly/daily forecasts, air-quality/UV/pollen/humidity/pressure/wind/visibility blocks, map layers, Glance widgets, assistant intents.
16**Key features:**
17- Saved locations + device location (reverse-geocoded) with Room-cached forecasts refreshed by `WeatherRefreshWorker`
18- Metric blocks + graphs per location; Open-Meteo vector map tiles via the Rust core (`domain/map/OmTilesNative`)
19- Two Glance widgets (standard + blob); `GetWeather`/`GetWeatherByName` assistant intents
20**Architecture / data-flow:** `ui/` home/map/locations → `platform/WeatherViewModel` (+ `WeatherUiContract`) → `data/WeatherRepository` over Room + `network/WeatherApi` DTOs; `domain/` holds pure unit/metric/WMO formatting + map metadata; widgets read the same repository snapshot.
21**Entry points + reading order:** `Route` → `MainActivity.kt` → `Navigation.kt` → `ui/HomePage.kt` → `platform/WeatherViewModel.kt` → `data/WeatherRepository.kt` → `network/WeatherApi.kt`.
22**Gotchas:**
23- Unit system follows the device locale (`platform/SystemUnits`) — format in `domain/`, never in `ui/`
24- Map tiles are native-rendered Open-Meteo domains; tile bugs live in Rust or `domain/map/`, not the Compose layer
25- Widgets must render from cache alone — never network on the widget path
26
27## Key files
28### Root — entry + navigation
29- com/vayunmathur/weather/MainActivity.kt
30- com/vayunmathur/weather/Navigation.kt
31- com/vayunmathur/weather/Route.kt
32### data/ — cache + repository + refresh
33- com/vayunmathur/weather/data/WeatherDatabase.kt
34- com/vayunmathur/weather/data/WeatherRepository.kt
35- com/vayunmathur/weather/data/WeatherDao.kt
36- com/vayunmathur/weather/data/WeatherCache.kt
37- com/vayunmathur/weather/data/WeatherCacheStore.kt
38- com/vayunmathur/weather/data/WeatherRefreshWorker.kt
39- com/vayunmathur/weather/data/SavedLocation.kt
40### domain/ + domain/map/ — pure formatting + map metadata (no Android)
41- com/vayunmathur/weather/domain/WmoCode.kt
42- com/vayunmathur/weather/domain/UnitFormat.kt
43- com/vayunmathur/weather/domain/DateTimeFormat.kt
44- com/vayunmathur/weather/domain/MetricSeries.kt
45- com/vayunmathur/weather/domain/SelectedData.kt
46- com/vayunmathur/weather/domain/SelectedDateOrTime.kt
47- com/vayunmathur/weather/domain/map/OmDomains.kt
48- com/vayunmathur/weather/domain/map/OmMapMetadata.kt
49- com/vayunmathur/weather/domain/map/OmColorize.kt
50- com/vayunmathur/weather/domain/map/OmTilesNative.kt — Rust tile bridge
51### network/ — Open-Meteo DTOs + API
52- com/vayunmathur/weather/network/WeatherApi.kt
53- com/vayunmathur/weather/network/OpenMeteoDto.kt
54- com/vayunmathur/weather/network/GeocodingDto.kt
55- com/vayunmathur/weather/network/AirQualityDto.kt
56### platform/ — ViewModel, location, summaries
57- com/vayunmathur/weather/platform/WeatherViewModel.kt
58- com/vayunmathur/weather/platform/WeatherUiContract.kt
59- com/vayunmathur/weather/platform/LocationProvider.kt
60- com/vayunmathur/weather/platform/ReverseGeocode.kt
61- com/vayunmathur/weather/platform/Summary.kt
62- com/vayunmathur/weather/platform/Precipitation.kt
63- com/vayunmathur/weather/platform/SystemUnits.kt
64- com/vayunmathur/weather/platform/AppBackupAgent.kt
65### intents/ — assistant IPC
66- com/vayunmathur/weather/intents/GetWeatherIntent.kt
67- com/vayunmathur/weather/intents/GetWeatherByNameIntent.kt
68### ui/ + ui/components/ + blocks/ — home, map, locations, metric blocks
69- com/vayunmathur/weather/ui/HomePage.kt
70- com/vayunmathur/weather/ui/ForecastColumn.kt
71- com/vayunmathur/weather/ui/DeviceLocation.kt
72- com/vayunmathur/weather/ui/LocationsScreen.kt
73- com/vayunmathur/weather/ui/SearchLocationPage.kt
74- com/vayunmathur/weather/ui/WeatherMapPage.kt
75- com/vayunmathur/weather/ui/WeatherMapState.kt
76- com/vayunmathur/weather/ui/WeatherMapComponents.kt
77- com/vayunmathur/weather/ui/components/CurrentWeatherCard.kt
78- com/vayunmathur/weather/ui/components/HourlyCard.kt
79- com/vayunmathur/weather/ui/components/DailyCard.kt
80- com/vayunmathur/weather/ui/components/SummaryCard.kt
81- com/vayunmathur/weather/ui/components/WeatherBlocks.kt
82- com/vayunmathur/weather/ui/components/CardsHeader.kt
83- com/vayunmathur/weather/ui/components/SelectedHeader.kt
84- com/vayunmathur/weather/ui/components/MainSearchBar.kt
85- com/vayunmathur/weather/ui/components/LocationItem.kt
86- com/vayunmathur/weather/ui/components/UseDeviceLocationCard.kt
87- com/vayunmathur/weather/ui/components/MetricGraphSheet.kt
88- com/vayunmathur/weather/ui/components/WeatherIconBox.kt
89- com/vayunmathur/weather/ui/components/blocks/StatBlock.kt
90- com/vayunmathur/weather/ui/components/blocks/BlockHeader.kt
91- com/vayunmathur/weather/ui/components/blocks/AirQualityBlock.kt
92- com/vayunmathur/weather/ui/components/blocks/UvIndexBlock.kt
93- com/vayunmathur/weather/ui/components/blocks/PollenBlock.kt
94- com/vayunmathur/weather/ui/components/blocks/HumidityBlock.kt
95- com/vayunmathur/weather/ui/components/blocks/PressureBlock.kt
96- com/vayunmathur/weather/ui/components/blocks/WindBlock.kt
97- com/vayunmathur/weather/ui/components/blocks/VisibilityBlock.kt
98- com/vayunmathur/weather/ui/components/blocks/PrecipitationBlock.kt
99- com/vayunmathur/weather/ui/components/blocks/CloudCoverBlock.kt
100- com/vayunmathur/weather/ui/components/blocks/SunBlock.kt
101- com/vayunmathur/weather/ui/components/blocks/MoonBlock.kt
102### widget/glance/ — Glance widgets (cache-fed only)
103- com/vayunmathur/weather/widget/glance/WeatherGlanceWidget.kt
104- com/vayunmathur/weather/widget/glance/WeatherGlanceWidgetReceiver.kt
105- com/vayunmathur/weather/widget/glance/WeatherBlobGlanceWidget.kt
106- com/vayunmathur/weather/widget/glance/WeatherBlobGlanceWidgetReceiver.kt
107- com/vayunmathur/weather/widget/glance/WidgetWeather.kt — shared widget model
108
109## Verify (this module only)
110```
111./gradlew :weather:compileDevKotlin
112./gradlew :weather:lint
113./gradlew :weather:checkMetadata
114```