From ed01f5885e198dc30ec0acf852347f5f49ea30ed Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Mon, 20 Jul 2026 22:14:15 -0400 Subject: [PATCH] feat(v2): show smart and virtual collections on the home screen Port the v1 home behaviour to the v2 home: smart and virtual (autogenerated) collections can now be surfaced as their own rows, each toggled independently from the regular collections row. - Add `showSmartCollections` UI setting; wire the existing `showVirtualCollections` / `virtualCollectionType` settings into v2. - Fetch smart/virtual collections on the home view only when their toggle is on, so the expensive virtual "all" fetch is skipped when disabled. - Render Smart and Virtual CardRows reusing the CollectionTile pattern. - Move the smart/virtual visibility toggles into the "Home sections" settings group; the "Virtual collections" section keeps only the collection-type selector. - Add `settings.show-smart-collections` (+ desc) to all 18 locales. Closes #3720 Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/composables/useUISettings.ts | 4 + frontend/src/locales/bg_BG/settings.json | 2 + frontend/src/locales/cs_CZ/settings.json | 2 + frontend/src/locales/de_DE/settings.json | 2 + frontend/src/locales/en_GB/settings.json | 2 + frontend/src/locales/en_US/settings.json | 2 + frontend/src/locales/es_ES/settings.json | 2 + frontend/src/locales/fr_FR/settings.json | 2 + frontend/src/locales/hu_HU/settings.json | 2 + frontend/src/locales/it_IT/settings.json | 2 + frontend/src/locales/ja_JP/settings.json | 2 + frontend/src/locales/ko_KR/settings.json | 2 + frontend/src/locales/pl_PL/settings.json | 2 + frontend/src/locales/pt_BR/settings.json | 2 + frontend/src/locales/ro_RO/settings.json | 2 + frontend/src/locales/ru_RU/settings.json | 2 + frontend/src/locales/tr_TR/settings.json | 2 + frontend/src/locales/zh_CN/settings.json | 2 + frontend/src/locales/zh_TW/settings.json | 2 + frontend/src/v2/views/Home.vue | 83 ++++++++++++++++++- .../src/v2/views/Settings/UserInterface.vue | 28 ++++--- 21 files changed, 136 insertions(+), 15 deletions(-) diff --git a/frontend/src/composables/useUISettings.ts b/frontend/src/composables/useUISettings.ts index fd82fdf66..f4b3ad506 100644 --- a/frontend/src/composables/useUISettings.ts +++ b/frontend/src/composables/useUISettings.ts @@ -24,6 +24,10 @@ export const UI_SETTINGS_KEYS = { showContinuePlaying: { key: "settings.showContinuePlaying", default: true }, showPlatforms: { key: "settings.showPlatforms", default: true }, showCollections: { key: "settings.showCollections", default: true }, + showSmartCollections: { + key: "settings.showSmartCollections", + default: true, + }, // Home widget bar (v2 only). `showHomeWidgets` is the master toggle // for the row; per-widget toggles let users disable individual cards diff --git a/frontend/src/locales/bg_BG/settings.json b/frontend/src/locales/bg_BG/settings.json index 5341b8c74..e2f9632e1 100644 --- a/frontend/src/locales/bg_BG/settings.json +++ b/frontend/src/locales/bg_BG/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Показвай флаговете на регионите в галерията", "show-siblings": "Покажи версии", "show-siblings-desc": "Показвай броя на версиите в галерията когато опцията \"Групирай ROM-ове\" е активирана", + "show-smart-collections": "Покажи умни колекции", + "show-smart-collections-desc": "Показвай секцията с умни колекции на началната страница", "show-stats": "Покажи статистики", "show-stats-desc": "Показвай обобщени статистики на началната страница", "show-status": "Покажи статус", diff --git a/frontend/src/locales/cs_CZ/settings.json b/frontend/src/locales/cs_CZ/settings.json index a782c97f8..8f1b61e71 100644 --- a/frontend/src/locales/cs_CZ/settings.json +++ b/frontend/src/locales/cs_CZ/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Zobrazit vlajky regionů v galerii", "show-siblings": "Zobrazit verze", "show-siblings-desc": "Zobrazit počet verzí v galerii, pokud je zapnuto „Seskupit ROMy“", + "show-smart-collections": "Zobrazit chytré kolekce", + "show-smart-collections-desc": "Zobrazit sekci chytrých kolekcí na hlavní stránce", "show-stats": "Zobrazit statistiky", "show-stats-desc": "Zobrazit souhrn statistik na hlavní stránce", "show-status": "Zobrazit status", diff --git a/frontend/src/locales/de_DE/settings.json b/frontend/src/locales/de_DE/settings.json index dfbf83187..57669c310 100644 --- a/frontend/src/locales/de_DE/settings.json +++ b/frontend/src/locales/de_DE/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Zeige die Regionen des ROMs als Flaggen in der Galerie", "show-siblings": "Zeige Versionen", "show-siblings-desc": "Die Anzahl der verschiedenen Versionen einen ROMs wird in der Galerie angezeigt, wenn die \"ROMs gruppieren\" Option aktiviert ist", + "show-smart-collections": "Zeige intelligente Sammlungen", + "show-smart-collections-desc": "Intelligente Sammlungen werden auf der Startseite dargestellt", "show-stats": "Zeige Statistiken", "show-stats-desc": "Zeige Statistiken auf der Startseite an", "show-status": "Zeige Status", diff --git a/frontend/src/locales/en_GB/settings.json b/frontend/src/locales/en_GB/settings.json index 025c6dd56..9c0908d01 100644 --- a/frontend/src/locales/en_GB/settings.json +++ b/frontend/src/locales/en_GB/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Show region flags in the gallery", "show-siblings": "Show versions", "show-siblings-desc": "Show version count in the gallery when \"Group ROMs\" option is enabled", + "show-smart-collections": "Show smart collections", + "show-smart-collections-desc": "Show smart collections section at the home page", "show-stats": "Show stats", "show-stats-desc": "Show stats summary at the home page", "show-status": "Show status", diff --git a/frontend/src/locales/en_US/settings.json b/frontend/src/locales/en_US/settings.json index d90e4b629..50e79b3f9 100644 --- a/frontend/src/locales/en_US/settings.json +++ b/frontend/src/locales/en_US/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Show region flags in the gallery", "show-siblings": "Show versions", "show-siblings-desc": "Show version count in the gallery when \"Group ROMs\" option is enabled", + "show-smart-collections": "Show smart collections", + "show-smart-collections-desc": "Show smart collections section at the home page", "show-stats": "Show stats", "show-stats-desc": "Show stats summary at the home page", "show-status": "Show status", diff --git a/frontend/src/locales/es_ES/settings.json b/frontend/src/locales/es_ES/settings.json index c458f2bbe..ba63810cc 100644 --- a/frontend/src/locales/es_ES/settings.json +++ b/frontend/src/locales/es_ES/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Mostrar banderas de region en la galería", "show-siblings": "Mostrar versiones", "show-siblings-desc": "Mostrar el número de versiones en la galería cuando la opción \"Agrupar ROMs\" está habilitada", + "show-smart-collections": "Mostrar colecciones inteligentes", + "show-smart-collections-desc": "Mostrar la sección de colecciones inteligentes en la página principal", "show-stats": "Mostrar estadísticas", "show-stats-desc": "Mostrar resumen de estadísticas en la página principal", "show-status": "Mostrar estado", diff --git a/frontend/src/locales/fr_FR/settings.json b/frontend/src/locales/fr_FR/settings.json index b2c6e2f87..491e67f78 100644 --- a/frontend/src/locales/fr_FR/settings.json +++ b/frontend/src/locales/fr_FR/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Afficher les drapeaux des régions dans la galerie", "show-siblings": "Afficher les versions", "show-siblings-desc": "Afficher le nombre de versions dans la galerie lorsque l'option \"Grouper les ROMs\" est activée", + "show-smart-collections": "Afficher les collections intelligentes", + "show-smart-collections-desc": "Afficher la section des collections intelligentes sur la page d'accueil", "show-stats": "Afficher les statistiques", "show-stats-desc": "Afficher le résumé des statistiques sur la page d'accueil", "show-status": "Afficher le statut", diff --git a/frontend/src/locales/hu_HU/settings.json b/frontend/src/locales/hu_HU/settings.json index dfdb50b3a..7d2def849 100644 --- a/frontend/src/locales/hu_HU/settings.json +++ b/frontend/src/locales/hu_HU/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Régiózászlók megjelenítése a galériában", "show-siblings": "Verziók megjelenítése", "show-siblings-desc": "A verziók számának megjelenítése a galériában (ROM-ok csoportosítása esetén)", + "show-smart-collections": "Intelligens gyűjtemények megjelenítése", + "show-smart-collections-desc": "Intelligens gyűjtemények szakasz megjelenítése a kezdőlapon", "show-stats": "Statisztikák megjelenítése", "show-stats-desc": "Statisztikai összegzés megjelenítése a kezdőlapon", "show-status": "Állapot megjelenítése", diff --git a/frontend/src/locales/it_IT/settings.json b/frontend/src/locales/it_IT/settings.json index 4377ca1f7..e41fd8d1d 100644 --- a/frontend/src/locales/it_IT/settings.json +++ b/frontend/src/locales/it_IT/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Mostra le bandiere delle regioni nella galleria", "show-siblings": "Mostra versioni", "show-siblings-desc": "Mostra il numero di versioni nella galleria quando l'opzione \"Raggruppa rom\" è attivata", + "show-smart-collections": "Mostra collezioni intelligenti", + "show-smart-collections-desc": "Mostra la sezione delle collezioni intelligenti nella home", "show-stats": "Mostra statistiche", "show-stats-desc": "Mostra il riepilogo delle statistiche nella home", "show-status": "Mostra stato", diff --git a/frontend/src/locales/ja_JP/settings.json b/frontend/src/locales/ja_JP/settings.json index 35efbc7e5..fcc357a22 100644 --- a/frontend/src/locales/ja_JP/settings.json +++ b/frontend/src/locales/ja_JP/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "ギャラリーにリージョンを表示", "show-siblings": "バージョンを表示", "show-siblings-desc": "\"Group ROMs\" オプションが有効な場合、ギャラリーにバージョン数を表示", + "show-smart-collections": "スマートコレクションを表示", + "show-smart-collections-desc": "ホームにスマートコレクションを表示", "show-stats": "統計を表示", "show-stats-desc": "ホームに統計の概要を表示", "show-status": "ステータを表示", diff --git a/frontend/src/locales/ko_KR/settings.json b/frontend/src/locales/ko_KR/settings.json index 5067dfc14..89d8961ed 100644 --- a/frontend/src/locales/ko_KR/settings.json +++ b/frontend/src/locales/ko_KR/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "갤러리에서 지역을 보여줍니다", "show-siblings": "버전 보이기", "show-siblings-desc": "\"롬 묶음\" 옵션이 활성화되었을 때 버전의 개수를 갤러리에서 보여줍니다", + "show-smart-collections": "스마트 모음집 보이기", + "show-smart-collections-desc": "홈페이지에 스마트 모음집 페이지를 보여줍니다", "show-stats": "통계 보이기", "show-stats-desc": "홈페이지에 통계 요약을 보여줍니다", "show-status": "상태 보이기", diff --git a/frontend/src/locales/pl_PL/settings.json b/frontend/src/locales/pl_PL/settings.json index 20e09ff0e..7106bec59 100644 --- a/frontend/src/locales/pl_PL/settings.json +++ b/frontend/src/locales/pl_PL/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Pokaż flagi regionów w galerii", "show-siblings": "Pokaż wersje", "show-siblings-desc": "Pokaż liczbę wersji w galerii, gdy włączona jest opcja „Grupuj ROM-y”", + "show-smart-collections": "Pokaż inteligentne kolekcje", + "show-smart-collections-desc": "Pokaż sekcję inteligentnych kolekcji na stronie głównej", "show-stats": "Pokaż statystyki", "show-stats-desc": "Pokaż podsumowanie statystyk na stronie głównej", "show-status": "Pokaż status", diff --git a/frontend/src/locales/pt_BR/settings.json b/frontend/src/locales/pt_BR/settings.json index 8dc6abb12..8ccc6bc6f 100644 --- a/frontend/src/locales/pt_BR/settings.json +++ b/frontend/src/locales/pt_BR/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Mostrar bandeiras de regiões na galeria", "show-siblings": "Mostrar versões", "show-siblings-desc": "Mostrar contagem de versões na galeria quando a opção \"Agrupar ROMs\" estiver ativada", + "show-smart-collections": "Mostrar coleções inteligentes", + "show-smart-collections-desc": "Mostrar seção de coleções inteligentes na página inicial", "show-stats": "Mostrar estatísticas", "show-stats-desc": "Mostrar resumo de estatísticas na página inicial", "show-status": "Mostrar status", diff --git a/frontend/src/locales/ro_RO/settings.json b/frontend/src/locales/ro_RO/settings.json index 961a071ff..a8e347652 100644 --- a/frontend/src/locales/ro_RO/settings.json +++ b/frontend/src/locales/ro_RO/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Afișează steagurile regiunilor în galerie", "show-siblings": "Afișează versiunile", "show-siblings-desc": "Afișează numărul versiunilor în galerie când opțiunea „Grupare rom-uri” este activată", + "show-smart-collections": "Afișează colecțiile inteligente", + "show-smart-collections-desc": "Afișează secțiunea colecțiilor inteligente pe pagina principală", "show-stats": "Afișează statistici", "show-stats-desc": "Afișează rezumatul statisticilor pe pagina principală", "show-status": "Afișează statusul", diff --git a/frontend/src/locales/ru_RU/settings.json b/frontend/src/locales/ru_RU/settings.json index 124de29fe..150d68cc6 100644 --- a/frontend/src/locales/ru_RU/settings.json +++ b/frontend/src/locales/ru_RU/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Показать флаги регионов в галерее", "show-siblings": "Показать версии", "show-siblings-desc": "Показать количество версий в галерее, когда включена опция \"Группировать ромы\"", + "show-smart-collections": "Показать умные коллекции", + "show-smart-collections-desc": "Показать раздел умных коллекций на главной странице", "show-stats": "Показать статистику", "show-stats-desc": "Показать сводку статистики на главной странице", "show-status": "Показать статус", diff --git a/frontend/src/locales/tr_TR/settings.json b/frontend/src/locales/tr_TR/settings.json index 87509a741..a67f7dc5c 100644 --- a/frontend/src/locales/tr_TR/settings.json +++ b/frontend/src/locales/tr_TR/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "Galeride bölge bayraklarını göster", "show-siblings": "Kardeşleri göster", "show-siblings-desc": "\"ROM'ları Grupla\" seçeneği etkinken galeride kardeş sayısını göster", + "show-smart-collections": "Akıllı koleksiyonları göster", + "show-smart-collections-desc": "Ana sayfada akıllı koleksiyonlar bölümünü göster", "show-stats": "İstatistikleri göster", "show-stats-desc": "Ana sayfada istatistik özetini göster", "show-status": "Durumu göster", diff --git a/frontend/src/locales/zh_CN/settings.json b/frontend/src/locales/zh_CN/settings.json index 05d558d2b..9e63b2798 100644 --- a/frontend/src/locales/zh_CN/settings.json +++ b/frontend/src/locales/zh_CN/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "在游戏库中显示区域标识", "show-siblings": "显示版本", "show-siblings-desc": "在启用\"Rom 文件组\"选项时将会在游戏库中显示已分组 Rom 的版本数量", + "show-smart-collections": "显示智能收藏", + "show-smart-collections-desc": "在主页上显示智能收藏部分", "show-stats": "显示统计信息", "show-stats-desc": "在主页上显示统计信息摘要", "show-status": "显示状态", diff --git a/frontend/src/locales/zh_TW/settings.json b/frontend/src/locales/zh_TW/settings.json index 9a995cbe5..027f0a5fc 100644 --- a/frontend/src/locales/zh_TW/settings.json +++ b/frontend/src/locales/zh_TW/settings.json @@ -407,6 +407,8 @@ "show-regions-desc": "在遊戲庫中顯示地區標示", "show-siblings": "顯示版本", "show-siblings-desc": "啟用\"Rom 版本合併\"選項後,會在遊戲庫中顯示合併同版本 Rom 的數量", + "show-smart-collections": "顯示智能收藏庫", + "show-smart-collections-desc": "在首頁上顯示智能收藏庫部分", "show-stats": "顯示統計訊息", "show-stats-desc": "在首頁上顯示統計摘要", "show-status": "顯示狀態", diff --git a/frontend/src/v2/views/Home.vue b/frontend/src/v2/views/Home.vue index a9d9fda97..671ebadc4 100644 --- a/frontend/src/v2/views/Home.vue +++ b/frontend/src/v2/views/Home.vue @@ -38,12 +38,22 @@ const { showContinuePlaying, showPlatforms, showCollections, + showSmartCollections, + showVirtualCollections, + virtualCollectionType, } = useUISettings(); const { recentRoms, continuePlayingRoms } = storeToRefs(romsStore); const { filledPlatforms, fetchingPlatforms } = storeToRefs(platformsStore); -const { allCollections, favoriteCollection, fetchingCollections } = - storeToRefs(collectionsStore); +const { + allCollections, + smartCollections, + virtualCollections, + favoriteCollection, + fetchingCollections, + fetchingSmartCollections, + fetchingVirtualCollections, +} = storeToRefs(collectionsStore); const fetchingRecent = ref(false); const fetchingContinue = ref(false); @@ -58,6 +68,12 @@ onMounted(() => { if (collectionsStore.allCollections.length === 0) { collectionsStore.fetchCollections(); } + if (showSmartCollections.value && smartCollections.value.length === 0) { + collectionsStore.fetchSmartCollections(); + } + if (showVirtualCollections.value && virtualCollections.value.length === 0) { + collectionsStore.fetchVirtualCollections(virtualCollectionType.value); + } if (recentRoms.value.length === 0) { fetchingRecent.value = true; romsStore.fetchRecentRoms().finally(() => (fetchingRecent.value = false)); @@ -77,12 +93,16 @@ const isEmpty = computed( () => !fetchingPlatforms.value && !fetchingCollections.value && + !fetchingSmartCollections.value && + !fetchingVirtualCollections.value && !fetchingRecent.value && !fetchingContinue.value && recentRoms.value.length === 0 && continuePlayingRoms.value.length === 0 && filledPlatforms.value.length === 0 && - allCollections.value.length === 0, + allCollections.value.length === 0 && + smartCollections.value.length === 0 && + virtualCollections.value.length === 0, ); // Filesystem snapshot for the empty state — shows the user what RomM @@ -380,6 +400,63 @@ function collectionCovers(c: { variant="row" /> + + + + + + + + + + + + diff --git a/frontend/src/v2/views/Settings/UserInterface.vue b/frontend/src/v2/views/Settings/UserInterface.vue index da16faada..9a712ccbf 100644 --- a/frontend/src/v2/views/Settings/UserInterface.vue +++ b/frontend/src/v2/views/Settings/UserInterface.vue @@ -40,6 +40,9 @@ const { showContinuePlaying, showPlatforms, showCollections, + showSmartCollections, + showVirtualCollections, + virtualCollectionType, // Home widgets (v2 only) showHomeWidgets, widgetRandomPick, @@ -54,9 +57,6 @@ const { disableAnimations, enableExperimentalCache, boxartStyle, - // Virtual collections - showVirtualCollections, - virtualCollectionType, } = useUISettings(); type Theme = "dark" | "light" | "auto"; @@ -227,6 +227,16 @@ function onVirtualCollectionTypeChange(value: unknown) { :title="t('settings.show-collections')" :description="t('settings.show-collections-desc')" /> + + @@ -331,19 +341,13 @@ function onVirtualCollectionTypeChange(value: unknown) { - + -
- -
-
+