fix(platforms): hide empty platforms behind a toolbar filter - #3982
Merged
Conversation
The Platforms index switched to allPlatforms, so every leftover 0-game platform row rendered in the grid, burying real libraries under hundreds of stubs. Empty platforms are hidden again by default and surface through a new segmented toolbar cluster, URL-synced as ?show=all. They stay reachable (and deletable) that way, so they don't become stranded in the database again. Fixes #3979 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Greptile SummaryAdds a URL-synchronized platform visibility filter that hides empty platforms by default while keeping them accessible on demand.
Confidence Score: 3/5The concurrent URL update path needs to be fixed before merging because toolbar interactions can discard each other's active query state. The new visibility watcher independently snapshots Files Needing Attention: frontend/src/v2/views/PlatformsIndex.vue Prompt To Fix All With AI### Issue 1
frontend/src/v2/views/PlatformsIndex.vue:89
**Concurrent query updates overwrite filters**
When the platform segment and another URL-backed toolbar control update in the same reactive flush, each watcher copies the same stale `route.query` into a separate `router.replace`, so the later navigation drops the other control's parameter and resets its visible state.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "fix(platforms): hide empty platforms beh..." | Re-trigger Greptile |
…tomp `router.replace` is async, so `route.query` keeps reading the pre-navigation value. Two URL-backed controls changing in the same flush each built their next query from that stale snapshot, and the second navigation won with a query that never saw the first one's key. Reachable today on the Collections index: picking the "virtual" kind also clears the visibility filter in the same flush, and the clear dropped `?kind=virtual`. Route every writer (search, view mode, Platforms and Collections filters) through `patchQuery`, which merges patches and issues one navigation per tick. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mdi-select-all is a marquee-selection glyph, so it read as an action rather than a filter state. mdi-asterisk carries the wildcard "everything" meaning the segment actually has. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Description
Explain the changes or enhancements you are proposing with this pull request.
#3945 switched the Platforms index from
filledPlatformstoallPlatformsso empty (0-game) platforms would be reachable and therefore deletable (#3902). The side effect: every leftover platform row now renders in the grid. Users who keep largeexclude.platformslists (excluded folders leave behind 0-game rows) went from a clean library to hundreds of stubs.This keeps both properties:
Only platforms with games/Include empty platforms) reveals them on demand, so an empty platform can still be opened and removed through the existing Settings → Delete platform flow.Details:
?show=all, omitted at the default, matching the?kind=/?vis=pattern on the Collections index and the "active filters live in the URL" rule.allPlatforms, so it doesn't misfire when the filter is what's hiding everything. A library whose platforms are all empty gets a message pointing at the filter instead.platform.jsonkeys, translated across all 18 locales.Note for context on the issue report: the reporter's
exclude.platformslist was not wiped by the upgrade._update_config_filerewrites the full list and there's no truncation path. Those platforms were never hidden by the exclusions themselves, only by therom_count > 0filter that #3945 removed.Fixes #3979
Checklist
Please check all that apply.
Verification:
npm run test— 40 files, 580 tests passnpm run typecheck— cleantrunk fmt && trunk check— no issuespython3 src/locales/check_i18n_locales.pyandcheck_i18n_sorted.py— both passNot verified in a browser (developed in a worktree without a running app).
AI assistance disclosure
This change was written with AI assistance (Claude Code). I directed the investigation and reviewed the result; the implementation, translations, and tests were AI-generated.
Screenshots (if applicable)
n/a
🤖 Generated with Claude Code