Skip to content

Opti/global filter#613

Merged
ximu3 merged 3 commits into
ximu3:mainfrom
fishyy119:opti/global-filter
Jun 2, 2026
Merged

Opti/global filter#613
ximu3 merged 3 commits into
ximu3:mainfrom
fishyy119:opti/global-filter

Conversation

@fishyy119
Copy link
Copy Markdown
Contributor

@fishyy119 fishyy119 commented May 23, 2026

  • 对游戏库的全局过滤器相关代码进行了重构
  • 新增了根据目录与游戏名进行排除的全局过滤器

Resolve #593, Resolve #495, Resolve #494

  • 将游戏原名添加到了游戏搜索的优先阶段

Fix #466

fishyy119 added 3 commits May 24, 2026 00:02
- Add a `useVisibleGameIds` source so library and showcase views share one global visibility pipeline for NSFW and local-game filters.
- Move `nsfw` and `gamePath` into the game registry, add pending metadata handling for early `game-local` updates, and remove duplicate registry registration from sync.
- Keep manual search and manual filter scoped to the full game library instead of the global visibility subset.
- Add a custom visibility filter to the shared visible-game pipeline with exact-name matching and normalized path-prefix exclusion.
- Add appearance settings for the titlebar toggle, excluded path prefixes, and excluded game names.
- Add a configurable titlebar toggle for the local game filter and group the library filter button visibility settings together in appearances.
- Collapse the library visibility controls into a popover when all three filter buttons are shown, while keeping direct buttons for smaller combinations.
Copilot AI review requested due to automatic review settings May 23, 2026 16:03
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

This PR unifies “global” library-game visibility (NSFW + local-game + new custom visibility filters) into a shared pipeline so the Librarybar and Showcase render consistent subsets, while keeping manual search/filter operating over the full library.

Changes:

  • Introduces useVisibleGameIds as the shared visibility pipeline (NSFW, local-game, and custom visibility exclusions by exact name / path prefix).
  • Moves visibility-relevant metadata (e.g., nsfw, gamePath) into the game registry with support for pending game-local metadata before the main game doc loads.
  • Refines titlebar library filter controls (including a new custom-visibility toggle) and adds Appearance settings + translations for the new controls.

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/types/models/config.ts Adds config schema + defaults for new sidebar toggles and customVisibilityFilter settings.
src/renderer/src/stores/sync.ts Removes duplicate registry registration during DB sync; relies on store initialization to register.
src/renderer/src/stores/game/useVisibleGameIds.ts New shared hook implementing global visibility filtering (NSFW/local/custom).
src/renderer/src/stores/game/index.ts Re-exports useVisibleGameIds from the game store module.
src/renderer/src/stores/game/gameUtils.ts Updates search/filter helpers to accept optional gameId subsets and aligns with genres metadata.
src/renderer/src/stores/game/gameStoreFactory.ts Extends registry meta extraction (genres, nsfw) and ensures fallback values are used.
src/renderer/src/stores/game/gameRegistry.ts Expands registry metadata (genres/nsfw/gamePath) and adds pending metadata merging.
src/renderer/src/stores/game/gameLocalStoreFactory.ts Pushes gamePath changes into registry metadata (including early updates).
src/renderer/src/pages/Record/ScoreReport/GameScoreCard.tsx Updates score card display to use genres array instead of a single genre.
src/renderer/src/pages/Config/Appearances/main.tsx Adds Appearance UI for custom visibility filter inputs and sidebar toggle visibility controls.
src/renderer/src/components/Titlebar.tsx Refactors library filter controls UI and adds custom visibility filter toggle + popover behavior.
src/renderer/src/components/Showcase/RecentGames.tsx Switches recent-games source to the shared visible-game pipeline.
src/renderer/src/components/Showcase/posters/CollectionPoster.tsx Uses useVisibleGameIds to pick representative visible games for collection posters.
src/renderer/src/components/Showcase/main.tsx Uses useVisibleGameIds for default display; keeps manual search/filter scoped to full library.
src/renderer/src/components/Showcase/Collections.tsx Filters collections based on presence of any globally-visible games.
src/renderer/src/components/Showcase/CollectionPage.tsx Aligns collection page selection + visibility with globally-visible games.
src/renderer/src/components/Showcase/CollectionGames.tsx Uses useVisibleGameIds for per-collection game listing visibility.
src/renderer/src/components/Showcase/AllGames.tsx Uses globally-visible game ids for the “All Games” showcase list.
src/renderer/src/components/Librarybar/GameList/RecentGames.tsx Uses globally-visible game ids for the Librarybar recent games list.
src/renderer/src/components/Librarybar/GameList/PlayStatusGames.tsx Applies manual filtering over the globally-visible id subset.
src/renderer/src/components/Librarybar/GameList/Others.tsx Applies grouping/filtering over the globally-visible id subset.
src/renderer/src/components/Librarybar/GameList/Collection.tsx Applies collection grouping over the globally-visible id subset.
src/renderer/src/components/Librarybar/GameList/AllGame.tsx Uses globally-visible game ids for the “All Games” Librarybar list.
src/renderer/src/components/Librarybar/Filter/FilterCombobox.tsx Fixes memo deps by including t to avoid stale translated labels.
src/renderer/locales/zh-TW/sidebar.json Adds sidebar strings for library filters + custom visibility filter state.
src/renderer/locales/zh-TW/config.json Adds Appearance strings for new sidebar toggles and custom visibility filter settings.
src/renderer/locales/zh-CN/sidebar.json Adds sidebar strings for library filters + custom visibility filter state.
src/renderer/locales/zh-CN/config.json Adds Appearance strings for new sidebar toggles and custom visibility filter settings.
src/renderer/locales/ja/sidebar.json Adds sidebar strings for library filters + custom visibility filter state.
src/renderer/locales/ja/config.json Adds Appearance strings for new sidebar toggles and custom visibility filter settings.
src/renderer/locales/en/sidebar.json Adds sidebar strings for library filters + custom visibility filter state.
src/renderer/locales/en/config.json Adds Appearance strings for new sidebar toggles and custom visibility filter settings.
src/main/features/importer/services/versionConverter/common.ts Updates v2→v3 config conversion to include new sidebar toggle defaults.

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

Comment thread src/renderer/src/components/Titlebar.tsx
Comment thread src/renderer/src/pages/Config/Appearances/main.tsx
@ximu3 ximu3 merged commit 4312bfa into ximu3:main Jun 2, 2026
3 of 4 checks passed
@fishyy119 fishyy119 deleted the opti/global-filter branch June 2, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants