Repository navigation
Description
Report
Select MOVIES/SERIES on browse, SORT by anything > SELECT title to view info > hit back and SORT goes back to default so have to start from scratch.
Reproduced on both clients, from two independent causes. Filters survive in both cases; only the sort is lost, which is what makes it read as "start from scratch".
Android TV — sort lost on Back from item detail
- Movies → cascade → Browse
- Sort → Year (grid reorders, chip reads
Sort · Year Newest) - Open any title → Back
- Grid is back in Title A–Z and the chip reads
Sort · Title A–Z
Focus restoration works (Back lands on the card you opened), which makes the reset look like a reload rather than a lost setting.
Cause. The TvLibraryDetailViewModel survives the Back — verified with a temporary log, same instance either side. But TvLibraryDetailScreen re-issues the committed cascade section every time it re-enters composition:
LaunchedEffect(sectionRequestNonce, initialSection) { initialSection?.let(viewModel::onTabSelected) }onTabSelected guarded with if (state.selectedTab == tab && !filterChanged) return. On re-entry the tab is unchanged but filterChanged is true precisely because the viewer customised the sort, so the guard falls through and forTab(Browse) stomps sort and facets back to Title A–Z. The log line on return:
onTabSelected tab=Browse current=Browse filter=year/desc
Android phone — sort lost on relaunch
- Libraries → Movies → Library subtab
- Sort → Title, and apply any filter (e.g. Unwatched)
- Force-stop and relaunch → Library subtab
- The Unwatched chip is restored; the sort is back to Recently Added
Cause. LibrariesViewModel keeps the sort in LibrariesUiState.browseSort, outside the CatalogFilterState that BrowsePrefsStore persists. selectBrowseSort never saves, and every restore path (refresh, selectLibrary) restores the filter state but lets browseSort fall back to RecentlyAdded. The persisted JSON showed the facets and no sort:
{"selections":{"WatchStatus":["unwatched"]}}This contradicts the store's own doc ("Persists browse filter + sort state") and the user-facing toggle named "Preserve sort & filters". The standalone BrowseViewModel already persists sort inside filterState; the Libraries browse grid diverged.
Expected
- Returning from item detail leaves the sort exactly as the viewer set it.
- With "Preserve sort & filters" on, the sort is restored alongside the filters.
Activity