Repository navigation
Allow edit input for SplitListItem when there is negative value - #74189
Conversation
…thSymbolForm and SplitListItem components. Update MoneyRequestUtils to ensure proper toggling of negative amounts and adjust related tests for expected behavior.
|
@ZhenjaHorbach 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] |
| [splitItem], | ||
| ); | ||
|
|
||
| const isBottomVisible = !!splitItem.category || !!splitItem.tags?.at(0); |
There was a problem hiding this comment.
❌ PERF-6
Passing entire splitItem object as a dependency causes the callback to be recreated whenever any property of splitItem changes, even unrelated ones. This defeats the purpose of memoization and can trigger unnecessary re-renders.
Specify individual properties as dependencies instead:
const onSplitExpenseAmountChange = useCallback(
(amount: string) => {
splitItem.onSplitExpenseAmountChange(splitItem.transactionID, Number(amount));
},
[splitItem.onSplitExpenseAmountChange, splitItem.transactionID],
);
JmillsExpensify
left a comment
There was a problem hiding this comment.
Looks good on behalf of product-pr. This is cleaning up the behavior around negative values and splits.
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.
|
| (amount: string) => { | ||
| splitItem.onSplitExpenseAmountChange(splitItem.transactionID, Number(amount)); | ||
| }, | ||
| // eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps |
There was a problem hiding this comment.
Do we really need not to pass all dependencies?
If yes, could you please leave a comment on why we don't pass?
There was a problem hiding this comment.
The problem is that linter want to pass whole splitItem object to be passed as a dependency but the AI Reviewer dont like it and I think its a valid point that we shouldn't pass object as a dependency as it will recreate the callback each time some props of the object change even though it not have an impact on our callback, will leave a comment
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-01-27.10.04.26.movAndroid: mWeb Chrome2026-01-27.10.04.26.moviOS: HybridApp2026-01-27.09.51.28.moviOS: mWeb Safari2026-01-27.09.55.16.movMacOS: Chrome / Safari2026-01-27.09.37.13.movDetails |
|
I suppose we need to update 2025-11-06.16.26.23.mov |
|
And I suppose we can change sign even when the original amount is not negative 2025-11-06.16.29.19.mov |
|
When we split a transaction with a negative amount 2025-11-06.16.31.21.movAlso, on the edit split screen 2025-11-06.16.32.31.mov |
|
hey @ZhenjaHorbach I will be checking this today |
|
@ZhenjaHorbach not sure about this issue
whats wrong here I think this is correct behaviour now no? |
Now we can use - sign only when the original transaction amount is negative |
|
And that possible now also in ND, no ? Or I don't understand the issue 😅 Screen.Recording.2025-11-07.at.17.16.27.mov |
Strange |
|
Hey @ZhenjaHorbach I think I fixed all the issues beside this
As this is something I need to investigate as the transaction in onyx for this transaction have positive sign and needs to check if this is maybe a BE issue but will check next week. Also we can treat it as a seprate issue and fix it in the follow up issue because its actually not related to original issue. I will be off monday and tuesday and will be back to this on Wednesday. |
|
Yeah I think that's a better idea, Shawn |
|
@kubabutkiewicz |
|
@ZhenjaHorbach yes, working on this, checking why the changing of keyboardType is not working even I pass hardcoded different type to our input component 😅 |
|
@ZhenjaHorbach Its done |
|
LGTM! |
|
@kubabutkiewicz there are conflicts |
|
Will resolve soon |
|
🚧 @lakchote 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! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.13-1 🚀
|
|
🚀 Deployed to staging by https://github.com/lakchote in version: 9.3.15-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.3.15-10 🚀
|

Explanation of Change
Fixed Issues
$ #63311
PROPOSAL:
Tests
Try to clear or use backspace to delete the amount.
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
same as test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop