Repository navigation
refactor: remove unsafe assertions from expense, receipt, inbox and empty list components - #103225
Conversation
Seatbelt-Operation: e1844e21-3236-4a4c-9ca8-f6a46fbbce19
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Seatbelt-Operation: main-20261030-103225-sign-c9c98d63-51c8-4a34-82a5-a109799115cc
Resolve the DistanceRequestRenderItem conflict. Type translateZ0 and the empty state icon at their source, and remove the new test files, including an impossible malformed-input case.
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.
|
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? Merged
|
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaritest1.movtest2.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.52-1 🚀
|
|
No help site update needed — this PR only refactors TypeScript types and removes unsafe assertions, without changing user-facing behavior, labels, workflows, or beta availability. |
Explanation of Change
Remove four unsafe
ascasts from expense, receipt, inbox and empty list components.DistanceRequestRenderItem: the waypoint description key is typed as the two real translation keys (startorstop), sotranslate()needs noas TranslationPaths.EReceiptWithSizeCalculation: thetranslateZ0style type now says itstransformis a string, which both platform files already set. Theas stringis gone.EmptySelectionListContent: the CREATE/SUBMIT check compares the string directly, so theas ContentTypetype guard is gone.LHNEmptyState:useEmptyLHNIllustrationis typed to return icon props, which it always does. Theas BlockingViewPropsis gone.BlockingViewnow exportsBlockingViewIconPropsinstead ofBlockingViewProps, which nothing else used.No behavior change.
Changed files
src/components/BlockingViews/BlockingView.tsxsrc/components/DistanceRequest/DistanceRequestRenderItem.tsxsrc/components/EReceiptWithSizeCalculation.tsxsrc/components/EmptySelectionListContent.tsxsrc/components/LHNOptionsList/LHNEmptyState.tsxsrc/components/LHNOptionsList/useEmptyLHNIllustration/types.tssrc/styles/utils/translateZ0/type.tsFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
C01 Per diem receipt preview
Precondition: Web on a desktop browser, because the case needs hover and a resizable window. This case does not apply to Android, iOS or narrow layouts. A Control workspace with Per diem turned on in More features, and at least one per diem rate added with Per diem > Import spreadsheet. One per diem expense on that workspace, created with + > Create expense > Per diem.
C02 Empty Inbox
Precondition: An account with no unread chats and no to-dos.
C03 Distance waypoint labels
Precondition: None.
C04 Empty participant list
Precondition: Signed in.
qqzzxx.No new tests are added, because no behavior changes.
tests/ui/LHNItemsPresence.tsx,tests/unit/SidebarLinksTest.tsxandtests/ui/IOURequestStepDistanceTest.tsxrender the changed components.Offline tests
N/A. The change only affects local rendering, with no network, persistence or retry behavior.
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 (5)
C01 desktop
103225-C01-desktop.mp4
C02 desktop
PR-103225-C02-D.mp4
C02 phone-sized
PR-103225-C02-M.mp4
C03 desktop
103225-C04-desktop.mp4
C04 desktop
103225-C05-desktop.mp4