weather: full-screen destinations on wide screens, drop list-pane metadata (#887)
- Commit
d61207873c2bffa986ba6ad3272d8d8eff0d0365- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-05 18:38 UTC (1 month ago)
- Parents
0d7737c
The wide-screen forecast squeezed into a narrow pane beside an empty void. Both destinations carried ListPage() metadata, so the shared list-detail scene strategy treated Home as a list pane on windows >= 600dp wide and reserved the detail pane for a detail destination that never arrives -- the same shape as the web #864 report, where the browser had been marked a list pane "to keep it visible beside History" with identical results. Weather was never a list-detail flow: Home is a single scrolling forecast and the map is a pushed page, not its detail. Drop the list-detail metadata from both entries so every destination is a full-screen push, mirroring the web fix. The permanent locations side panel inside HomeScreen (gated on isExpandedWidth, >= 840dp) is untouched and keeps providing the genuine wide layout -- medium windows (600-840dp, landscape phones, small tablets) now get the full-width forecast instead of a squeezed column. User-visible effect: landscape phones and tablets show the full-width forecast; the map page fills the window. Verification: ./gradlew :weather:compileDevKotlin BUILD SUCCESSFUL.
Diff
weather/src/main/java/com/vayunmathur/weather/Navigation.kt
diff --git a/weather/src/main/java/com/vayunmathur/weather/Navigation.kt b/weather/src/main/java/com/vayunmathur/weather/Navigation.ktindex fc7227f7f6..4da53fff63 100644--- a/weather/src/main/java/com/vayunmathur/weather/Navigation.kt+++ b/weather/src/main/java/com/vayunmathur/weather/Navigation.kt@@ -2,7 +2,6 @@ package com.vayunmathur.weather import androidx.compose.runtime.Composable import com.vayunmathur.library.util.DialogPage-import com.vayunmathur.library.util.ListPage import com.vayunmathur.library.util.MainNavigation import com.vayunmathur.library.util.rememberNavBackStack import com.vayunmathur.weather.platform.WeatherViewModel@@ -13,10 +12,14 @@ import com.vayunmathur.weather.ui.WeatherMapPage @Composable fun Navigation(viewModel: WeatherViewModel) { val backStack = rememberNavBackStack<Route>(Route.Home)+ // No list-detail metadata: Home is not a list and the map is not its+ // detail, so every destination is a full-screen push. Marking both as+ // list panes squeezed the forecast into a narrow pane beside an empty+ // void on wide windows (same shape as web #864). MainNavigation(backStack) {- entry<Route.Home>(metadata = ListPage()) { HomePage(backStack, viewModel) }+ entry<Route.Home> { HomePage(backStack, viewModel) } entry<Route.SearchLocation>(metadata = DialogPage()) { SearchLocationPage(backStack, viewModel) }- entry<Route.WeatherMap>(metadata = ListPage()) {+ entry<Route.WeatherMap> { WeatherMapPage(backStack, it.latitude, it.longitude, it.isoTime, it.metric) } }