fix: prevent download button flash when opening broken image attachment v2#92164
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.
|
|
@suneox The PR is ready for review. Could you please a take a look when you get a chance? thanks |
JmillsExpensify
left a comment
There was a problem hiding this comment.
No product review required.
I'll take another look tomorrow |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-06-06.at.21.52.16.5.mp4Android: mWeb ChromeCleanShot.2026-06-06.at.21.48.55.4.mp4iOS: HybridAppCleanShot.2026-06-06.at.21.38.13.3.mp4iOS: mWeb SafariCleanShot.2026-06-06.at.21.29.18.2.mp4MacOS: Chrome / SafariCleanShot.2026-06-06.at.21.26.23.1.mp4 |
|
🚧 @cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Explanation of Change
This change prevents the download button from appearing before an image preview successfully loads. If the preview fails, the attachment is marked as failed and the download button remains hidden, keeping the UI consistent with the broken attachment state.
The modal tracks the active preview source so the download button visibility remains correct when navigating between attachments.
Non-image attachments continue using the existing download behavior.
Fixed Issues
$ #90322
PROPOSAL: #90322 (comment)
Tests
in any chat and sendOffline tests
Same as Tests.
QA Steps
Same as Tests.
// TODO: These must be filled out, or the issue title must include "[No QA]."
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
Screen.Recording.2026-05-18.at.8.51.27.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-05-18.at.8.59.16.AM.mov
iOS: Native
Screen.Recording.2026-05-18.at.9.12.45.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-05-18.at.9.15.42.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-18.at.8.43.07.AM.mov