82304: Search - The workspace with the same name is not displayed in the autocomplete#82784
82304: Search - The workspace with the same name is not displayed in the autocomplete#82784abbasifaizan70 wants to merge 12 commits intoExpensify:mainfrom
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@aimane-chnaif 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a1073b768
ℹ️ 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".
src/components/Search/SearchRouter/getUpdatedSubstitutionsMap.ts
Outdated
Show resolved
Hide resolved
PR ReviewThe approach is sound — using index-based substitution keys to disambiguate workspaces (and potentially other entities) that share the same display name is a clean solution. A few items to address: 1. Duplicated substitution-key logic — extract to a shared helperThe 8-line block that parses the query, counts same-key ranges, and builds the substitution key is copy-pasted identically between 2. Unsafe
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c02a00d48
ℹ️ 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".
src/components/Search/SearchRouter/getQueryWithSubstitutions.ts
Outdated
Show resolved
Hide resolved
|
@aimane-chnaif Refactored code and added unit test cases. Thanks |
|
Are all AI reviews addressed? |
|
@aimane-chnaif, yes, all AI feedback is addressed. CI is failing because someone else made changes. I'll update it in the main. |
|
@aimane-chnaif PR is ready for review. Thanks. |
Search - The workspace with the same name is not displayed in the autocomplete
Explanation of Change
Fixes Reports search so multiple workspaces that share the same name can all be picked from workspace: autocomplete by storing each choice under an index-based substitution key (policyID:Name, policyID:Name:1, …) instead of one key per name. It also keeps substitutions in sync when the query is edited (e.g. removing a duplicate) by remapping ordered IDs and by always applying the updated substitution map in the page header, including when it becomes empty.
Fixed Issues
$ #82304
PROPOSAL: #82304 (comment)
Tests
workspace:and verify the autocomplete list appears.Offline tests
Same as tests.
QA Steps
Same as tests.
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
Screen.Recording.2026-04-07.at.8.28.22.PM.mov
Android: mWeb Chrome
Screen.Recording.2026-04-07.at.8.18.41.PM.mov
iOS: Native
Screen.Recording.2026-04-07.at.8.13.18.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-04-07.at.8.16.16.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-04-01.at.5.03.09.AM.mov