frontend: draw the Steam wall on the first frame and keep it still

The wall waited about a second and a half for the game list on every start: Steam's own
manifests are quick, but the added games' folder walk and art lookups are not. The last list
is now kept in the app's files (LibraryCache) and shown before the first frame, and the fresh
one replaces it in a single update. The wall's order is fixed (last played, then game ID), so
the same games always land in the same capsules and the refresh moves nothing. The added-games
scan on every resume also leaves the main thread, which it stalled for most of a second.
This commit is contained in:
xXJSONDeruloXx committed 2026-10-02 00:12:41 -04:00
1 parent aca6eae55c
commit 1f8da82c19
3 files changed
+65 -4

No files matched your search

@@ -59,7 +59,9 @@ private const val WALL_MIN_GAMES = 4
*/
@Composable
internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier) {
val games = remember(s.steamGames) { s.steamGames.sortedByDescending { it.lastPlayed } }
// A fixed order, ties included: the wall places each game by its position, so an order that
// came out differently from one read of the library to the next moved every capsule.
val games = remember(s.steamGames) { s.steamGames.sortedWith(compareByDescending<Library.SteamGame> { it.lastPlayed }.thenBy { it.gameId }) }
val narrow = LocalNarrowPane.current
val colors = MaterialTheme.colorScheme
val pal = LocalPalette.current