Skip to content

Fix UI blocking in Images tab#461

Merged
PhilipK merged 1 commit intoPhilipK:mainfrom
d-b-c-e:fix/ui-blocking
Feb 2, 2026
Merged

Fix UI blocking in Images tab#461
PhilipK merged 1 commit intoPhilipK:mainfrom
d-b-c-e:fix/ui-blocking

Conversation

@d-b-c-e
Copy link
Contributor

@d-b-c-e d-b-c-e commented Feb 2, 2026

Summary

  • Convert handle_shortcut_selected() from blocking block_on() to async background task with watch channel
  • Convert handle_correct_grid_request() from blocking block_on() to async background task
  • Add poll_grid_id_search() and poll_name_search() to receive async results each frame
  • Fix Windows file:// URL paths by normalizing backslashes to forward slashes
  • Remove blocking thread::sleep(100ms) after image selection, use request_repaint() instead

Problem

The Images tab would freeze/hang when clicking on a shortcut because block_on() was called on the main UI thread for SteamGridDB API requests. Similarly, the "correct grid ID" feature would block the UI during name searches.

Test plan

  • Build succeeds
  • Images tab no longer freezes when clicking shortcuts
  • "Correct grid ID" search works without freezing
  • Image thumbnails display correctly on Windows (file:// URLs)
  • Selecting a new image works and refreshes properly

🤖 Generated with Claude Code

The Images tab would freeze when selecting shortcuts or correcting
grid IDs because block_on() was called on the main UI thread.

Changes:
- Convert handle_shortcut_selected() to spawn async SteamGridDB search
  in the background instead of blocking the UI thread
- Convert handle_correct_grid_request() to spawn async name search
  in the background instead of blocking
- Add poll_grid_id_search() and poll_name_search() to receive async
  results via watch channels
- Add grid_id_search and name_search fields to ImageSelectState
- Fix Windows file:// URL paths by normalizing backslashes to forward
  slashes (file:/// prefix for absolute paths)
- Remove blocking thread::sleep(100ms) after image selection, replace
  with request_repaint()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@PhilipK PhilipK merged commit e890ef9 into PhilipK:main Feb 2, 2026
4 checks passed
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.

2 participants