-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[HOLD for payment 2025-02-04] [$250] Removing one value from Search filter clears the search #55433
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
Comments
Triggered auto assignment to @kadiealexander ( |
cc @jaydamani |
Job added to Upwork: https://www.upwork.com/jobs/~021880343282436872367 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Editing search conditions clears the search. What is the root cause of that problem?
App/src/components/Search/SearchPageHeaderInput.tsx Lines 262 to 264 in 91b84ef
What changes do you think we should make in order to solve the problem?
App/src/components/Search/SearchRouter/SearchRouter.tsx Lines 295 to 301 in 91b84ef
We could copy the same logic to
App/src/components/Search/SearchPageHeaderInput.tsx Lines 127 to 128 in 91b84ef
Change the above conditions as below: if (updatedUserQuery && textInputValue.length > 0) { What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?Spy on What alternative solutions did you explore? (Optional) |
|
ProposalPlease restate the problemRemoving filters from an existing search query and resubmitting it causes the entire query to be cleared instead of just the filters you removed. What is the root cause of the problemIn the App/src/components/Search/SearchPageHeaderInput.tsx Lines 146 to 151 in dd0de18
What changes do you think we should make in order to solve the problem?We could comment out these 2 lines App/src/components/Search/SearchPageHeaderInput.tsx Lines 148 to 149 in dd0de18
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?Substituting a value in the query (e.g., removing “Advertising”)
Submitting a brand-new query
Re-submitting the same query
What alternative solutions did you explore? (Optional)We could add more conditions to the if statement to prevent it from executing while you are editing an existing query, by tracking the state of the query (writing a new one or editing an existing one). |
📣 @HRedz! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
@QichenZhu Thanks for the proposal. Your RCA is correct. I think removing |
@HRedz Thanks for the proposal. Your RCA is not correct as the bug does not occur just be choosing another query e.g. clicking on the search item. Screen.Recording.2025-01-18.at.5.56.22.PM.mov |
🚨 Edited by proposal-police: This proposal was edited at 2025-01-19 19:47:34 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Removing one value from Search filter clears the search What is the root cause of that problem?When we remove the value from filter and press enter, two event fire
What changes do you think we should make in order to solve the problem?To fix this issue we need to make sure If we remove this method it will not allow you reset the filter. Because when we clear input field and press enter it will take first item from the selection list always. So to fix this issue we need to make sure whenever input field does not have any value and press enter we should run this block. And when input has value we should run this block. For this following changes are required.
OR
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?NA UI bug What alternative solutions did you explore? (Optional) |
@ishakakkad Thanks for the proposal. Your RCA is correct however the solution won't always work as expected, e.g. if you clear the input, you can't select the first item, you will have to use arrow key down then up. |
@s77rt Thanks for your review!
The selection list selects the focused option when pressing Enter, even if pressed within a text input. App/src/components/SelectionList/BaseSelectionList.tsx Lines 766 to 768 in 155818e
|
|
@ishakakkad Thanks for the update. Removing focus on clearing the text input is something that is supposed to be in place already but due to the outdated App/src/components/Search/SearchPageHeaderInput.tsx Lines 127 to 131 in 9c54d12
As for the other problem (re-selecting previous query), we should use App/src/components/Search/SearchPageHeaderInput.tsx Lines 146 to 151 in 9c54d12
Overall the proposal looks good to me. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @lakchote, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@s77rt Thanks for the feedback! |
PR will be created by tomorrow. |
@ishakakkad Given that you are a new contributor, you are only allowed to work on a single issue at a time. I noticed that you are assigned to 3 issues. Please refrain yourself from posting proposals until those are completed. Please read our contributing guidelines. |
Thank you @parasharrajat I will take care. |
@ishakakkad let's prioritize this one since it's affecting several users |
@luacmartins I am already working on this, will create PR soon. |
@s77rt PR is ready to review. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.89-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2025-02-04. 🎊 For reference, here are some details about the assignees on this issue:
|
@s77rt @kadiealexander @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button] |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalPrecondition:
Test:
Do we agree 👍 or 👎 |
Payments due:
|
$250 approved for @s77rt |
Uh oh!
There was an error while loading. Please reload this page.
Coming from here, we're clearing the search when we remove one of the values from a filter, e.g. removing
category:Advertising
fromcategory:Advertising tag:Accounting
.Reproduction steps:
Go to Reports page
Search for category:"Meals and Entertainment",Advertising
Click on search header and edit query to remove Advertising
Expected Result:
Search query is now type:expense status:all category:"Meals and Entertainment"
Actual Result:
Search query is cleared
Extra info:
Based on @jaydamani's investigation, submitSearch gets called twice for some reason and on second time the search query is blank so filter resets
Screen.Recording.2025-01-17.at.19.33.04.mp4
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @kadiealexanderThe text was updated successfully, but these errors were encountered: