-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix group-by autocomplete appearing in chat searches #79804
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
base: main
Are you sure you want to change the base?
Conversation
|
@chuckdries 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] |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bd82a9e9f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const groupByAutocompleteList = useMemo(() => { | ||
| // Only show group-by suggestions if the user has explicitly set a type filter | ||
| if (!typeFilter) { | ||
| return []; | ||
| } |
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.
Allow group-by suggestions for default expense searches
This guard suppresses group‑by suggestions whenever the user hasn’t explicitly typed type:…, but the search parser defaults type to expense (see src/libs/SearchParser/searchParser.peggy defaultValues), and group‑by is valid for expense/invoice/trip. That means on the normal Search page, typing group-by: with an empty query will now show no suggestions even though the filter is valid, which is a regression in autocomplete discoverability beyond the Chat Finder use case this change targets.
Useful? React with 👍 / 👎.
|
@chuckdries @trjExpensify please ignore this PR |
Explanation of Change
Prevents group-by autocomplete suggestions from appearing in Reports > Chats search when no explicit type filter is present.
In
SearchAutocompleteList.tsxline 227, when parsing the autocomplete query, if no explicittype:filter exists, the system defaults toCONST.SEARCH.DATA_TYPES.EXPENSE. This caused thegroupByAutocompleteListcomputation to return expense-related group-by options (from, card, withdrawal-id) even when searching in the Chats view.Added a guard condition to only return group-by suggestions when a
typeFilterexplicitly exists in the query. This ensures group-by suggestions only appear when the user has set a search type that supports grouping (expense, invoice, trip).Fixed Issues
$ #79801
PROPOSAL: N/A (Internal issue)
Tests
Offline tests
N/A - Search functionality works the same offline
QA Steps
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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Before (Bug):
Typing "group-by:" in Chats view shows incorrect suggestions
After (Fixed):
Typing "group-by:" in Chats view shows no suggestions
Typing "type:expense group-by:" shows correct suggestions