fix: default to thumbnail images for all ReceiptCells - #67329
Conversation
|
@shubham1206agra 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] |
| const filename = getFileName(source); | ||
| const receiptURIs = getThumbnailAndImageURIs(transactionItem, null, filename); | ||
| const isReceiptPDF = Str.isPDF(filename); | ||
| source = tryResolveUrlFromApiRoot(isReceiptPDF && !receiptURIs.isLocalFile ? (receiptURIs.thumbnail ?? '') : (receiptURIs.image ?? '')); |
There was a problem hiding this comment.
Don't we still need the isLocalFile check? Doesn't that mean the file is local and thus we don't have thumbnails since those are generated in the server?
There was a problem hiding this comment.
// For local files, we won't have a thumbnail yet
if ((isReceiptImage || isReceiptPDF) && typeof path === 'string' && (path.startsWith('blob:') || path.startsWith('file:'))) {
return {image: path, isLocalFile: true, filename};
}
@iwiznia This is the implementation inside getThumbnailAndImageURIs
There was a problem hiding this comment.
If there's no thumbnail, it'll still fallback to the .image property so should gracefully handle local files as well
Reviewer Checklist
Screenshots/VideosScreen.Recording.2025-07-30.at.7.30.32.PM.mov |
|
@adhorodyski Can you fix the ESLint here? |
|
On it, actually reverting back to use |
mountiny
left a comment
There was a problem hiding this comment.
Excited for this one, thanks!
|
✋ 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/mountiny in version: 9.1.88-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|
@shubham1206agra @mountiny
Explanation of Change
We're using regular, full scale images for rendering 40x40 previews of expense receipts in the Search view. This PR fixes it by simplifying the condition so it uses Thumbnail -> Full -> None.
See linked screenshots from Web for before/after.
Fixed Issues
$ #67408
PROPOSAL: https://expensify.slack.com/archives/C05LX9D6E07/p1752674104265959?thread_ts=1752517904.944139&cid=C05LX9D6E07
Tests
Offline tests
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop