Remove Onyx.connect() usage for ONYXKEYS.COLLECTION.POLICY_TAGS from src/libs/actions/IOU/index.ts in splitBill, splitBillAndOpenReport, createDistanceRequest - #97077
Conversation
…e useOnyx on hook and components levels
…o handleMoneyRequestStepDistanceNavigation's callsites (hooks and components)
…yx-connect-policy-tags-in-IOU-createSplitsAndOnyxData-3
|
@codex review |
|
@parasharrajat 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] |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…ok to reduce multiple calls to useParticipantsPolicyTags hook
|
all comments addressed |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@parasharrajat ready for review! |
…-connect-policy-tags-in-IOU-createSplitsAndOnyxData-3
Explanation of Change
This PR is the last part of a refactor to remove
Onyx.connectfor the keys:ONYXKEYS.COLLECTION.POLICY_TAGSfrom thesrc/libs/actions/IOU/index.tsfile and replace it withuseOnyx.It removes the deprecated
buildParticipantsPolicyTags()function fromsrc/libs/actions/IOU/index.tsand threads an explicitparticipantsPolicyTagsparameter through theDuplicate.tscall sites (createExpenseByType,duplicateExpenseTransaction,duplicateReport,bulkDuplicateExpenses,bulkDuplicateReports) as well ashandleMoneyRequestStepDistanceNavigation. Call sites inuseExpenseActions,useBulkDuplicateAction, and the distance-request navigation hooks now resolve participants viagetMoneyRequestParticipantsFromReport()and deriveparticipantsPolicyTagsusing theuseParticipantsPolicyTagshook /getPolicyTagsSelectorhelper instead of reading from the globalallPolicyTagscollection.Fixed Issues
$ #72721
PROPOSAL:
Tests
1.splitBill
Go to a workspace chat (or workspace report) where distance/mileage tracking and tags are enabled.
Tap + -> Track/Submit distance, add a route/waypoints, then confirm the request.
Verify the distance expense is created with the correct policy tag applied.
Verify that no errors appear in the JS console
Offline tests
N/A
QA Steps
Same as tests.
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)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.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
MacOS: Chrome / Safari
Screen.Recording.2026-07-09.at.09.21.42.mov
Screen.Recording.2026-07-09.at.08.36.58.mov