Skip to content

Fire off search if URL state prepopulated #2205

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 1 commit into from
Aug 6, 2025
Merged

Conversation

gantoine
Copy link
Member

@gantoine gantoine commented Aug 4, 2025

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

Small improvements to search where the filter drawer fires a fetch event on mount of any of the filters are present in the URL.

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

@gantoine gantoine requested review from zurdi15 and Copilot August 4, 2025 23:58
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 improves the search functionality by automatically triggering a search when filters or search terms are present in the URL on component mount. It removes the immediate search emission from the Search view and instead handles it conditionally in the FilterDrawer component.

  • Conditional search triggering based on URL state prepopulation
  • Debounce configuration updates to prevent leading edge execution
  • Search term handling moved later in the mount lifecycle

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/src/views/Gallery/Search.vue Removes automatic search emission on mount
frontend/src/components/Gallery/AppBar/common/FilterDrawer/Base.vue Adds conditional search triggering and moves search term handling
frontend/src/views/Settings/LibraryManagement.vue Updates debounce configuration to disable leading edge
Comments suppressed due to low confidence (1)

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

  • [nitpick] The variable name freshSearch is ambiguous. Consider renaming to hasNewSearchTerm or searchTermFromUrl to better indicate that it represents a search term coming from the URL that differs from the current value.
  const freshSearch = urlSearch !== undefined && urlSearch !== searchTerm.value;

Copy link

trunk-io bot commented Aug 4, 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 force-pushed the search-mount-query branch from 8249cf7 to ef338a8 Compare August 5, 2025 00:51
@gantoine gantoine merged commit 377aa13 into master Aug 6, 2025
8 checks passed
@gantoine gantoine deleted the search-mount-query branch August 6, 2025 13:13
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