diff --git a/lib/screens/home_tab.dart b/lib/screens/home_tab.dart index e50fe60b..e34a8ecf 100644 --- a/lib/screens/home_tab.dart +++ b/lib/screens/home_tab.dart @@ -361,6 +361,14 @@ class _HomeTabState extends ConsumerState } void _onTrackStateChanged(TrackState? previous, TrackState next) { + if (!identical(previous?.tracks, next.tracks)) { + // Home stays alive across tabs. Empty/loading/error branches can skip + // result building, so release the previous search's derived lists here. + _searchBucketsSourceTracks = null; + _searchBucketsCache = null; + _invalidateSearchSortCaches(); + _historySnapshot.update(const []); + } if (previous != null && !next.hasContent && !next.hasSearchText &&