feat(record): support recent game removal and last run recalculation#577
Merged
Conversation
There was a problem hiding this comment.
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.hideFromRecentGamesand 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.lastRunDatefrom 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.
- 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
1023595 to
ab55d70
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #567
实现细节
hideFromRecentGames字段,通过设置该字段以实现对最近游戏列表的过滤