Back to Provenance

3478

.changelog/3478.md

3.3.12.8 KB
Original Source

Fixed

  • TVMediaMainView scroll performancerefreshFromRealmChanges() now only reloads games for the selected and already-loaded systems (instead of all systems sequentially), reducing Realm queries on each write from O(n) to O(loaded).
  • TVMediaHomeView startup timeloadAllGames() now loads system game lists concurrently (via TaskGroup) instead of one system at a time, speeding up the home shelf render.
  • Search debounceTVMediaSearchView now debounces the search text onChange by 300ms so Realm is not queried on every keystroke.
  • Icon-load scroll stutterTVMediaSystemShelfRow and TVMediaSystemHeader no longer hold a shared @ObservedObject on SystemIconLoader; icon rendering is delegated to a new TVMediaSystemIconView that scopes redraws to the icon only, preventing full-shelf invalidation when unrelated system icons load.
  • Stable view identity in game gridsConsoleGamesView grid and list cells now use "\(id)_\(trueArtworkURL)" as their SwiftUI identity instead of the full model hashValue, so only artwork changes force view recreation rather than every Realm write touching playCount/lastPlayed.
  • ForEach ID stability in recent searchesTVMediaSearchView recent-search chips now use the search string as their ForEach ID instead of array offset, preventing unnecessary redraws on search history reordering.
  • Live Realm fallback removed from hot pathsystemsWithGames computed property no longer calls system.games.count (a live Realm query) as a fallback, using only the pre-loaded snapshot cache instead.
  • Lazy Results in ConsoleGamesViewshowGamesGrid and showGamesList with Results<PVGame> now pass the Realm Results directly to ForEach instead of calling .toArray().filter {} on every render, eliminating full-library array allocation on each scroll frame.
  • GeometryReader removed from CustomPageIndicator — page dot indicator no longer wraps its content in a GeometryReader to measure container width; replaced with .frame(maxWidth: .infinity) centering, removing per-frame layout measurement during paging.
  • Cached footer save-state lookupHomeContinueSection now caches the current PVSaveState in @State and only re-resolves it on page/focus changes, avoiding a live Realm query in every body render.
  • Scroll frame re-renders eliminatedHomeView scroll-offset tracking moved to a reference-type ScrollTracker so that previousOffset mutations no longer trigger HomeView body re-evaluation on every pixel of scroll; isSearchBarVisible is now only written when its value actually changes.
  • discCount cached in GameItemView — multi-disc indicator count is computed once on onAppear instead of calling relatedFiles.toArray() on every body re-render of each visible game cell.