From 123a397c8a92ae526719dbc2ae728e476469a1f4 Mon Sep 17 00:00:00 2001 From: zurdi Date: Mon, 25 May 2026 12:32:12 +0000 Subject: [PATCH] feat(scan): enhance ROM scanning interface with virtual scrolling and improved metadata selection - Refactor ScanPlatform.vue to always use RVirtualScroller for listing ROMs, improving performance and layout consistency. - Introduce a maximum viewport height for the virtual scroller to prevent excessive DOM growth. - Update ScanPlatformRow.vue to make each ROM row a clickable router link, enhancing navigation to ROM details. - Add a synthetic "All" option in RSelect for metadata sources, allowing users to toggle all items in multi-select mode. - Split metadata providers into general and specific categories for clearer organization in the Scan view. - Improve styling and layout of the scan configuration card for better user experience. --- backend/handler/database/roms_handler.py | 4 + backend/models/rom.py | 53 +- frontend/src/locales/en_US/scan.json | 9 +- frontend/src/locales/en_US/setup.json | 25 +- .../v2/components/Auth/SetupStepMetadata.vue | 102 +++- .../src/v2/components/Scan/ScanInfoDialog.vue | 196 ++++--- .../src/v2/components/Scan/ScanPlatform.vue | 78 +-- .../v2/components/Scan/ScanPlatformRow.vue | 20 +- frontend/src/v2/lib/forms/RSelect/RSelect.vue | 259 ++++++++- frontend/src/v2/views/Scan.vue | 534 ++++++++++++------ 10 files changed, 962 insertions(+), 318 deletions(-) diff --git a/backend/handler/database/roms_handler.py b/backend/handler/database/roms_handler.py index 4e95bd14c..861e00078 100644 --- a/backend/handler/database/roms_handler.py +++ b/backend/handler/database/roms_handler.py @@ -150,6 +150,8 @@ def with_details(func): selectinload(Rom.notes), undefer(Rom.multi_file), undefer(Rom.top_level_file_count), + undefer(Rom.has_manual_files), + undefer(Rom.has_soundtrack), ) return func(*args, **kwargs) @@ -575,6 +577,8 @@ class DBRomsHandler(DBBaseHandler): query = query.options( undefer(Rom.multi_file), undefer(Rom.top_level_file_count), + undefer(Rom.has_manual_files), + undefer(Rom.has_soundtrack), ) # Handle platform filtering - platform filtering always uses OR logic since ROMs belong to only one platform diff --git a/backend/models/rom.py b/backend/models/rom.py index b3f30b9f0..d046caa2e 100644 --- a/backend/models/rom.py +++ b/backend/models/rom.py @@ -21,7 +21,13 @@ from sqlalchemy import ( or_, select, ) -from sqlalchemy.orm import Mapped, column_property, mapped_column, relationship +from sqlalchemy.orm import ( + Mapped, + column_property, + declared_attr, + mapped_column, + relationship, +) from config import FRONTEND_RESOURCES_PATH from models.base import ( @@ -316,13 +322,46 @@ class Rom(BaseModel): def has_manual(self) -> bool: return bool(self.path_manual) - @cached_property - def has_manual_files(self) -> bool: - return any(f.category == RomFileCategory.MANUAL for f in self.files) + # `has_manual_files` and `has_soundtrack` come from correlated + # `EXISTS` subqueries against rom_files filtered by category. + # `@declared_attr` lets us define the column_property inside the + # class while still referencing `cls.id` (resolved after the + # mapping is built). Deferred + opt-in via `undefer` from the + # gallery query so we don't force a `Rom.files` load (the + # relationship is `lazy="raise"` for that endpoint). + @declared_attr + def has_manual_files(cls) -> Mapped[bool]: + return column_property( + select(RomFile.id) + .where( + and_( + RomFile.rom_id == cls.id, + RomFile.category == RomFileCategory.MANUAL, + ) + ) + .correlate_except(RomFile) + .exists() + .select() + .scalar_subquery(), + deferred=True, + ) - @cached_property - def has_soundtrack(self) -> bool: - return any(f.category == RomFileCategory.SOUNDTRACK for f in self.files) + @declared_attr + def has_soundtrack(cls) -> Mapped[bool]: + return column_property( + select(RomFile.id) + .where( + and_( + RomFile.rom_id == cls.id, + RomFile.category == RomFileCategory.SOUNDTRACK, + ) + ) + .correlate_except(RomFile) + .exists() + .select() + .scalar_subquery(), + deferred=True, + ) @cached_property def merged_screenshots(self) -> list[str]: diff --git a/frontend/src/locales/en_US/scan.json b/frontend/src/locales/en_US/scan.json index e70a1d600..07ce52b76 100644 --- a/frontend/src/locales/en_US/scan.json +++ b/frontend/src/locales/en_US/scan.json @@ -42,5 +42,12 @@ "unmatched-games": "Unmatched games", "unmatched-games-desc": "Scan games with missing metadata matches", "update-metadata": "Update metadata", - "update-metadata-desc": "Update metadata for matched games" + "update-metadata-desc": "Update metadata for matched games", + "section-platforms": "Platforms", + "section-metadata": "Metadata", + "section-providers": "Providers", + "section-providers-general": "General", + "section-providers-specific": "Specific", + "section-proxies": "Proxies", + "section-scan-type": "Scan type" } diff --git a/frontend/src/locales/en_US/setup.json b/frontend/src/locales/en_US/setup.json index 7bf00199d..a45753cf0 100644 --- a/frontend/src/locales/en_US/setup.json +++ b/frontend/src/locales/en_US/setup.json @@ -69,13 +69,30 @@ "metadata-proxies": "Match proxies", "metadata-proxies-hint": "Community-hosted matchers that improve hits using file hashes.", "provider-igdb-desc": "Titles, descriptions, cover art, screenshots, and related-game data.", - "provider-moby-desc": "Catalogue, alternate cover art, and screenshots. The API is a paid feature.", + "provider-igdb-setup": "Requires a Twitch account with phone 2FA. Set IGDB_CLIENT_ID and IGDB_CLIENT_SECRET.", + "provider-moby-desc": "Catalogue, alternate cover art, and screenshots.", + "provider-moby-setup": "Requires a MobyGames account. Set MOBYGAMES_API_KEY.", + "provider-moby-caveat": "The API is a paid feature.", "provider-ss-desc": "Cover art across regions, manuals, 3D boxes, and CD/cartridge art.", - "provider-ra-desc": "Achievement progress and unlock data per user. Requires file hashes.", - "provider-launchbox-desc": "Community metadata, cover art, and screenshots. Matches by exact filename.", + "provider-ss-setup": "Requires a ScreenScraper account. Set SCREENSCRAPER_USER and SCREENSCRAPER_PASSWORD.", + "provider-ra-desc": "Achievement progress and unlock data per user.", + "provider-ra-setup": "Requires a RetroAchievements account. Set RETROACHIEVEMENTS_API_KEY.", + "provider-ra-caveat": "Requires file hashes. Enable hash calculation in the scan.", + "provider-launchbox-desc": "Community metadata, cover art, and screenshots.", + "provider-launchbox-setup": "Set LAUNCHBOX_API_ENABLED=true and ENABLE_SCHEDULED_UPDATE_LAUNCHBOX_METADATA=true.", + "provider-launchbox-caveat": "Matches by exact filename; requires the local XML index.", "provider-flashpoint-desc": "Metadata for 180,000+ Flash and browser-based games.", + "provider-flashpoint-setup": "Set FLASHPOINT_API_ENABLED=true.", "provider-hltb-desc": "Completion-time estimates for 84,000+ games.", + "provider-hltb-setup": "Set HLTB_API_ENABLED=true.", + "provider-hltb-caveat": "Surfaces in the overview tab of the game details page.", "provider-sgdb-desc": "Alternative cover art, banners, logos, and heroes for any game.", + "provider-sgdb-setup": "Requires a SteamGridDB account. Set STEAMGRIDDB_API_KEY.", + "provider-sgdb-caveat": "Also reachable via the manual \"search cover\" action in the edit-game menu.", "proxy-hasheous-desc": "Hash-based matcher that proxies IGDB data and supplies RetroAchievements IDs.", - "proxy-playmatch-desc": "Hash-based matcher paired with IGDB. Community-hosted service." + "proxy-hasheous-setup": "Set HASHEOUS_API_ENABLED=true.", + "proxy-hasheous-caveat": "Community-hosted service. Requires file hashes. Enable hash calculation in the config (on by default).", + "proxy-playmatch-desc": "Hash-based matcher paired with IGDB.", + "proxy-playmatch-setup": "Set PLAYMATCH_API_ENABLED=true.", + "proxy-playmatch-caveat": "Community-hosted service." } diff --git a/frontend/src/v2/components/Auth/SetupStepMetadata.vue b/frontend/src/v2/components/Auth/SetupStepMetadata.vue index 019c5be96..2983fcb40 100644 --- a/frontend/src/v2/components/Auth/SetupStepMetadata.vue +++ b/frontend/src/v2/components/Auth/SetupStepMetadata.vue @@ -13,7 +13,7 @@ // whether the configured key actually works // The combined status pill maps these to one of: disabled, missing / // invalid key, checking, available. -import { RImg, RTag } from "@v2/lib"; +import { RIcon, RImg, RTag } from "@v2/lib"; import { computed, onMounted, ref } from "vue"; import { useI18n } from "vue-i18n"; import storeHeartbeat from "@/stores/heartbeat"; @@ -32,6 +32,12 @@ interface Source { name: string; logoPath: string; descKey: string; + /** Locale key for the env-var / config instructions. Shared with + * the Scan view's info dialog so both surfaces show the same + * setup hint per provider. */ + setupKey: string; + /** Optional locale key for a warning / caveat pill. Shared too. */ + caveatKey?: string; disabled: boolean; } @@ -45,6 +51,7 @@ const catalogs = computed(() => { name: "IGDB", logoPath: "/assets/scrappers/igdb.png", descKey: "setup.provider-igdb-desc", + setupKey: "setup.provider-igdb-setup", disabled: !m.IGDB_API_ENABLED, }, { @@ -52,6 +59,7 @@ const catalogs = computed(() => { name: "ScreenScraper", logoPath: "/assets/scrappers/ss.png", descKey: "setup.provider-ss-desc", + setupKey: "setup.provider-ss-setup", disabled: !m.SS_API_ENABLED, }, { @@ -59,6 +67,8 @@ const catalogs = computed(() => { name: "MobyGames", logoPath: "/assets/scrappers/moby.png", descKey: "setup.provider-moby-desc", + setupKey: "setup.provider-moby-setup", + caveatKey: "setup.provider-moby-caveat", disabled: !m.MOBY_API_ENABLED, }, { @@ -66,6 +76,8 @@ const catalogs = computed(() => { name: "LaunchBox", logoPath: "/assets/scrappers/launchbox.png", descKey: "setup.provider-launchbox-desc", + setupKey: "setup.provider-launchbox-setup", + caveatKey: "setup.provider-launchbox-caveat", disabled: !m.LAUNCHBOX_API_ENABLED, }, { @@ -73,6 +85,7 @@ const catalogs = computed(() => { name: "Flashpoint", logoPath: "/assets/scrappers/flashpoint.png", descKey: "setup.provider-flashpoint-desc", + setupKey: "setup.provider-flashpoint-setup", disabled: !m.FLASHPOINT_API_ENABLED, }, ]; @@ -86,6 +99,8 @@ const specialised = computed(() => { name: "RetroAchievements", logoPath: "/assets/scrappers/ra.png", descKey: "setup.provider-ra-desc", + setupKey: "setup.provider-ra-setup", + caveatKey: "setup.provider-ra-caveat", disabled: !m.RA_API_ENABLED, }, { @@ -93,6 +108,8 @@ const specialised = computed(() => { name: "SteamGridDB", logoPath: "/assets/scrappers/sgdb.png", descKey: "setup.provider-sgdb-desc", + setupKey: "setup.provider-sgdb-setup", + caveatKey: "setup.provider-sgdb-caveat", disabled: !m.STEAMGRIDDB_API_ENABLED, }, { @@ -100,6 +117,8 @@ const specialised = computed(() => { name: "HowLongToBeat", logoPath: "/assets/scrappers/hltb.png", descKey: "setup.provider-hltb-desc", + setupKey: "setup.provider-hltb-setup", + caveatKey: "setup.provider-hltb-caveat", disabled: !m.HLTB_API_ENABLED, }, ]; @@ -113,6 +132,8 @@ const proxies = computed(() => { name: "Hasheous", logoPath: "/assets/scrappers/hasheous.png", descKey: "setup.proxy-hasheous-desc", + setupKey: "setup.proxy-hasheous-setup", + caveatKey: "setup.proxy-hasheous-caveat", disabled: !m.HASHEOUS_API_ENABLED, }, { @@ -120,6 +141,8 @@ const proxies = computed(() => { name: "PlayMatch", logoPath: "/assets/scrappers/playmatch.png", descKey: "setup.proxy-playmatch-desc", + setupKey: "setup.proxy-playmatch-setup", + caveatKey: "setup.proxy-playmatch-caveat", disabled: !m.PLAYMATCH_API_ENABLED, }, ]; @@ -224,6 +247,19 @@ onMounted(() => { + { + { + { color: var(--r-color-fg-muted); line-height: var(--r-line-height-normal); } + +/* Setup / caveat pills — same vocabulary as the Scan view's info + dialog (the source-of-truth locale keys live in `setup.*`, used + by both surfaces). Wrap so dense env-var instructions can flow + onto a second line on narrow viewports. */ +.r-setup-metadata__item-meta { + display: flex; + flex-wrap: wrap; + gap: var(--r-space-1); + margin-top: var(--r-space-1); +} +.r-setup-metadata__pill { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 3px 8px; + border-radius: var(--r-radius-sm); + background: var(--r-color-surface); + border: 1px solid var(--r-color-border); + font-size: var(--r-font-size-xs); + color: var(--r-color-fg-muted); + font-family: + var(--r-font-family-mono, ui-monospace), SFMono-Regular, monospace; +} +.r-setup-metadata__pill--warn { + background: color-mix( + in srgb, + var(--r-color-status-base-warning) 14%, + transparent + ); + border-color: color-mix( + in srgb, + var(--r-color-status-base-warning) 36%, + transparent + ); + color: var(--r-color-warning); + font-family: inherit; +} diff --git a/frontend/src/v2/components/Scan/ScanInfoDialog.vue b/frontend/src/v2/components/Scan/ScanInfoDialog.vue index 6c8c5ed3e..a165b9372 100644 --- a/frontend/src/v2/components/Scan/ScanInfoDialog.vue +++ b/frontend/src/v2/components/Scan/ScanInfoDialog.vue @@ -100,88 +100,89 @@ interface ProviderRow { /** Logo path under /assets/scrappers/. Matches the same scheme the * heartbeat store uses so consumers and reference share assets. */ logo: string; - desc: string; - setup: string; - caveat?: string; + /** Locale key for the description. Shared with the setup wizard's + * Step 3 so both views show the exact same text. */ + descKey: string; + /** Locale key for the "how to configure" / env-var hint. */ + setupKey: string; + /** Locale key for the optional warning / caveat pill. */ + caveatKey?: string; } const LOGO_BASE = "/assets/scrappers"; -// Static reference set — kept in sync with docs.romm.app's metadata -// providers page. Not derived from the heartbeat store because users -// often need to look up a provider *before* they've configured it -// (e.g., "what API key do I need?"). -// -// Split into two groups to mirror the wizard's setup step: -// * providers — first-party services queried directly with your key. -// * proxies — community-hosted hash matchers that piggy-back on -// the providers to boost hit rates. -const providers: ProviderRow[] = [ +// Static reference set — every text string lives under the wizard's +// `setup.*` locale namespace so the Setup Wizard's Step 3 and this +// dialog never drift. Split into three groups, also mirroring the +// wizard: +// * generalProviders — full-record catalogs (IGDB, MobyGames, …) +// * specificProviders — single-dimension sources (achievements, +// cover art, completion times) +// * proxies — community hash matchers +const generalProviders: ProviderRow[] = [ { id: "igdb", name: "IGDB", logo: `${LOGO_BASE}/igdb.png`, - desc: "Titles, descriptions, cover art, screenshots, and related-game data.", - setup: - "Requires a Twitch account with phone 2FA. Set IGDB_CLIENT_ID and IGDB_CLIENT_SECRET.", + descKey: "setup.provider-igdb-desc", + setupKey: "setup.provider-igdb-setup", }, { id: "ss", name: "ScreenScraper", logo: `${LOGO_BASE}/ss.png`, - desc: "Cover art across regions, manuals, 3D boxes, and CD/cartridge art.", - setup: - "Requires a ScreenScraper account. Set SCREENSCRAPER_USER and SCREENSCRAPER_PASSWORD.", + descKey: "setup.provider-ss-desc", + setupKey: "setup.provider-ss-setup", }, { id: "moby", name: "MobyGames", logo: `${LOGO_BASE}/moby.png`, - desc: "Catalogue, alternate cover art, and screenshots.", - setup: "Requires a MobyGames account. Set MOBYGAMES_API_KEY.", - caveat: "The API is a paid feature.", + descKey: "setup.provider-moby-desc", + setupKey: "setup.provider-moby-setup", + caveatKey: "setup.provider-moby-caveat", }, { id: "launchbox", name: "LaunchBox", logo: `${LOGO_BASE}/launchbox.png`, - desc: "Community metadata, cover art, and screenshots.", - setup: - "Set LAUNCHBOX_API_ENABLED=true and ENABLE_SCHEDULED_UPDATE_LAUNCHBOX_METADATA=true.", - caveat: "Matches by exact filename; requires the local XML index.", - }, - { - id: "ra", - name: "RetroAchievements", - logo: `${LOGO_BASE}/ra.png`, - desc: "Achievement progress and unlock data per user.", - setup: - "Requires a RetroAchievements account. Set RETROACHIEVEMENTS_API_KEY.", - caveat: "Requires file hashes — enable hash calculation in the scan.", - }, - { - id: "sgdb", - name: "SteamGridDB", - logo: `${LOGO_BASE}/sgdb.png`, - desc: "Alternative cover art, banners, logos, and heroes for any game.", - setup: "Requires a SteamGridDB account. Set STEAMGRIDDB_API_KEY.", - caveat: - 'Also reachable via the manual "search cover" action in the edit-game menu.', + descKey: "setup.provider-launchbox-desc", + setupKey: "setup.provider-launchbox-setup", + caveatKey: "setup.provider-launchbox-caveat", }, { id: "flashpoint", name: "Flashpoint", logo: `${LOGO_BASE}/flashpoint.png`, - desc: "Metadata for 180,000+ Flash and browser-based games.", - setup: "Set FLASHPOINT_API_ENABLED=true.", + descKey: "setup.provider-flashpoint-desc", + setupKey: "setup.provider-flashpoint-setup", + }, +]; + +const specificProviders: ProviderRow[] = [ + { + id: "ra", + name: "RetroAchievements", + logo: `${LOGO_BASE}/ra.png`, + descKey: "setup.provider-ra-desc", + setupKey: "setup.provider-ra-setup", + caveatKey: "setup.provider-ra-caveat", + }, + { + id: "sgdb", + name: "SteamGridDB", + logo: `${LOGO_BASE}/sgdb.png`, + descKey: "setup.provider-sgdb-desc", + setupKey: "setup.provider-sgdb-setup", + caveatKey: "setup.provider-sgdb-caveat", }, { id: "hltb", name: "How Long To Beat", logo: `${LOGO_BASE}/hltb.png`, - desc: "Completion-time estimates for 84,000+ games.", - setup: "Set HLTB_API_ENABLED=true.", - caveat: "Surfaces in the overview tab of the game details page.", + descKey: "setup.provider-hltb-desc", + setupKey: "setup.provider-hltb-setup", + caveatKey: "setup.provider-hltb-caveat", }, ]; @@ -190,18 +191,17 @@ const proxies: ProviderRow[] = [ id: "hasheous", name: "Hasheous", logo: `${LOGO_BASE}/hasheous.png`, - desc: "Hash-based matcher that proxies IGDB data and supplies RetroAchievements IDs.", - setup: "Set HASHEOUS_API_ENABLED=true.", - caveat: - "Community-hosted service. Requires file hashes — enable hash calculation in the config (on by default).", + descKey: "setup.proxy-hasheous-desc", + setupKey: "setup.proxy-hasheous-setup", + caveatKey: "setup.proxy-hasheous-caveat", }, { id: "playmatch", name: "PlayMatch", logo: `${LOGO_BASE}/playmatch.png`, - desc: "Hash-based matcher paired with IGDB data.", - setup: "Set PLAYMATCH_API_ENABLED=true.", - caveat: "Community-hosted service.", + descKey: "setup.proxy-playmatch-desc", + setupKey: "setup.proxy-playmatch-setup", + caveatKey: "setup.proxy-playmatch-caveat", }, ]; @@ -258,21 +258,19 @@ function paragraphs(text: string): string[] {
+
- - {{ t("scan.info-providers", "Providers") }} + {{ t("setup.metadata-catalogs") }}

