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) <noreply@anthropic.com>
This commit is contained in:
Georges-Antoine Assi
2026-07-20 22:14:15 -04:00
parent f5fee69f1a
commit ed01f5885e
21 changed files with 136 additions and 15 deletions

View File

@@ -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

View File

@@ -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": "Покажи статус",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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": "ステータを表示",

View File

@@ -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": "상태 보이기",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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": "Показать статус",

View File

@@ -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",

View File

@@ -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": "显示状态",

View File

@@ -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": "顯示狀態",

View File

@@ -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"
/>
</CardRow>
<!-- Smart collections -->
<CardRow
v-if="
showSmartCollections &&
(smartCollections.length || fetchingSmartCollections)
"
:title="t('common.smart-collections')"
:count="smartCollections.length"
gap="16px"
>
<template #icon>
<RIcon icon="mdi-flash" size="20" />
</template>
<CollectionTile
v-for="(c, i) in smartCollections"
:id="c.id"
:key="`smart-${c.id}`"
class="r-v2-card-fade"
:style="{ '--card-fade-i': i }"
:to="`/collection/smart/${c.id}`"
:name="c.name"
:rom-count="c.rom_count"
:covers="collectionCovers(c)"
kind="smart"
:is-public="c.is_public ?? false"
variant="row"
/>
</CardRow>
<!-- Virtual (autogenerated) collections -->
<CardRow
v-if="
showVirtualCollections &&
(virtualCollections.length || fetchingVirtualCollections)
"
:title="t('common.virtual-collections')"
:count="virtualCollections.length"
gap="16px"
>
<template #icon>
<RIcon icon="mdi-bookmark-box" size="20" />
</template>
<CollectionTile
v-for="(c, i) in virtualCollections"
:id="c.id"
:key="`virtual-${c.id}`"
class="r-v2-card-fade"
:style="{ '--card-fade-i': i }"
:to="`/collection/virtual/${c.id}`"
:name="c.name"
:rom-count="c.rom_count"
:covers="collectionCovers(c)"
kind="virtual"
variant="row"
/>
</CardRow>
</template>
</div>
</template>

View File

@@ -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')"
/>
<SettingsToggleRow
v-model="showSmartCollections"
:title="t('settings.show-smart-collections')"
:description="t('settings.show-smart-collections-desc')"
/>
<SettingsToggleRow
v-model="showVirtualCollections"
:title="t('settings.show-virtual-collections')"
:description="t('settings.show-virtual-collections-desc')"
/>
</div>
</SettingsSubsection>
@@ -331,19 +341,13 @@ function onVirtualCollectionTypeChange(value: unknown) {
</div>
</SettingsSection>
<!-- Virtual collections -->
<!-- Virtual collections — only the type selector lives here; the
visibility toggle sits with the other Home sections above. -->
<SettingsSection
:title="t('common.virtual-collections')"
icon="mdi-bookmark-box-multiple"
>
<div class="r-v2-ui__toggle-grid r-v2-ui__toggle-grid--single">
<SettingsToggleRow
v-model="showVirtualCollections"
:title="t('settings.show-virtual-collections')"
:description="t('settings.show-virtual-collections-desc')"
/>
</div>
<div class="r-v2-ui__field r-v2-ui__field--bordered">
<div class="r-v2-ui__field">
<RSelect
:model-value="virtualCollectionType"
:items="virtualCollectionTypeItems"