fix: mount a single discard-changes guard on the avatar screen#93425
Conversation
|
@thelullabyy 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] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
Please update the PR to follow the suggestion #93256 (comment) @yusufdeveloper2903 |
|
@thelullabyy Updated as suggested — extracted EditUserAvatarContent as a mirror of EditAgentAvatarContent, so ProfileAvatar now just selects between the two. Only a single discard-changes guard is mounted now |
|
@trjExpensify it looks like @yusufdeveloper2903 used the mock data account since agents feature is under beta flag. It should work fine when we use real account |
|
@yusufdeveloper2903 Please add recording to all other platforms |
|
@thelullabyy updated the PR recordings for all platforms are now added in the Screenshots/Videos section. The blank-screen flash is gone when navigating back from the agent Edit avatar screen on every platform.�� |
I believe that's unnecessary now, as of the last couple of days. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-06-17.at.19.32.21.movAndroid: mWeb ChromeScreen.Recording.2026-06-17.at.19.33.12.moviOS: HybridAppScreen.Recording.2026-06-17.at.19.29.07.moviOS: mWeb SafariScreen.Recording.2026-06-17.at.19.27.27.movMacOS: Chrome / SafariScreen.Recording.2026-06-17.at.19.26.07.mov |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/grgia in version: 9.4.15-0 🚀
|
|
🤖 No help site changes required. I reviewed the changes in this PR against the help articles under Why: This PR is a pure internal refactor. It splits
The avatar-related help articles (e.g. @yusufdeveloper2903, if you believe a behavior or label changed that I missed, reply with the specifics and I'll re-check and create a docs PR if warranted. |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.15-3 🚀
|

Explanation of Change
For agent accounts, the avatar screen (
AvatarPage.tsx) previously rendered the agentavatar content (
EditAgentAvatarContent) from inside the sameProfileAvatarcomponentthat also set up the full
ProfileUserAvatarscreen wrapper. Because the agent branch wasan early
returninsideProfileAvatar, both the parent screen and theEditAgentAvatarContentmounted their own discard-changes guards. This double guard causedthe brief blank screen when navigating back from the Edit avatar screen on an agent account.
This PR splits
ProfileAvatarinto two dedicated components:ProfileAgentAvatar� renders onlyEditAgentAvatarContent(with its single guard) for agent accounts.ProfileUserAvatar� the original regular-user avatar screen.ProfileAvatarnow just checksuseIsAgentAccount()and renders the correct component, soonly a single discard-changes guard is ever mounted. This removes the blank flash when going
back from the Edit avatar screen.
Fixed Issues
$ #93256
PROPOSAL: #93256 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
After fix:
after-fix-android.mp4
Android: mWeb Chrome
After fix:
After-fix-android-chrome.mp4
iOS: Native
After fix:
After-fix-ios-app.mp4
iOS: mWeb Safari
After fix:
After-fix-ios-safari.mp4
MacOS: Chrome / Safari
After fix MacOS Chrome:
After-fix-MacOS-chrome.mp4
After fix MacOS Safari:
After-fix-MacOS-safari.mp4
After fix Windows Chrome:
After-fix-windows-chrome.mp4