-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix(explore): Update search bar query on filter change #88473
Conversation
@@ -43,6 +43,7 @@ type ResetFocusOverrideAction = {type: 'RESET_FOCUS_OVERRIDE'}; | |||
type DeleteTokenAction = { | |||
token: ParseResultToken; | |||
type: 'DELETE_TOKEN'; | |||
handleSearch?: (query: string) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to initialize useQueryBuilderState
and pass along handleSearch
as a prop? Defining it on each dispatch
is like saying it could possibly change at each call. I think if we can initialize the hook with it, then passing it down and using it might be easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem is handleSearch
needs the state from useQueryBuilderState
to initialize the function. I agree it's kind of janky, wonder if there's a better workaround
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikkikapadia React assumes that reducers are pure and have no side effects (see docs for useReducer). Adding side effects can lead to some very hard to track down bugs, so we will need to find a different solution.
I'll take some time to look over the issue and see if I can recommend a different path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that there were supposed to be improvements made to the search bar; if this feature is coming soon i don't mind deprioritizing this PR
@nikkikapadia can you just use the |
works great, thanks for the help! 😌 |
* master: (96 commits) fix(autofix): fix highlight popup behavior (#88552) 🔧 chore: introduce workflow engine ui links ff (#88569) feat(pipeline): Add CoveragePageWrapper component and tests for it (#88519) feat(taskworker):Make sdk tasks taskworker compatible (#88488) chore(flamegraph): Updating wording to trace (#88516) feat(shared-views): Create `GET` `group-search-view/starred` endpoint (#88398) DI-612: print flaky pytest errors to log (v2) (#88512) chore(nav): Update banner copy (#88566) feat(sentryapps): add RPC method to get all installation component contents (#88179) chore(issue summary): Add limit to query (#88563) fix(dashboards): Add limit suggestion to validation (#88436) feat(checkout): show starting PAYG prices (#88510) ✨ feat(aci): add workflow_id when creating an ephemeral rule in noa (#88520) fix(billing): hide pay now button for self serve partners (#88504) chore(HC): Re-adds logging with a low sample rate for cache hits/misses on options (#88464) fix(logs): Upgrade sentry log integration to fix dogfooding issues (#88561) chore(issue summary): Remove dividers from AI summary alert (#88554) feat(insights): Enable bubbles in full-screen mode (#88445) fix(explore): Update search bar query on filter change (#88473) chore(dependencies): Upgrade drf-spectacular (#88459) ...
The search bar was not updating automatically when a query was changed causing schema hints to be added on top of the previously saved query (which may not be what the user has currently in their search bar). I've provided and option to turn this on and only for filter actions. Addresses [this bug](https://www.notion.so/sentry/Getting-rid-of-fields-from-the-search-bar-doesn-t-update-url-1c08b10e4b5d8058b1afc7d83f532be7?pvs=4) and [this bug](https://www.notion.so/sentry/Unsubmitted-changes-get-reset-and-cleared-on-updates-1c08b10e4b5d80e294fde2af6e850e40?pvs=4)
The search bar was not updating automatically when a query was changed causing schema hints to be added on top of the previously saved query (which may not be what the user has currently in their search bar). I've provided and option to turn this on and only for filter actions.
Addresses this bug and this bug