You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The user would type in one place, and several navigations would launch for each input. Then the route from the first navigation would change, and the user would continue typing—but navigation from the first page would still continue. They rewrote the route and the query listener updated the field value
How
I created a global storage for search fields, and both fields write to it. The field doesn't actually listen to query now, but only uses it for default value and as the factor that q has been cleared (when exiting the search)
So now there's a single source of truth - the search store. And query parameter is simply synchronized with it for page reloads and for the server
This change introduces a centralised global search query state through a new composable function and refactors multiple components to use it. The SearchBox component replaces its local input state with the global search query and removes the watcher that synchronised local input with URL parameters during navigation. The pages index and search components similarly migrate from local state to the global composable. This architectural shift eliminates automatic page synchronisation triggered by URL navigation whilst preserving the existing search submission functionality.
The changes address the core requirement from issue #1211 by implementing a global search store that prevents route-driven updates from interrupting user input.
Out of Scope Changes check
✅ Passed
All changes are directly related to centralizing search state and preventing route-driven input interruptions. No out-of-scope modifications were introduced.
Description check
✅ Passed
The PR description clearly relates to the changeset, explaining the problem of missed keystrokes during search and the solution of creating a global search store.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches🧪 Generate unit tests (beta)
Create PR with unit tests
Post copyable unit tests in a comment
Comment @coderabbitai help to get the list of available commands and usage tips.
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
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.
What
The user would type in one place, and several navigations would launch for each input. Then the route from the first navigation would change, and the user would continue typing—but navigation from the first page would still continue. They rewrote the route and the query listener updated the field value
How
I created a global storage for search fields, and both fields write to it. The field doesn't actually listen to query now, but only uses it for default value and as the factor that
qhas been cleared (when exiting the search)So now there's a single source of truth - the search store. And query parameter is simply synchronized with it for page reloads and for the server
resolves #1211 resolves #764