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 ChromeScreen_Recording_20260813_180109_Chrome.mp4iOS: HybridAppScreen.Recording.2026-08-13.at.6.41.53.PM.moviOS: mWeb SafariScreen.Recording.2026-08-13.at.6.53.41.PM.movMacOS: Chrome / SafariScreen.Recording.2026-08-13.at.5.56.28.PM.mov |
|
@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. |
|
@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
|
Address all your comments. It's now ready for your another review @marufsharifi |
| onPress={callFunctionIfActionIsAllowed(() => switchToDelegator(login))} | ||
| /> | ||
| )} | ||
| {!!accountID && !isAnonymousUserSession() && !!login && ( |
There was a problem hiding this comment.
This also renders on the current user's own profile.
There's no !isCurrentUser guard, so viewing your own profile shows "Search this user" (searching your own messages). The QA steps only cover other users/agents. The issue says "all profiles", so this may be intended @Expensify/design could you please confirm this. thanks.
F1.mov
|
@Expensify/design what do you all think of this? I'm not really sold. "Search this user" feels super ambiguous to me. |
|
Agree with your placement suggestion. And I think I like |
|
Agree with Shawn and Danny. Both placement and wording feels better with their suggestions. |
It's right below the copilot menu item. I forgot to update the screenshots after discussing on Slack, let me update it Screen.Recording.2026-08-10.at.10.06.23.mov |
|
just to confirm, with agent we will show: |
|
Oh I didn't realize we were doing this for regular users too but I guess that makes sense. |
|
I see. I'll update it shortly. Thanks for confirmation 🙏 |
|
Updated Screen.Recording.2026-08-12.at.23.11.15.mov |
|
I think that looks good 👍 |
|
checking again. thanks. |
|
@hungvu193, could you please check this. thanks.
|
|
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 bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
Fixed. Can you verify again? Screen.Recording.2026-08-14.at.09.05.28.mov
|
marufsharifi
left a comment
There was a problem hiding this comment.
Looks good, bug some minor suggestions.
| searchThisUser: 'View user history', | ||
| searchThisAgent: 'View agent history', |
There was a problem hiding this comment.
NAB: Key name doesn't match the copy (naming nit, not a STYLE.md blocker)
These keys are named searchThisUser / searchThisAgent, but the value in every locale reads "View … history" (e.g. de.ts: 'Nutzerverlauf anzeigen', es.ts: 'Ver historial del usuario'). The naming is at least consistent across all 11 locale files, so it's purely cosmetic — but anyone grepping for the "search" copy won't find it, and vice-versa.
MY Suggestion
- Rename the keys to
viewUserHistory/viewAgentHistory(matches the copy
| )} | ||
| {shouldShowNotificationPreference && ( | ||
| <MenuItemWithTopDescription | ||
| {!!accountID && !isAnonymousUserSession() && !!login && ( |
There was a problem hiding this comment.
Missing test — the !!login false-branch of this guard is uncovered (failure path).
This guard has three && conditions, but the tests only exercise the TRUE render and the isAnonymousUserSession() hide. The !!login branch is untested and it's genuinely reachable — login = details?.login ?? '', so any profiled account whose personal details lack a login (e.g. an optimistic/unvalidated account) will hide this entry.
Please add a test in tests/ui/ProfilePageTest.tsx, inside the ProfilePage - View user history describe:
it('hides the search entry when the profile has no login', async () => {
// seed personalDetails[123] WITHOUT a login → login resolves to ''
// render, then:
expect(screen.queryByText('View user history')).not.toBeOnTheScreen();
expect(screen.queryByText('View agent history')).not.toBeOnTheScreen();
});| 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.
Low Consistency question rawQuery
Other Search entry points pass both query and rawQuery, e.g. CardSection.tsx:123:
ROUTES.SEARCH_ROOT.getRoute({query, rawQuery: query})
Here only query is passed. Is omitting rawQuery intentional for this chat search, or should it match the other call sites?





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-10.at.10.06.23.mov