Repository navigation
Conversation
…ndaries Seatbelt-Operation: run3-sign-487afbb7-ef00-4b92-ad0e-0b753237cc33
Seatbelt-Operation: run3-sign-ci-repair-76d2aedb-0961-4c6b-93e0-3b145163ae39
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Seatbelt-Operation: remaining-102992-oneoff-sign-9c981f06-2963-45f2-b2d2-084f0586522e
Seatbelt-Operation: main-20261030-102992-sign-605530c5-46a1-4957-9de5-c17610d69fb4
Address review patterns before review. The image and file-upload changes are left to Expensify#103173 and Expensify#103963, which own those files. ImageView and Lightbox take a URL or a static image asset, so a numeric asset is passed to the image as is instead of as {uri: number}. AttachmentView only opens the PDF viewer and ImageView for sources they can show. The 1,051-line render test is replaced by one focused test for the static asset case.
Take the Avatar, ReceiptImage and attachment-state changes that Expensify#102992 also made, so the image typing lives in one PR. Reuse the Avatar style type instead of repeating it, and keep the existing error for an image without a source. Drop the BaseImage test, which only covered a type change.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@situchan Could you please review this PR when you get a chance? Thanks! |
…View props ImageView renders Lightbox, so Lightbox should not take its uri type from ImageView. Both components use string | number directly.
|
No product review needed. |
Seatbelt-Operation: reviewer-followup-20261115-102992-sign-5c638cb5-3430-426e-84a0-98b3d62c5b20
|
@situchan, could you please review this PR again? Merged |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 blimpich 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/blimpich in version: 9.5.41-0 🚀
|
|
No help site update needed — this PR fixes attachment rendering and handles unsupported source types without adding a feature, changing a documented workflow, or making an existing article inaccurate. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.5.41-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Remove the unsafe
as stringassertions from the attachment viewer.ImageViewandLightboxnow take a URL or a static image asset (string | number). A static asset is passed to the image as is, instead of as{uri: 42}, which cannot load.AttachmentViewonly opens the PDF viewer for a string source, and only showsImageViewfor a URL or a static asset. It uses the fallback image only when it is a URL.Behavior change: an attachment whose source is an image object, not a URL or asset, now shows the default attachment view instead of an image that could not load. A PDF whose source is not a URL no longer opens the PDF viewer.
The image and avatar typing moved to #103173, and the receipt drop and file validation moved to #103963, so each file is changed by one PR.
Changed files
src/components/Attachments/AttachmentView/AttachmentViewImage/index.tsxsrc/components/Attachments/AttachmentView/index.tsxsrc/components/ImageView/index.tsxsrc/components/ImageView/types.tssrc/components/Lightbox/index.tsxtests/unit/ImageViewSourceTest.tsxFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
Use a signed-in test account with a chat you can write in.
C01 Image viewer
Precondition: a recognizable JPEG on the device.
C02 PDF and image switching
Precondition: a PDF with readable text, sent in the same chat as the C01 image.
ImageViewSourceTestchecks that a static image asset reaches the image unchanged, and that a URL is still wrapped as{uri}.Offline tests
C04 Local preview and reconnect
Setup: Open the JPEG’s local attachment preview before sending.
QA Steps
Same as tests.
PR 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
Screenshots/Videos (7)
C01 desktop
PR-102992-C01-D.mp4
C01 phone-sized
PR-102992-C01-M.mp4
C02 desktop
PR-102992-C02-D.mp4
C02 phone-sized
PR-102992-C02-M.mp4
C04 desktop
PR-102992-C04-D.mp4
C04 phone-sized part 1
PR-102992-C04-M-part1.mp4
C04 phone-sized part 2
PR-102992-C04-M-part2.mp4