-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix "same search query appears twice in Recent searches" #51314
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
luacmartins
merged 7 commits into
Expensify:main
from
software-mansion-labs:@szymczak/fix-recent-searches-list
Nov 5, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
80fd4e7
add recentSearchHash
SzymczakJ 2128c91
Merge branch 'main' into @szymczak/fix-recent-searches-list
SzymczakJ 855c16e
don't include policyID in recent hash
SzymczakJ 283f379
Merge branch 'main' into @szymczak/fix-recent-searches-list
SzymczakJ ada33fc
Merge branch 'main' into @szymczak/fix-recent-searches-list
SzymczakJ 4adb83c
fix PR comments
SzymczakJ df04107
Merge branch 'main' into @szymczak/fix-recent-searches-list
SzymczakJ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thinking more about it. What if a user explicitly types policyID:X sortOrder:asc? Should we instead just be hashing the input string instead of parts of the AST? That'd ensure anything the user types differently would be a new recent search
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.
We cannot hash string input. My argument: when user types policyID:X sortOrder:asc and sortOrder:asc policyID:X, we will get different hashes even though the query results will be the same.
I think we should exclude policyID like @rayane-djouah said. It may create some confusion when user types policy:X into query, but:
What's more if user selects recentSearch with not the policyID he wanted, he can easily switch it on SearchResults page with policy switcher and it's not such a big problem(just like he switches sortOrder or sortBy). WDYT @rayane-djouah @luacmartins
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 think we can go with your current solution for now, but:
TBH I'd be ok to show both of these as different recent searches, even though they are the same search at the end of the day. My argument is that the user explicitly typed both of those, so they'd probably expect to see both in the recent search area.
I think we should introduce policyID autocomplete. Maybe we need a new
workspace:filter for that though, so the autocomplete shows the policy name instead of ID.cc @JmillsExpensify @trjExpensify for your thoughts.