-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(search): tag names with colon showed \: instead of : #55360
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(search): tag names with colon showed \: instead of : #55360
Conversation
@luacmartins can you confirm if this is known issue, Screen.Recording.2025-01-17.at.19.33.04.mp4 |
Not that I know of. That's a bug that we should report |
Reproduction steps:
Expected Result:
Actual Result:
Extra info: |
Reported here |
@luacmartins I found another bug, this is from back-end. It is probably an issue with the OR operator. |
I have two other PRs to review first, and expect to review this PR in about 14 hours. :) |
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.
When navigating to the search page, the double quotes are missing, which might have potential implications for other parsing processes.
test.mp4
Overall, LGTM, with just one small change left. I personally lean toward not using escapeTagName
for displaying tags. However, if you all feel it's unnecessary, we can ignore it. :)
.map(getCleanedTagName) | ||
.filter((tag) => tag.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(tag.toLowerCase())) |
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.
.map(getCleanedTagName) | |
.filter((tag) => tag.toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(tag.toLowerCase())) | |
.filter((tag) => getCleanedTagName(tag).toLowerCase().includes(autocompleteValue.toLowerCase()) && !alreadyAutocompletedKeys.includes(getCleanedTagName(tag).toLowerCase())) | |
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.
@jaydamani let's address @ntdiary's comments
looking into this
I also don't have any strong opinion related to this. Let's go with your changes |
This did not affect other filters because the substituted value for other filters is some form of ID which never has spaces. We can solve this by sanitizing it here which will add double quotes when tag name has spaces autocompleteID: sanitizeSearchValue(tagName), Is this solution okay or should we try to fix this in getQueryWithSubstitutions? |
After more testing, this might be a better solution Udpated: substitutionEntry = sanitizeSearchValue(substitutionEntry) // add this line for sanitization
// generate new query but substituting "user-typed" value with the entity id/email from substitutions
resultQuery = resultQuery.slice(0, substitutionStart) + substitutionEntry + changedQuery.slice(substitutionEnd);
lengthDiff = lengthDiff + substitutionEntry.length - range.length; |
Yea I think updating it in |
Reviewer Checklist
Screenshots/VideosAndroid: Native55360-android-native.mp4Android: mWeb Chrome55360-android-chrome.mp4iOS: Native55360-ios-native.mp4iOS: mWeb Safari55360-ios-safari.mp4MacOS: Chrome / Safari55360-mac-chrome.mp4MacOS: Desktop55360-mac-desktop.mp4 |
@jaydamani, Eslint check is failed, can you please fix it? I will fill the checklist soon. |
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.
Uploaded test videos and left a comment (NAB). :)
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.
@jaydamani let's address the ESLint failure
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.89-0 🚀
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.0.89-8 🚀
|
Explanation of Change
Add tag name cleaning for search router list, search header input, advanced search filters page and search filters tag page
Fixed Issues
$ #53465
PROPOSAL: #53465 (comment)
Tests
Precondition:
tag:
Offline tests
Same as tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
search-tags-android.mp4
Android: mWeb Chrome
search-tags-android.mp4
iOS: Native
ios-web-search-tag.mp4
iOS: mWeb Safari
https://github.com/user-attachments/assets/8abee30b-444c-4b18-8227-708d21493f00MacOS: Chrome / Safari
web-search-tag-name.mov
MacOS: Desktop
desktop.search-tag.mov