Opti/global filter#613
Merged
Merged
Conversation
- 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.
There was a problem hiding this comment.
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
useVisibleGameIdsas 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 pendinggame-localmetadata 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.
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.
Resolve #593, Resolve #495, Resolve #494
Fix #466