Show confirmation modal for distance rate error and block expense split - #75984
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
@Ollyws What do you think about this hint text when creating a report? |
@srikarparsi Could you help update this from the backend side? Screen.Recording.2025-11-25.at.15.41.25.mov1 When we call cc @Ollyws |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@srikarparsi #75984 (comment) Could you check it when you have time? |
|
Hey @huult, didn't get a chance to do this today, will see if I get time for it tomorrow |
|
@srikarparsi friendly bump |
|
Hey @huult, just to clarify, is this what is needed from the backend?
|
|
@srikarparsi Yes, that’s correct. |
|
@srikarparsi Don’t forget this. Many thanks 😄 |
|
Hey @huult, this is taking time because it's a little complicated and I'm working on some higher priority bank account work. I'll see if I can get to this by the end of the week otherwise I'll see if anyone else can take over. |
|
@srikarparsi Do you have any updates or an estimate for this? |
Hey @huult, I've been OOO last week and will be this week as well for the holidays. I'll try to give you an update towards the end of this week. |
|
Hey @huult, re-visiting this after OOO, I think the root problem here is that we are not handling the When we move a split request from a self dm to a workspace, we might get this violation:
And if this violation exists, then the frontend doesn't call |
|
@srikarparsi I know we could call the default rate on the frontend as a solution. However, I’d like to understand what the backend solution would look like. If we update the rate automatically in changeTransactionsReport on the backend, then the frontend wouldn’t need to handle this more complex logic. If the backend solution is significantly more complex, then we can decide to handle it on the frontend instead. Please share your thoughts on whether we should solve this on the frontend or backend in this case. |
|
Let's say that through another flow, the distance request gets a rate out of policy violation. Then the same problem would remain right? So that's why I'm thinking that this is the root problem that needs to be fixed: Splitting a distance request with a rate out of policy violation silently fails. I think we can still do what you're suggesting (updating the rate automatically when the distance request moves policies) but I believe the above is the core problem that needs to be fixed. What do you think? |
|
@srikarparsi When we automatically update the rate in Flows:
|
|
I understand that automatically converting the the distance rate when the policy is switched would also fix the issue (and maybe we should do that too), but the root problem in my eyes is that we are not properly handling splitting distance requests that have a rate out of policy violation and I think that is the bug we need to fix. In the future, there might be other flows that lead to a distance rate being invalid (out of policy), and fixing this root problem would handle these cases as well. |
@srikarparsi Yeah, I understand your point. In that case, defining a new flow would mean that when we are splitting distance requests that have an out-of-policy rate, we should show a screen prompting the user to update the rate to a valid one before allowing the split. If we decide to go in this direction, I can research it further, propose a new flow, and loop in Product and Design to get their feedback. |
c0fa584 to
3779ccf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea88d279e8
ℹ️ 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".
|
@Ollyws @srikarparsi This PR is ready for review |
…lit-distance-manual-expense
…lit-distance-manual-expense
…lit-distance-manual-expense
…lit-distance-manual-expense
| const customUnitOutOfPolicyViolation = CONST.VIOLATIONS.CUSTOM_UNIT_OUT_OF_POLICY; | ||
| const hasDistanceRateError = | ||
| currentTransactionViolations.some((violation) => violation.name === customUnitOutOfPolicyViolation) || | ||
| originalTransactionViolations.some((violation) => violation.name === customUnitOutOfPolicyViolation); |
There was a problem hiding this comment.
Just for clarity, when exactly would this be populated?
Reviewer Checklist
Screenshots/Videos |
…lit-distance-manual-expense
|
✋ 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/srikarparsi in version: 9.3.11-16 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.3.12-1 🚀
|







Details
Fixed Issues
$ #74315
PROPOSAL: #74315 (comment)
Tests
Same QA step
Offline tests
QA Steps
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
Screen.Recording.2026-01-22.at.13.50.26.mp4
Android: mWeb Chrome
Screen.Recording.2026-01-22.at.13.52.27.mp4
iOS: Native
Screen.Recording.2026-01-22.at.13.59.22.mp4
iOS: mWeb Safari
Screen.Recording.2026-01-22.at.14.01.16.mp4
MacOS: Chrome / Safari
Screen.Recording.2026-01-22.at.13.46.17.mp4