Skip to content

Use URL to store and load search params #2045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 5, 2025
Merged

Use URL to store and load search params #2045

merged 5 commits into from
Jul 5, 2025

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Jul 2, 2025

Description
Explain the changes or enhancements you are proposing with this pull request.

This PR does a number of things related to searching and the search page, namely:

  • Centralize how/when the list of games is filtered and reset
  • Store search filters in the URL bar
    • Use those filters to set state of gallery filter
  • Unify the search and filter bars

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Copy link

trunk-io bot commented Jul 2, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

@gantoine gantoine requested review from Copilot and zurdi15 July 2, 2025 16:15
Copy link
Contributor

@Copilot 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 centralizes gallery filter and search state in the URL, replaces direct fetchRoms calls with a unified filterRoms event emitter, and cleans up legacy filter components.

  • Sync search and filter state to URL query parameters in FilterDrawer/Base.vue
  • Emit filterRoms instead of calling fetchRoms directly across components
  • Remove deprecated filter/search components and add explicit setter methods in the gallery filter store

Reviewed Changes

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

Show a summary per file
File Description
frontend/src/views/Gallery/Platform.vue Emit filterRoms and conditionally reset gallery instead of direct fetch
frontend/src/views/Gallery/Collection.vue Mirror platform changes for collection view
frontend/src/stores/galleryFilter.ts Add setFilterX methods and simplify resetFilters
frontend/src/components/Gallery/AppBar/common/FilterTextField.vue Remove deprecated FilterTextField
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterVerifiedBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterUnmatchedBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterRaBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterPlayablesBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterMissingBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterMatchedBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterFavouritesBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/FilterDuplicatesBtn.vue Update emitter to filterRoms
frontend/src/components/Gallery/AppBar/common/FilterDrawer/Base.vue Implement URL sync and debounce in onFilterChange
frontend/src/components/Gallery/AppBar/Search/SearchTextField.vue Refactor search to emit filterRoms and clear legacy logic
frontend/src/components/Gallery/AppBar/Search/SearchBtn.vue Remove deprecated SearchBtn
frontend/src/components/Gallery/AppBar/Platform/Base.vue Switch to show-search-bar prop instead of show-filter-bar
frontend/src/components/Gallery/AppBar/Collection/Base.vue Switch to show-search-bar prop instead of show-filter-bar
frontend/src/components/Gallery/AppBar/Base.vue Simplify props and drop old filter text field
Comments suppressed due to low confidence (2)

frontend/src/components/Gallery/AppBar/common/FilterDrawer/Base.vue:275

  • The new URL parsing and state hydration logic in the onMounted hook isn't covered by existing tests. Adding unit or integration tests for this behavior would help prevent regressions.
    search: urlSearch,

@gantoine gantoine marked this pull request as ready for review July 2, 2025 16:19
@gantoine gantoine merged commit 346c24e into master Jul 5, 2025
8 checks passed
@gantoine gantoine deleted the url-search-params branch July 5, 2025 13:56
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.

1 participant