Skip to content

fix(home): preserve profile catalog ordering on progressive mobile loads - #612

Open
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:fix/mobile-home-category-order
Open

fix(home): preserve profile catalog ordering on progressive mobile loads#612
Himanth-reddy wants to merge 1 commit into
ProdigyV21:mainfrom
Himanth-reddy:fix/mobile-home-category-order

Conversation

@Himanth-reddy

Copy link
Copy Markdown
Collaborator

Description

On mobile, loadMobileHomeDataProgressive checked _uiState.value.categories.isEmpty() to decide whether to lay out initial profile skeleton rows. Because preloaded Continue Watching items are inserted into _uiState.value.categories immediately during startup, isEmpty() evaluated to false, bypassing skeleton initialization.

Consequently, when in-memory Collection Rails (Services, Genres, Franchises) resolved in 0ms, updateMobileCategoryRow appended them to the list before slower TMDB/MDBList network responses (Trending Movies/Shows) arrived. This caused Services/Genres/Franchises to jump above Trending rows and get written to the disk cache in that inverted order.

Changes

  • Deterministic Row Ordering: Added orderCategoriesBySavedCatalogs() to ensure home rows strictly match savedCatalogs configuration (with continue_watching prioritized at index 0).
  • Robust Skeleton Setup: Replaced categories.isEmpty() with !hasRealBaseCategories in loadHomeData() and loadMobileHomeDataProgressive(), preserving any preloaded Continue Watching while laying out all other catalog skeletons.
  • Ordered Progressive Updates: Updated updateMobileCategoryRow() on mobile to enforce savedCatalogs order as asynchronous results arrive.
  • Unit Tests: Added HomeMobileCategoryOrderingTest.kt to verify that out-of-order category resolution preserves the configured savedCatalogs order.

Testing

  • Verified with ./gradlew :app:testSideloadDebugUnitTest --tests "com.arflix.tv.ui.screens.home.*".

@github-actions github-actions Bot added the area: android Changes to the Android app or Gradle build label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: android Changes to the Android app or Gradle build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant