Repository navigation
Show distance rate editor amounts with meaningful decimal precision - #106708
Conversation
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
I created this draft PR from an upstream branch because I don't have push access to your fork. To copy the branch to your fork and push updates yourself, run these commands from your fork's local checkout (omit the first command if git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-distanceRatePrecision
git checkout -b claude-distanceRatePrecision upstream/claude-distanceRatePrecision
git push -u origin claude-distanceRatePrecisionYou can then open a replacement PR from your fork and close this upstream-branch PR. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🤖 Android test steps verification results: Verified on standalone Android NewDot: rate and tax reclaimable details editors reopen 0.1 as 0.10 and preserve 0.123 and 0.1234 after saving. Inline coverage, mixed-precision table coverage, console checks, and unnecessary-update detection remain blocked.
|
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
Pushed 44023cb to fix the Oxfmt failure—a test call needed formatting only.
New CI checks are queued. |
|
|
|
🤖 Web test steps verification results: Verified details-editor normalization and precision on dev NewDot web. Inline checks were blocked by covered controls and a payment-method reminder that could not be dismissed safely; no precision regression was observed.
|
Krishna2323
left a comment
There was a problem hiding this comment.
@MelvinBot please do the following on this PR:
- Complete the PR description: fill in Tests, Offline tests, and QA Steps with exact steps covering the inline table cells (Rate and Tax reclaimable), both details editors, a government fuel-band rate saved with the same amount, and a comma-decimal locale. Add screenshots/videos for every platform you can run.
- Tick every Author Checklist item you have actually verified, and leave the ones you could not verify unticked with a short note why.
- Mark the PR ready for review.
| function getRateValueWithDecimals(value: number): string { | ||
| const numValue = parseFloat(value.toFixed(CONST.MAX_TAX_RATE_DECIMAL_PLACES)); | ||
| const decimalPart = numValue.toString().split('.').at(1) ?? ''; | ||
| // Set the fraction digits to be between 2 and 4 (OD Behavior) |
There was a problem hiding this comment.
@MelvinBot remove the // Set the fraction digits to be between 2 and 4 (OD Behavior) comment in getRateValueWithDecimals (src/libs/PolicyUtils/customUnits.ts). It restates the code, and the JSDoc above already explains the intent.
|
@Krishna2323 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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🤖 Web test steps verification results: Updated the PR description with detailed Tests, Offline tests, QA Steps, existing web/Android evidence, and checklist notes; marked it ready for review. Current web verification stopped at the covered inline Rate Edit control, leaving expanded scenarios unverified.
|
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
@neil-marcellini 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] |
|
The current failures are unrelated to this PR, so I haven’t pushed unrelated changes:
The previous formatting fix is passing. The two base-branch failures need separate fixes before rerunning these checks. |
|
Rechecked the latest results: the same unrelated failures remain, so no new commit was pushed.
Neither failing code path is changed by this PR. These need separate base-branch fixes, not changes to the distance-rate implementation. Formatting, typecheck, and React Compiler checks are passing. |
Co-authored-by: Krishna <Krishna2323@users.noreply.github.com>
|
|
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
neil-marcellini
left a comment
There was a problem hiding this comment.
Good to go. I'm simplifying the QA steps for you.
|
@neil-marcellini I still need to complete the reviewer checklist. I'll take care of that very shortly. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_hybrid.mp4Android: mWeb Chromeandroid_mWeb.mp4iOS: HybridAppios_hybrid.mp4iOS: mWeb Safariios_mWeb.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
|
@neil-marcellini ready for review! |
|
🚧 neil-marcellini 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.5.40-0 🚀
|
|
No help site update needed — this fixes unnecessary trailing zeros in existing distance-rate editors without adding a workflow or making any existing article sentence incorrect. |







Explanation of Change
Reuse the existing Classic-compatible two-to-four-decimal rate formatting without forcing four trailing decimal places in the distance Rate and Tax reclaimable editors.
AI Tests
check-changedcould not resolve an empty CI base ref; explicit component checks passed instead.Fixed Issues
$ #106594
PROPOSAL: #106594 (comment)
Tests
Execution status: The following is a repeatable test plan, not a claim that all steps passed. Earlier web and Android runs verified both details editors: saving
0.1reopens as0.10, and0.123/0.1234retain their precision. Current web run reproduced the blocked inline Rate Edit control; remaining expanded scenarios were not exercised. See Screenshots/Videos for evidence and limitations.1.00. Select Tax Rate 1 (5%) for each, or another configured nonzero tax rate. Wait for saves to finish.0.1and commit the inline edit. Reopen it and verify0.10, not0.1000. Repeat with Three decimals=0.123and Four decimals=0.1234. Verify the table simultaneously shows0.10,0.123, and0.1234. If clicking opens details instead, record inline coverage as blocked rather than passing.0.1when0.10is displayed and confirm it returns normally without an update request. Repeat the equivalent-value submission in the inline Rate cell while monitoring request traffic.1.00so every test tax amount is strictly smaller than Rate. In each row's Tax reclaimable cell, use its Edit control to save0.1,0.123, and0.1234respectively. Reopen each cell and verify0.10,0.123, and0.1234; verify the mixed-precision table values too.0.1against saved0.10and confirm no unnecessary update request is issued. Clear a custom reclaimable amount and save; verify it remains cleared after reopen.1.00, try Tax reclaimable1.00and1.01in both inline and details editors. Verify rejection with a validation message and no persisted change. Cancel, reopen, and verify the last valid value remains. Confirm neither editor accepts precision beyond four decimal places as an additional stored decimal.0,1,0,123, and0,1234. Verify localized inputs/display retain0,10,0,123,0,1234, currency placement remains appropriate, and saved numeric amounts do not change by a factor of 100. Repeat equivalent-value saves (0,1versus displayed0,10) and validation. Restore the original language afterward.Not completed: inline Rate/Tax reclaimable, government fixture, comma-decimal locale, invalid-value cases, mixed-precision fixture, console inspection, and equivalent-value request suppression. The current inline Edit click was rejected as covered by the row container, even after hover. No payment method was added or blocker bypassed.
Offline tests
Planned; not executed. Network manipulation was not attempted after the inline blocker.
1.00and a valid reclaimable amount. Wait for pending changes to settle, then disconnect the network using browser DevTools Offline (or the device network control).0.1234and reopen. Verify four-decimal precision is retained locally and pending/offline feedback appears rather than a false server-confirmed result. Restore Rate1.00before testing the reclaimable amount.0.1and0.123in each editor; verify0.10and0.123. Submit equivalent padding without introducing an additional queued update. Confirm an invalid reclaimable amount is still rejected while offline.QA Steps
(Neil's AI agent)
0.1, save, and reopen Rate. Verify it shows0.10, not0.1000.0.123and0.1234. Verify each reopens with the same value.1.00, then repeat steps 4–5 in Tax reclaimable.1.00, enter Tax reclaimable1.01. Verify an error is shown and the value isn't saved.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected) — Shared-helper unit coverage exists, but complete affected UI coverage is missing.npm run compress-svg) — Not applicable: no assets changed.Avataris modified, I verified thatAvataris working as expected in all cases) — Not applicable: no generic component changed; shared-helper UI coverage remains partial.Designlabel and/or tagged@Expensify/designso the design team can review the changes. — No Design label or new design-team request added to this PR.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. — No post-review merge/retest established in this run.Screenshots/Videos
Android: Native
Earlier standalone Android run: details-editor normalization and 3–4 decimal save/reopen passed; inline cells were not exposed in the mobile list. This is partial coverage, not a full-platform pass. Full results · Recording.
Android: mWeb Chrome
Not run; this invocation only provides desktop web. Android native evidence above does not establish Android Chrome behavior.
iOS: Native
Not run; no iOS device available.
iOS: mWeb Safari
Not run; no iOS Safari available.
MacOS: Chrome / Safari
Not run on macOS; Linux dev web evidence below must not be counted as macOS Chrome/Safari coverage.
Web: dev NewDot (Linux)
Earlier run verified Rate and Tax reclaimable details editors normalize
0.1to0.10and preserve0.123/0.1234after save/reopen. Inline interaction was blocked. Full results · Recording.Current run reproduced the inline Rate Edit blocker: the click was rejected as covered by the row container even after hover. Clicking the cell opened details instead, which was not counted as inline coverage. No precision values were changed during this run; tax, government, locale, offline, validation, console and request checks remain unverified.