Skip to content

feat(record): support recent game removal and last run recalculation#577

Merged
ximu3 merged 2 commits into
ximu3:mainfrom
fishyy119:feat/remove-recent-game
May 3, 2026
Merged

feat(record): support recent game removal and last run recalculation#577
ximu3 merged 2 commits into
ximu3:mainfrom
fishyy119:feat/remove-recent-game

Conversation

@fishyy119
Copy link
Copy Markdown
Contributor

@fishyy119 fishyy119 commented Apr 16, 2026

  • 支持从最近游戏中移除游戏
  • 支持手动触发“最后运行日期”的重新计算

Resolves #567

实现细节

  • 为每个游戏新增了hideFromRecentGames字段,通过设置该字段以实现对最近游戏列表的过滤
  • 运行游戏、重新计算最后运行日期,都会导致该字段重置
  • 重新计算最后运行日期会将其重置为当前的计时器列表的最后结束时间。此功能是为了解决游戏误启动后,最后运行日期字段没有办法修复方法的问题。

Copilot AI review requested due to automatic review settings April 16, 2026 16:10
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 support for removing games from “Recent Games” without deleting them, plus a “recalculate last run date” action derived from the timer history (and updates UI + tray to respect hidden items). This implements the feature request in #567.

Changes:

  • Introduces record.hideFromRecentGames and filters hidden games out of recent lists (UI + tray + light background selection).
  • Adds IPC endpoints + main-process services to hide a game from recents and to recalculate record.lastRunDate from timers.
  • Adds UI actions (context menu + dialogs) for “Remove from Recent Games” and “Recalculate Last Played Date”, including new i18n strings.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils/common.ts Adds timer-based lastRunDate recalculation helper.
src/types/models/game.ts Adds hideFromRecentGames to the game record model + default value.
src/types/ipc.ts Adds IPC type definitions for hide/recalculate actions.
src/renderer/src/stores/sync.ts Syncs hideFromRecentGames into renderer-side state.
src/renderer/src/stores/game/recordUtils.ts Filters hidden games out of “recently played” calculation.
src/renderer/src/stores/game/gameUtils.ts Adds getRecentGameIds() and ensures record defaults include the new field.
src/renderer/src/stores/game/gameStoreFactory.ts Includes record.hideFromRecentGames in tracked meta fields.
src/renderer/src/stores/game/gameRegistry.ts Extends meta info index with hideFromRecentGames.
src/renderer/src/pages/Light.tsx Uses getRecentGameIds() so hidden games don’t drive background.
src/renderer/src/components/contextMenu/GameNavCM/main.tsx Adds “Remove from Recent Games” context menu action (IPC + toast).
src/renderer/src/components/contextMenu/GameNavCM/ManageMenu.tsx Adds “Recalculate Last Played Date” entry via alert dialog wrapper.
src/renderer/src/components/Showcase/posters/GamePoster.tsx Pass-through prop to enable/remove action from posters.
src/renderer/src/components/Showcase/posters/BigGamePoster.tsx Pass-through prop to enable/remove action from posters.
src/renderer/src/components/Showcase/RecentGames.tsx Switches to getRecentGameIds() + enables remove action in UI.
src/renderer/src/components/Librarybar/GameNav.tsx Enables remove action when rendering within the recent-games group.
src/renderer/src/components/Librarybar/GameList/RecentGames.tsx Switches to getRecentGameIds() for list recent section.
src/renderer/src/components/Game/Overview/Record/main.tsx Wraps “Last Run Date” card with recalculation alert dialog.
src/renderer/src/components/Game/Overview/Record/RecordCard.tsx Refactors to forwardRef and spreads props for trigger wrapping support.
src/renderer/src/components/Game/Overview/Record/RecalculateLastRunDateAlertDialog.tsx New confirmation dialog for recalculation IPC action.
src/renderer/src/components/Game/Config/ManageMenu/main.tsx Adds recalculation action to the dropdown manage menu.
src/renderer/locales/zh-CN/game.json Adds zh-CN strings for removal + recalculation flows.
src/renderer/locales/en/game.json Adds en strings for removal + recalculation flows.
src/main/features/system/services/tray.ts Filters hidden games out of tray recent list.
src/main/features/monitor/services/monitor.ts Resets hideFromRecentGames on a fresh run completion.
src/main/features/importer/services/versionConverter/common.ts Sets default hideFromRecentGames: false during import conversion.
src/main/features/game/services/record.ts New main-process service functions for hide + recalc.
src/main/features/game/services/index.ts Exports the new record service module.
src/main/features/game/ipc.ts Wires IPC handlers to the new services.

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

Comment thread src/renderer/src/components/Game/Overview/Record/RecordCard.tsx
- add hideFromRecentGames for recent game filtering
- add IPC actions to hide recent games and recalculate last run date
- filter hidden games from recent lists, tray menu, and light background
@fishyy119 fishyy119 force-pushed the feat/remove-recent-game branch from 1023595 to ab55d70 Compare April 16, 2026 16:24
@fishyy119 fishyy119 marked this pull request as draft May 1, 2026 15:05
@fishyy119 fishyy119 marked this pull request as ready for review May 3, 2026 12:13
@ximu3 ximu3 merged commit 0b9ebbf into ximu3:main May 3, 2026
@fishyy119 fishyy119 deleted the feat/remove-recent-game branch May 3, 2026 13:03
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.

[Feat]: 把游戏从最近游戏列表里面移除的功能

3 participants