Skip to content

Keep the library responsive while loading icons from network game folders - #19

Open
elrrrrrrr wants to merge 1 commit into
Bium23:mainfrom
elrrrrrrr:bium/cache-library-game-icons
Open

elrrrrrrr wants to merge 1 commit into
Bium23:mainfrom
elrrrrrrr:bium/cache-library-game-icons

Conversation

@elrrrrrrr

@elrrrrrrr elrrrrrrr commented Nov 15, 2026 •

Copy link
Copy Markdown

What prompted this

With game apps on a Synology SMB share (including apps reached through local symlinks), NX Library 0.1.4.3 started but the Collection window did not appear. A sample of the main thread showed SwitchBoxArtCover.composed → GameIconProvider.icon(for:) → NSWorkspace.icon(forFile:) → IconServices waiting for a synchronous XPC reply. A separate scanner thread was waiting for file attributes. A newly mounted SMB session restored direct reads of the affected bundle, while another sample still showed the synchronous icon lookup in the UI.

Change

Collection, Spotlight, Details, the build review and the theme preview read in-memory icons and render a placeholder on a miss. Up to two background operations read embedded or extracted icons. A separate local queue reads and writes atomic thumbnail records (up to 512 px) in the user's Caches directory. Warm hits do not need a bundle lookup and do not queue behind blocked SMB reads. Records track the stored app URL, modification date, workspace and title ID. The existing icon-change hook invalidates a record; late results for an earlier request are discarded.

This only changes icon loading. Directory scanning and game launching still need the configured share. Apps with no readable embedded or extracted icon use a controller symbol as their fallback. No mount paths or credentials are configured by the patch.

Validation

  • The new synthetic regression holds a source read open, requests the same icon again, then instantiates a fresh provider with the share unavailable. It also checks that a recorded app revision change requests a new thumbnail.
  • Full Swift test suite on Apple Silicon: 1,198 tests, 2 skipped, 0 failures.
  • Suggested maintainer check: open Collection with several local and SMB-backed games, let icons populate, relaunch with the share slow or offline, then reconnect and change one app's icon. Check responsiveness, the cached icons and the refreshed icon.

Ready for maintainer review. The interactive NAS checks above remain open.

@elrrrrrrr
elrrrrrrr marked this pull request as ready for review November 15, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant