Add search this user/agent to ProfilePage - #98091
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@marufsharifi 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: 2acb4278da
ℹ️ 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".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@hungvu193, could you please check the failure actions, when you get a chance. thanks. |
|
Fixed 😄. Btw, I'm asking for confirmation in Slack, so can you please hold the review for a while? |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@marufsharifi it's now ready |
|
I am testing it. thanks. |
| {!!accountID && !isAnonymousUserSession() && ( | ||
| <MenuItem | ||
| shouldShowRightIcon | ||
| title={translate(isAgentEmail(login) ? 'profilePage.searchThisAgent' : 'profilePage.searchThisUser')} | ||
| icon={expensifyIcons.MagnifyingGlass} | ||
| onPress={() => { | ||
| const query = buildQueryStringFromFilterFormValues({ | ||
| type: CONST.SEARCH.DATA_TYPES.CHAT, | ||
| from: [String(accountID)], | ||
| }); | ||
| Navigation.navigate(ROUTES.SEARCH_ROOT.getRoute({query})); | ||
| }} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
No automated coverage for this new feature.
This block has real branching worth locking down: the isAgentEmail(login) label choice, the !!accountID && !isAnonymousUserSession() visibility guard, and the exact query that gets built. A future refactor of buildQueryStringFromFilterFormValues, the CHAT filter allow-list, or the anonymous guard could silently break this with no signal.
Suggested minimal test in ProfilePageTest.tsx:
it('navigates to Search with type:chat from:<accountID> when tapped', () => {
fireEvent.press(screen.getByText('Search this user'));
expect(Navigation.navigate).toHaveBeenCalledWith(
ROUTES.SEARCH_ROOT.getRoute({query: expect.stringContaining('type:chat')}),
);
});
it('shows "Search this agent" for an agent email', () => { /* isAgentEmail login */ });| {!!accountID && !isAnonymousUserSession() && ( | ||
| <MenuItem | ||
| shouldShowRightIcon | ||
| title={translate(isAgentEmail(login) ? 'profilePage.searchThisAgent' : 'profilePage.searchThisUser')} |
There was a problem hiding this comment.
Label depends on login, which is empty until details load.
login = details?.login ?? '', so during the isLoading window (route accountID is known but details aren't yet) isAgentEmail('') is false. For an agent profile opened before details resolve, this renders "Search this user" and then flips to "Search this agent" once details load. Not blocking — just flagging the visible flicker to verify on a slow/high-traffic account.
| onPress={callFunctionIfActionIsAllowed(() => switchToDelegator(login))} | ||
| /> | ||
| )} | ||
| {!!accountID && !isAnonymousUserSession() && ( |
There was a problem hiding this comment.
Note: Anonymous handling differs from the other menu items here.
Other actions on this page gate via callFunctionIfActionIsAllowed(...) / isAnonymousAction, whereas this item hides entirely with !isAnonymousUserSession(). Hiding it is cleaner and fine — just noting the divergence so the pattern choice is intentional.
|
@MelvinBot Review |
Review — LGTM ✅The change is clean, minimal, and matches the "Chat with agent" pattern requested in the issue. I verified the feature end-to-end on web and it works as intended. What I checked
Live test (web): opened a profile → "Search this user" appears with the magnifying-glass icon → clicking it navigated to Two things worth confirming before approving:
I couldn't exercise the "Search this agent" label live (no |
garrettmknight
left a comment
There was a problem hiding this comment.
Looks good from a product perspective


Explanation of Change
Add "🔍 Search this user" (or "Search this agent") to all profiles to view all report actions of that user/agent.
Fixed Issues
$ #98076
PROPOSAL: N/A
Tests
Same as QA steps.
Offline tests
N/A
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Search this agentbutton > Click on itSearch this userPR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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-08-09.at.14.37.48.mov
Android: mWeb Chrome
Screen.Recording.2026-08-09.at.14.37.48.mov
iOS: Native
Screen.Recording.2026-08-09.at.14.33.53.mov
iOS: mWeb Safari
Screen.Recording.2026-08-09.at.13.33.44.mov
MacOS: Chrome / Safari
Screen.Recording.2026-08-09.at.13.16.51.mov