fix: Report- "Uncategorized" chip not highlighted in search field.#76127
fix: Report- "Uncategorized" chip not highlighted in search field.#76127Rkdev09 wants to merge 7 commits intoExpensify:mainfrom
Conversation
Signed-off-by: Rkmishra09 <ritikamishra5822@gmail.com>
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/libs/SearchQueryUtils.ts
Outdated
| // Consider the empty category selected if ANY of its synonyms are present (e.g., "none" OR "Uncategorized") | ||
| const filterValuesLower = new Set(filterValues.map((v) => v.toLowerCase())); | ||
| const hasEmptyCategoriesInFilter = emptyCategories.some((category) => filterValuesLower.has(category.toLowerCase())); | ||
| // If an empty category synonym is found, append CATEGORY_EMPTY_VALUE to filtersForm so the chip appears selected. |
There was a problem hiding this comment.
Revert this comment change.
Signed-off-by: Rkmishra09 <ritikamishra5822@gmail.com>
src/libs/SearchAutocompleteUtils.ts
Outdated
| return actionList.includes(range.value); | ||
| case CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY: | ||
| return categoryList.get().includes(range.value); | ||
| // Highlight if value is a known category OR one of the empty-category synonyms (e.g., "none", "Uncategorized") |
There was a problem hiding this comment.
Update this to Treat the empty category as selected if any of its synonyms (e.g., "none", "uncategorized") appear in filterValues.
src/libs/SearchQueryUtils.ts
Outdated
| const emptyCategories = CONST.SEARCH.CATEGORY_EMPTY_VALUE.split(','); | ||
| const hasEmptyCategoriesInFilter = emptyCategories.every((category) => filterValues.includes(category)); | ||
| // We split CATEGORY_EMPTY_VALUE into individual values to detect both are present in filterValues. | ||
| // Consider the empty category selected if ANY of its synonyms are present (e.g., "none" OR "Uncategorized") |
There was a problem hiding this comment.
Update to Return true if the value is a known category or one of the empty-category synonyms (e.g., 'none', 'uncategorized').
|
@chiragsalian we have one more bug: when the suggestions list contains "category:Uncategorized" and we start typing "category:Un", the "category:Uncategorized" option gets filtered out. This doesn’t happen with other options. This isn’t in the scope of this issue and definitely has a different RCA. Should we fix it in this PR since it’s strongly related to the flow we’re fixing here? @Rkdev09 can look into the RCA, post it here, and we can apply the fix. Monosnap.screencast.2025-11-28.17-40-34.mp4 |
|
Yes @Krishna2323 I also noticed that and I can look into it if asked to. |
|
@chiragsalian friendly bump to check this comment. |
JmillsExpensify
left a comment
There was a problem hiding this comment.
I'm good with the changes in this PR, though I'm going to create a separate internal convo about how we best handle the "no category" search operator versus a search operator for someone looking to search for '"Uncategorized"`
Yeah since its not in the scope of this issue and is a bug that exists on main, I would prefer we tackle it in a separate issue. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@Rkdev09 could you please merge main? Thanks! |
|
The failing ESLint check is on main. |
|
@Rkdev09 I think you forgot to address these comment. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_native.mp4Android: mWeb Chromeandroid_chrome.mp4iOS: HybridAppios_native.mp4iOS: mWeb Safariios_safari.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
@Rkdev09 also include 5th testing step: Verify "uncategorized" chip is highlighted. Let me know once you update this and handle all the comments. |
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
4e787ef to
6e80854
Compare
Signed-off-by: Ritika mishra <ritikamishra5822@gmail.com>
|
@Krishna2323 I have updated the branch, tests and comments. Thanks! |
chiragsalian
left a comment
There was a problem hiding this comment.
LGTM, can you address the new merge conflicts.
|
@chiragsalian the issue is fixed in #76840, I think we can close the PR. |
Explanation of Change
Fixed Issues
$ #75311
PROPOSAL: #75311 (comment)
Tests
Pre-condition: There are some expenses in the workspace created without any category.
Steps:
category:UncategorizedOffline tests
Pre-condition: There are some expenses in the workspace created without any category.
Steps:
category:UncategorizedQA Steps
Same as tests
Verify that no errors appear in the JS console
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android-app.mov
Android: mWeb Chrome
android-browser.mov
iOS: Native
ios-app-og.mp4
iOS: mWeb Safari
ios-app.mp4
MacOS: Chrome / Safari
REC-20251126184624.mp4