Repository navigation
refactor: remove unsafe assertions from report header, business summary, backTo cleanup and tags page - #103170
Conversation
… navigation Seatbelt-Operation: fresh-81455935-sign-292d2ecd-a99e-4fb7-ace8-e412313bdd9f
Seatbelt-Operation: empty-81455935-sign-54ee0768-e8ae-4838-9a65-6ac5b12efd07
Seatbelt-Operation: 55691ed8-0690-4024-b3f1-b6921b0018d4
Seatbelt-Operation: main-20261030-103170-sign-2ae4dc35-cf05-4c44-8a9d-2ffbe58e0cdc
Resolve the WorkspaceTagsPage conflict from main's file and drop a branch that never runs. Remove the new test files, which did not cover changed behaviour.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
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 |
|
No product review needed. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safaritest1.movtest2.movtest3.movtest4.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 removes unsafe type assertions without changing user-facing behavior, introducing features, renaming UI elements, or removing beta gates. |
Explanation of Change
Remove unsafe
ascasts from the report header actions, the non-USD business summary, the stalebackTocleanup and the workspace tags page.MoneyReportHeaderActions: the primary action is looked up inCONST.REPORT.PRIMARY_ACTIONS. The dropdown ref keeps its realRefObject<... | null>type, soMoneyReportHeaderSecondaryActionsaccepts that type.Confirmation(non-USD business info): country, state and province names are read through string-keyed views of the code maps, without casts.cleanStaleReportActionBackToParam: routes are walked with a smallRouteViewtype that matches both full and partial navigation states.backTois read with anincheck, because each screen has its own params.WorkspaceTagsPage: the selection update reads only single-level tags. Multi-level tag rows cannot be selected (seeisSelectionEnabled), so the removed multi-level branch never ran.getPendingActionreadspendingActionwithout a cast; the formatter joins that ternary onto one line.No behavior change.
Changed files
src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsxsrc/components/MoneyReportHeaderActions/index.tsxsrc/pages/ReimbursementAccount/NonUSD/BusinessInfo/subSteps/Confirmation.tsxsrc/pages/inbox/cleanStaleReportActionBackToParam.tssrc/pages/workspace/tags/WorkspaceTagsPage.tsxFixed Issues
$ #94739
PROPOSAL: #94739 (comment)
Tests
C01 Selected single-level tag rename and deletion
Precondition: Web only (Chrome or Safari, desktop or mobile browser), because the case needs two browser tabs. Signed in as a workspace admin. The workspace has single-level tags
AlphaandBeta. Open Workspaces, select the workspace, then Tags, in two browser tabs.Alpha. On a wide layout, check its checkbox. On a narrow layout, long pressAlphaand choose Select.AlphatoAlpha renamed.Alpha renamedstays selected in the first tab.Alpha renamed.Betais still listed.C02 Multi-level tag list
Precondition: Signed in as an admin of a Control workspace with two independent multi-level tag lists, each with two enabled tags. To create them, open Workspaces, select the workspace, open Tags, choose More > Import spreadsheet, pick Multi-level tags, upload a CSV with two tag columns and check These are independent tags.
C03 Report actions, selection and layout
Precondition: A report with at least two expenses that you can edit.
C04 Deleted linked action and safe Back
Precondition: Web only (Chrome or Safari, desktop or mobile browser), because the case needs two browser tabs. A report with one expense whose preview is in its parent chat. Two browser tabs signed in to the same account.
C06 Non-USD business info summary
Precondition: Signed in as an admin of a workspace whose default currency is CAD. In Workflows, turn on Payments and choose Add bank account. Continue to the business info step.
No new tests are added, because the casts are removed without a behavior change. The existing
cleanStaleReportActionBackToParamTest,WorkspaceTagsTest,MoneyReportHeaderActionsPlacementTestandMoneyReportHeaderSelectionModeTestsuites cover the changed code.Offline tests
C05 Multi-level pending feedback and reconnect
Precondition: The workspace from C02, loaded while online.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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 (9)
C01 desktop
103170-c01d.mp4
C02 desktop
PR-103170-C02-D.mp4
C02 phone-sized
PR-103170-C02-M.mp4
C03 desktop and phone-sized
PR-103170-C03-DM.mp4
C04 desktop
PR-103170-C04-D.mp4
C04 phone-sized
PR-103170-C04-M.mp4
C05 desktop
PR-103170-C05-D.mp4
C05 phone-sized
PR-103170-C05-M.mp4
C06 desktop
103170-C06-desktop.mp4