Skip to content

fix: handle deferred game database loading in library sidebar#572

Merged
ximu3 merged 1 commit intoximu3:mainfrom
fishyy119:fix/list-init
May 3, 2026
Merged

fix: handle deferred game database loading in library sidebar#572
ximu3 merged 1 commit intoximu3:mainfrom
fishyy119:fix/list-init

Conversation

@fishyy119
Copy link
Copy Markdown
Contributor

@fishyy119 fishyy119 commented Apr 12, 2026

修复程序启动后游戏列表不加载的问题。

该问题与 #551 引入的数据库分阶段加载相关,其虽然在主页的内容显示区订阅了加载完成状态,但是左侧的游戏列表没有订阅该状态,导致数据库加载完成后列表没有重新渲染。

较为有趣的是,在开发模式下使用大规模的游戏数据库未能复现该问题,推测可能是某处未知的状态更新触发了列表的重渲染;换为规模较小的游戏数据库才成功复现。

Fix #576

Copilot AI review requested due to automatic review settings April 12, 2026 10:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a loading state to the Library sidebar so the game list UI is deferred until the background (phase 2) game database load completes, addressing the startup case where the list appears empty/not loaded.

Changes:

  • Subscribe to gamesLoaded from useGameRegistry and gate Librarybar rendering on it.
  • Show a spinner + localized “Loading games…” message while games are still loading.
  • Add react-i18next translation usage for the loading message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/renderer/src/components/Librarybar/main.tsx
@ximu3 ximu3 merged commit d4d72b2 into ximu3:main May 3, 2026
3 of 4 checks passed
@fishyy119 fishyy119 deleted the fix/list-init branch May 3, 2026 12:22
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.

[Bug]: 启动的时候所有游戏一栏显示为0,且列表为空。重新切回游戏库菜单才正常显示

3 participants