Repository navigation
feat: Add Tax, Billable, and Reimbursable selectors in the Split details page - #94434
Conversation
|
@codex review |
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bccd150adf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@hoangzinh 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b4042d749
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| reimbursable: transactionDetails?.reimbursable, | ||
| billable: transactionDetails?.billable, |
There was a problem hiding this comment.
Preserve edited flags in existing split updates
Saving these new per-split reimbursable/billable values here only works for brand-new split creation. In the existing-split update path, updateSplitTransactions overwrites currentSplit.reimbursable and currentSplit.billable from the old splitTransaction before building the final UPDATE_SPLIT_TRANSACTION payload, so toggling either switch on an already-created split appears to save locally but the API receives the old values and the change is lost on sync.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@MelvinBot Explain more about this concern
There was a problem hiding this comment.
The reviewer is flagging a mismatch between where you write the toggled values and where they get consumed when the split already exists on the server.
What the reviewer means
-
In
updateSplitExpenseFieldyou correctly copy the edited values into the draft split —SplitExpenseItems.ts:620-621. That's fine for the draft. -
But in
updateSplitTransactions, the existing-split path (if (splitTransaction)) overwrites those values back to the old server values before building the field-change payload —SplitTransactionUpdate.ts:749-752:currentSplit.reimbursable = splitTransaction.reimbursable; currentSplit.billable = splitTransaction.billable;
transactionChangesis built from{...currentSplit}just above at:736, so after this overwritereimbursable/billableequal the old values. The diff loop at:754then deletes any key wherenewValue === oldValue, so those two fields drop out oftransactionChangesand never reachgetUpdateMoneyRequestParamsat:796. For a brand-new split (splitTransactionis falsy) this block is skipped — that's why the reviewer says it "only works for brand-new split creation."
Does it still hold on the current commit?
Partly. The splits API param now carries the new values — SplitTransactionUpdate.ts:278-279 — so the server side should persist a toggle on an existing split. The gap the overwrite still leaves is on the optimistic/local side: because the fields are stripped from transactionChanges, the individual split transaction's optimistic Onyx update (and its modifiedExpense action) won't reflect the toggle until the server response arrives. So offline, or in the moment right after saving, the split can still show the old reimbursable/billable.
How to confirm: toggle reimbursable/billable on an already-created split, save while offline (or watch the split's transaction in Onyx before the API responds), and check whether it reflects the new value immediately. If it snaps back to the old value until the response lands, the concern is real for the optimistic path and worth fixing (e.g. don't reset currentSplit.reimbursable/billable to the old values, or add them explicitly to transactionChanges). If it updates immediately, it's already covered.
There was a problem hiding this comment.
I tested and it fine
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-08-04.at.18.12.43.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-04.at.18.05.19.mov |
| splitExpense.taxAmount ?? | ||
| calculateIOUAmount(splitExpenses.length - 1, originalTransactionDetails?.taxAmount ?? 0, originalTransactionDetails?.currency ?? CONST.CURRENCY.USD, false), | ||
| taxValue: splitExpense.taxValue ?? originalTransactionDetails?.taxValue, | ||
| billable: originalTransactionDetails?.billable, |
There was a problem hiding this comment.
Can you check if we can update billable and reimbursable for a split transaction?
| } | ||
|
|
||
| function updateSplitExpenseDraftField(fields: Partial<OnyxTypes.Transaction>) { | ||
| Onyx.merge(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${CONST.IOU.OPTIMISTIC_TRANSACTION_ID}`, fields); |
There was a problem hiding this comment.
Should we pass transactionID, instead of hardcoded CONST.IOU.OPTIMISTIC_TRANSACTION_ID?
There was a problem hiding this comment.
I think we can leave it as is, since none of the current callers need to pass a transaction ID other than CONST.IOU.OPTIMISTIC_TRANSACTION_ID.
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.58-0 🚀
|
|
🤖 Help site docs review — changes required. This PR adds Tax, Reimbursable, and Billable fields to the individual split edit screen (gated by the workspace's tax tracking / rules settings). The existing help article Draft PR: #99126 What changed in the docs
Labels verified against @truph01, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #99131 was identified to be related to this PR. |
|
Deploy Blocker #99133 was identified to be related to this PR. |
|
Deploy Blocker #99138 was identified to be related to this PR. |
|
Deploy Blocker #99140 was identified to be related to this PR. |
|
Deploy Blocker #99142 was identified to be related to this PR. |
|
Deploy Blocker #99144 was identified to be related to this PR. |
|
Deploy Blocker #99147 was identified to be related to this PR. |
|
Deploy Blocker #99198 was identified to be related to this PR. |
|
Deploy Blocker #99200 was identified to be related to this PR. |
|
Deploy Blocker #99205 was identified to be related to this PR. |
|
Deploy Blocker #99211 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.58-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
src/types/onyx/IOU.ts— AddtaxCode?: string,taxAmount?: number,taxValue?: numberto theSplitExpenseinterface.SplitExpenseEditPage.tsx— Add UI rows for Tax Rate, Reimbursable, and Billable (gated by the appropriate policy flags), navigating to the existingMONEY_REQUEST_STEP_TAX_RATE,MONEY_REQUEST_STEP_BILLABLE, andMONEY_REQUEST_STEP_REIMBURSABLEroutes.SplitExpenseItems.ts(initSplitExpenseItemData) — SeedtaxCode/taxAmount/taxValuefrom the parent transaction when initializing split items.SplitExpenseItems.ts(updateSplitExpenseField) — CarrytaxCode/taxAmount/taxValuethrough from the draft transaction when saving a split edit.SplitTransactionUpdate.ts— IncludetaxCode/taxAmount/taxValuein thesplitsAPI payload and in the optimistic Onyx merge.SplitTransactionSplitsParamtype — AddtaxCode,taxAmount,taxValuefields.Fixed Issues
$ #94038
PROPOSAL: #94038 (comment)
Tests
Test 2:
Test 3:
Test 4:
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-07-08.at.16.51.54.mov