From ffb5797116906998db417a09b5ece0780c76bb47 Mon Sep 17 00:00:00 2001 From: DynamycSound Date: Sun, 7 Jun 2026 22:57:55 +0000 Subject: [PATCH] fix(collections): preserve catalog genre filter on View All The genre filter applied to a collection folder catalog was dropped when opening View All. FolderDetailRepository.getCatalogSectionsForRows() built HomeCatalogSection without carrying the tab's genre, and onCatalogClick did not forward it to CatalogRoute, so the full-catalog screen loaded unfiltered. Add a genre field to HomeCatalogSection, pass tab.genre when mapping folder tabs to sections, and forward section.genre into CatalogRoute so the selected genre filter is preserved through View All. Fixes #1264 --- composeApp/src/commonMain/kotlin/com/nuvio/app/App.kt | 1 + .../com/nuvio/app/features/collection/FolderDetailRepository.kt | 1 + .../commonMain/kotlin/com/nuvio/app/features/home/HomeModels.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/App.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/App.kt index d6db9960..835716cf 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/App.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/App.kt @@ -1191,6 +1191,7 @@ private fun MainAppContent( type = section.type, catalogId = section.catalogId, supportsPagination = section.supportsPagination, + genre = section.genre, ), ) } diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/FolderDetailRepository.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/FolderDetailRepository.kt index d4e6d9ef..77704a7e 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/FolderDetailRepository.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/collection/FolderDetailRepository.kt @@ -421,6 +421,7 @@ object FolderDetailRepository { items = tab.items, availableItemCount = tab.items.size, supportsPagination = tab.supportsPagination, + genre = tab.genre, ) } } diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/HomeModels.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/HomeModels.kt index dbf8b793..0b4b7404 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/HomeModels.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/HomeModels.kt @@ -39,6 +39,7 @@ data class HomeCatalogSection( val items: List, val availableItemCount: Int = items.size, val supportsPagination: Boolean = false, + val genre: String? = null, ) fun HomeCatalogSection.canOpenCatalog(previewLimit: Int): Boolean =