- {{ - t( - "scan.info-providers-hint", - "First-party services queried directly with your API key.", - ) - }} + {{ t("setup.metadata-catalogs-hint") }}

@@ -286,35 +284,71 @@ function paragraphs(text: string): string[] {

{{ p.name }}

-

{{ p.desc }}

+

{{ t(p.descKey) }}

- {{ p.setup }} + {{ t(p.setupKey) }} - {{ p.caveat }} + {{ t(p.caveatKey) }}
+
- - {{ t("scan.info-proxies", "Match proxies") }} + {{ t("setup.metadata-specialised") }}

- {{ - t( - "scan.info-proxies-hint", - "Community-hosted hash matchers that improve hits using file hashes.", - ) - }} + {{ t("setup.metadata-specialised-hint") }} +

+
+
+
+
+
+

{{ t(p.descKey) }}

+
+ + + {{ t(p.setupKey) }} + + + + {{ t(p.caveatKey) }} + +
+
+
+
+ + +
+
+ {{ t("setup.metadata-proxies") }} +

+ {{ t("setup.metadata-proxies-hint") }}

{{ p.name }}
-

{{ p.desc }}

+

{{ t(p.descKey) }}

- {{ p.setup }} + {{ t(p.setupKey) }} - {{ p.caveat }} + {{ t(p.caveatKey) }}
diff --git a/frontend/src/v2/components/Scan/ScanPlatform.vue b/frontend/src/v2/components/Scan/ScanPlatform.vue index c06e6b7a7..f1522b6f0 100644 --- a/frontend/src/v2/components/Scan/ScanPlatform.vue +++ b/frontend/src/v2/components/Scan/ScanPlatform.vue @@ -3,13 +3,12 @@ // Scan view. Header shows the platform icon + name + per-platform // chips (ROM count, firmware count, "not identified" badge). // -// Body: lists every newly-scanned ROM via ScanPlatformRow. Switches to -// RVirtualScroller once the ROM count crosses VIRT_THRESHOLD so an -// initial scan with hundreds of games per platform keeps the DOM size -// bounded and scroll smooth. The threshold is high enough that small -// platforms keep the natural inline layout (no fixed-height scroll -// box), and low enough that big platforms get virtualised before the -// browser starts struggling. +// Body: lists every newly-scanned ROM via ScanPlatformRow, always +// inside an RVirtualScroller. Using the virtual scroller unconditionally +// keeps the body surface aligned with its content height regardless of +// the row count — an initial scan with hundreds of games per platform +// gets bounded DOM size, and small platforms still get the same flush +// surface (no late "growing into" the right shape as rows stream in). import { RCollapsible, RPlatformIcon, RTag, RVirtualScroller } from "@v2/lib"; import { computed } from "vue"; import { useI18n } from "vue-i18n"; @@ -31,22 +30,25 @@ defineEmits<{ const { t } = useI18n(); -// Above this row count, the body switches to the virtual scroller with -// a bounded viewport. Below it, we keep the plain inline list so small -// platforms don't get a redundant scrollbar. -const VIRT_THRESHOLD = 50; // Row height baked into ScanPlatformRow's scoped styles (8px padding + // 48px cover + 8px padding + 1px border). Kept here as a constant so // `getItemHeight` and the row style stay in sync. const ROW_HEIGHT = 65; -// Bounded viewport for the virtualised list — tall enough to read a -// real chunk of the scan, short enough that the parent log can still -// show neighbour platforms above and below. -const VIRT_VIEWPORT_PX = 480; +// Cap the virtual scroller's viewport so it never overruns the right +// pane. Up to this many rows render at natural height; above the cap +// the container scrolls internally. +const MAX_VIEWPORT_ROWS = 8; -const shouldVirtualise = computed( - () => props.platform.roms.length >= VIRT_THRESHOLD, -); +// Use the natural cumulative height up to the cap so small / empty +// platforms don't show a tall empty box. Above the cap we lock to the +// max so streaming hundreds of rows can't push the panel off-screen. +const viewportHeight = computed(() => { + const rows = Math.min(props.platform.roms.length, MAX_VIEWPORT_ROWS); + // Always reserve at least one row's height so the body has visible + // surface even when there are no ROMs yet (the "no new roms" empty + // state still needs somewhere to sit). + return Math.max(rows, 1) * ROW_HEIGHT; +}); function getItemHeight() { return ROW_HEIGHT; @@ -89,15 +91,20 @@ function getItemHeight() { /> - + +
+ {{ t("scan.no-new-roms") }} +
@@ -105,33 +112,10 @@ function getItemHeight() { - - -
    -
  • - -
  • -
  • - {{ t("scan.no-new-roms") }} -
  • -