LibraryView component is the main interface for browsing and managing your game library. It includes search, filtering, system tabs, and real-time artwork sync.
Import
LibraryView is a desktop-specific component located in apps/desktop/src/renderer/components/. It wraps the shared GameLibrary component from @gamelord/ui.Basic usage
Props
Called when the user clicks a game card to play. Receives the game object and optional card bounding rect for hero animations.
Returns menu items for a game’s dropdown menu. Called lazily when the dropdown opens.
ID of a game currently being launched. Shows shimmer on that card and disables others.
Features
Header toolbar
- Library title with game count
- Scan progress badge during directory scans
- Artwork sync badge with cancel button
- Download Artwork button (opens credentials dialog if needed)
- Add Folder button to scan a new directory
- Rescan button to re-scan existing system folders
System filter tabs
Tabs for each detected system with game counts:Sync notifications
Banner notifications after artwork sync completes:- Success:
"Downloaded artwork for 12 games. 3 not found." - Warning:
"No artwork found. 5 games not recognized by ScreenScraper." - Error:
"Artwork sync stopped: invalid ScreenScraper credentials."
Core download progress
Progress bar shown when downloading libretro cores:Empty library state
When no games are found, shows theEmptyLibrary component with:
- Quick scan button
- Select directory button
- Add system button
IPC events
LibraryView listens to these IPC events:library:scanProgress
{ game: Game, isNew: boolean, processed: number, total: number, skipped: number }
Emitted during directory scans. New games are added to the library incrementally.
core:downloadProgress
{ coreName: string, systemId: string, phase: string, percent: number, error?: string }
Emitted during core downloads. Shows progress bar in header.
artwork:progress
{ gameId: string, phase: ArtworkSyncPhase, current: number, total: number, coverArt?: string }
Emitted for each game during artwork sync. Updates card phase and counter badge.
Emitted when artwork sync finishes. Shows summary notification.
Emitted when artwork sync fails. Shows error notification.
Examples
With menu items
With hero animation
Auto-sync behavior
LibraryView automatically syncs artwork for newly imported games:- User adds a new folder or ROM
- Scan finds new games
- If ScreenScraper credentials are configured, auto-sync starts
- Cards show sync progress in real-time
- Cover art appears as downloads complete
Auto-sync only triggers if the user has already configured ScreenScraper credentials. Otherwise, the “Download Artwork” button opens the credentials dialog.
Credentials dialog
First-time artwork sync prompts for ScreenScraper account:Performance optimizations
- Incremental scan results - New games appear immediately during scan
- Optimistic UI updates - Favorite toggle updates instantly
- Per-game UI cache - Only re-creates UI objects when source data changes
- External sync store - Artwork phases bypass React re-renders
- Bounded progress events - Limits IPC event frequency during large operations
Error handling
Sync error codes
config-error- Developer credentials missing from .envauth-failed- Invalid ScreenScraper username/passwordrate-limited- Too many requests, wait and retrytimeout- ScreenScraper not respondingnetwork-error- No internet connection