feat: implement distance rate name edit page - #62535
Conversation
|
@ishpaul777 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-07-26.at.2.32.15.AM.movAndroid: mWeb ChromeScreen.Recording.2025-07-26.at.2.44.27.AM.moviOS: HybridAppScreen.Recording.2025-07-26.at.1.25.53.AM.moviOS: mWeb SafariScreen.Recording.2025-07-26.at.1.23.26.AM.movMacOS: Chrome / SafariScreen.Recording.2025-07-26.at.1.19.02.AM.movMacOS: DesktopScreen.Recording.2025-07-26.at.2.37.50.AM.mov |
|
will start reviewing today |
|
@mkzie2 can you make sure "Default Rate" is not renamable and, Thanks!
|
|
@mkzie2 bump! |
|
@ishpaul777 Seems like they're still discussing here #62099 (comment). |
|
Based on the latest discussion, we do not need to implement this one #62535 (comment). |
|
@mkzie2 Any updates? |
|
Replied here #62099 (comment) |
|
@mkzie2 lets get a update here and ping me when its ready |
|
Discussion is ongoing in the main issue thread. |
|
are you able to resolve all your queries, can we move forward? @mkzie2 |
|
I'm still researching if the default rate change could cause regressions. Will ready for review soon. |
|
Except for the renaming |
|
@ishpaul777 Fixed. Please note that we cannot rename "Default rate" for now. It's being worked on in the BE #62099 (comment). |
|
Mind merging main here please |
|
@mkzie2 can you please merge main here |
|
@ishpaul777 Updated PR. I added a few test cases in PR description to get a better overview of the changes. |
|
Spell check is not related. |
|
Spell check should be resolved on main. |
ishpaul777
left a comment
There was a problem hiding this comment.
code seems good! minor comments, will complete testing and checklist
| // TODO: Confirm max length | ||
| // Uses the spread syntax to count the number of Unicode code points instead of the number of UTF-16 code units. |
There was a problem hiding this comment.
lets confirm this and remove TODO cc @MonilBhavsar
There was a problem hiding this comment.
looks like current max length is 50. So we should go with it, IMO
There was a problem hiding this comment.
Removed TODO. @MonilBhavsar Ready for your review.
| errors: { | ||
| rateNameRequired: 'El nombre de la tasa es obligatorio', | ||
| existingRateName: 'Ya existe una tasa de distancia con este nombre', | ||
| }, |
There was a problem hiding this comment.
is translations confirmed for all languages?
There was a problem hiding this comment.
We haven't had an official process to confirm translations for all languages. If you knew it, could you share? For Spanish, I'm checking it in this thread.
There was a problem hiding this comment.
use deepl.com and confirm translations are accurate, in the meantime i have asked internally if there is formal process
There was a problem hiding this comment.
Please take a look at this https://github.com/Expensify/App?tab=readme-ov-file#generating-translations
There was a problem hiding this comment.
Oh I remembered the last time I ran the script, it cost me around $20 within 15 minutes before reaching tier limit because it requests translations for all the copies. Let me try again to check if that was fixed.
There was a problem hiding this comment.
Updated with generateTranslations script.
| API.write(WRITE_COMMANDS.UPDATE_POLICY_DISTANCE_RATE_VALUE, params, {optimisticData, successData, failureData}); | ||
| } | ||
|
|
||
| function updatePolicyDistanceRateName(policyID: string, customUnit: CustomUnit, customUnitRates: Rate[]) { |
There was a problem hiding this comment.
NAB: can this updatePolicyDistanceRateName and updatePolicyDistanceRateValue be DRYed up by extracting the common logic in a util
|
@ishpaul777 Ready for review. |
ishpaul777
left a comment
There was a problem hiding this comment.
LGTM! still one comment unresolved
MonilBhavsar
left a comment
There was a problem hiding this comment.
Thanks! Looking good!
|
✋ 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/MonilBhavsar in version: 9.1.88-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.1.88-3 🚀
|
| return rateText.includes(normalizedSearchInput); | ||
| }, []); | ||
| const sortRates = useCallback((rates: RateForList[]) => rates.sort((a, b) => (a.rate ?? 0) - (b.rate ?? 0)), []); | ||
| const sortRates = useCallback((rates: RateForList[]) => rates, []); |
There was a problem hiding this comment.
This sorting does not match with other pages and it results in changed order on reconnect. This caused #68700
|
We neglected to add a pending action for when a distance rate is added offline so we added this in #73281 |
|
The translation wasn't added for distance rate rename action which caused #91204. |


Explanation of Change
This PR implements the distance rate name edit page.
This PR eliminates the concept of
Default rate:Default rate. New rates created by user are calledNew rate(New rate 1,New rate 2...)Default ratename)Fixed Issues
$ #62099
PROPOSAL: #62099 (comment)
Tests
Test 1: Create new rates
Default rateNew rate i(e.g.,New rate,New rate 1,New rate 2...)Test 2: Edit rate name
Default rate - $0.70Default ratename is editableTest 3: Delete rate
Test 4: Fallback rate when creating expenses
Offline tests
QA Steps
See Tests
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))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
Screen.Recording.2025-05-22.at.07.56.55-compressed.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2025-05-22.at.07.49.34.mov
MacOS: Desktop
Screen.Recording.2025-05-22.at.07.51.35.mov