ui: the Games page keeps its game while it animates out

It was drawn with the current selection, so leaving it for another rail item turned the
outgoing page into a copy of the new one for a few frames, which then faded out before the
real page rose in: a flash and a dip moving from Games to Steam.
This commit is contained in:
xXJSONDeruloXx committed 2026-10-01 23:47:50 -04:00
1 parent ca4ddd74de
commit 4b223a10ce
1 file changed
+5 -1
@@ -124,6 +124,10 @@ internal fun Pane(
val livePage by rememberUpdatedState(s.pageKey)
// Picking another game changes the detail beside the list, not the whole page.
val target = if (page != null && s.pageKey != null) s.pageKey else if (selected.startsWith("app:")) "games" else selected
// The game the Games page shows. It must outlive the selection: while the page animates out,
// drawing it with what is selected now (another rail item) turned it into a copy of that page.
val gameShown = remember { arrayOf("games") }
if (selected == "games" || selected.startsWith("app:")) gameShown[0] = selected
if (page != null && s.pageKey != null) {
pages[s.pageKey] = page
if (s.pageKey !in origins) PageOrigin.take()?.let { origins[s.pageKey] = it.translate(-paneAt[0]) }
@@ -162,7 +166,7 @@ internal fun Pane(
PageFlood(from, leaving = transition.targetState == EnterExitState.PostExit) { shown() }
}
}
else Content(s, if (key == "games") selected else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, onOpenDeveloperOptions, onRequestWirelessAdb)
else Content(s, if (key == "games") gameShown[0] else key, a, Modifier.fillMaxSize(), onSelect, onAndroidAppClick, onOpenDeveloperOptions, onRequestWirelessAdb)
}
}
}