Use 1024px thumbnail instead of full-size original in receipt preview#87163
Conversation
The wide RHP was loading full-size original receipt images (~800KB avg) instead of 1024px thumbnails (~140KB avg) when viewing expense details. This was caused by the shouldUseThumbnailImage flag being false when fillSpace is true, which made the source fall through to the original image URL. Always use the thumbnail source for inline receipt previews; full-size originals are still loaded when opening the full-screen lightbox.
|
🚧 @justinpersaud has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
|
|
🚧 @luacmartins 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.53-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. This change is a performance optimization that switches inline receipt previews from loading full-size originals to 1024px thumbnails. It doesn't affect any user-facing behavior, UI labels, settings, or workflows — users still see receipts in the same places and can still open full-size images in the lightbox. I reviewed all receipt-related articles under |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.3.53-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.53-7 🚀
|
Explanation of Change
The wide RHP loads receipt images with
fillSpace={true}, which setsshouldUseThumbnailImagetofalseinReportActionItemImage. This caused the component to load the full-size original receipt image instead of the 1024px thumbnail (.jpg.1024.jpg).Cloudflare analytics show full-size receipt originals (~800KB avg) account for ~75% of all receipt image bandwidth (~12 TB/week at peak). The 1024px thumbnail (~140KB avg) is more than sufficient for the wide RHP viewport (typically rendered at ~400px wide). Users can still access the full-size original by opening the receipt in the full-screen lightbox, which uses a separate code path (
TransactionReceiptModalContent) unaffected by this change.This change always uses
thumbnailSource(the 1024px variant) for inline receipt previews, regardless of theshouldUseThumbnailImageflag.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/620914
Tests
.jpg.1024.jpg(1024px thumbnail), not.jpg(full-size original).jpg)Offline tests
N/A — receipt images already show a loading state when offline. This change only affects which URL is requested.
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)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots/Videos
MacOS: Chrome / Safari
Verified via Playwright browser automation:
.jpg.1024.jpg(1024px thumbnail) ✓.jpg(full-size original) ✓