Repository navigation
Conversation
…t for the lightning bolt Co-authored-by: thelullabyy <[email protected]>
Contributor
Author
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
Contributor
Author
Contributor
Author
|
🤖 Android test steps verification results: ✅ pass On Android, GB government rates were auto-generated with the lightning bolt, and turning on Track tax and regenerating the rates caused no errors. The bolt stayed through every Tax reclaimable edit, and no JS errors or redboxes appeared. As on Web, only the standard GB (AMAP) rates appeared, never fuel bands, and logs weren't streamed, so the console check relies on no visible errors.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.














Explanation of Change
The UK publishes fuel-band mileage rates alongside its standard (AMAP) rate. The server will copy the bands, with their VAT-reclaimable fraction, only to workspaces that track tax and have distance tax on, and AMAP to every other workspace. The App's optimistic copy didn't know about bands, so it would have added AMAP plus every band, without the fraction. The lightning bolt also ignored the reclaimable amount, so an edited band still looked auto-generated.
GovernmentMileageRateandGovernmentRateSnapshotget an optionaltaxClaimablePercentage.buildOnyxDataForGovernmentRateAutoUpdateusesisTaxTrackingEnabled(true, policy, true)asshouldUseFuelBandRates. For GB rates only, it copies the bands when that is true and the standard rate otherwise. Other countries are unaffected.getGovernmentRateSeriesstrips the trailing_<startDate>withlastIndexOf('_'), so band IDs likeGB_PETROL_UP_TO_1400_2026-06-01(whose band names contain_) resolve toGB_PETROL_UP_TO_1400.taxClaimablePercentagegoes on the rate and its snapshot when the reference rate has one.enabledcomes from the previous rate in the same series, including rates copied earlier in the same request, and falls back to the reference rate's value.taxRateExternalIDis left to the server response.buildOnyxDataForGovernmentRateAutoUpdateandsetWorkspaceDistanceAutoUpdatenow takepolicyinstead ofpolicyID+customUnit, which are derived inside. All callers already hadpolicy.isGovernmentRateUnmodifiedalso compares the reclaimable amount at the 4-decimal precision the edit page shows. Re-entering the shown value therefore brings the bolt back. Snapshots without a fraction, such as US/EUR rates, ignore it as before. The edit page now uses the samegetTaxClaimableDisplayAmounthelper, and itsuseCallbackwas removed so React Compiler can still compile the component.Note: the
enabledinheritance applies to every country's copied rates, matching the server's shared copy. A GBP currency change without a country still copies nothing optimistically; the server copies the bands and its response adds them.AI tests run by MelvinBot:
npm run typecheck,npm run lint-changed,npm run fmt,npm run spell-changed,react-compiler-compliance-checkon the changed pages, and Jest forDistanceRateTest,PolicyDistanceRatesUtilsTest,PolicyTest,PolicyUtilsTest,WorkspaceOverviewCurrencyPageTest,WorkspaceUpgradeTest,IOURequestStepDistanceRateTestand the distance-rate hook tests (all passed). The full Jest suite and the Storybook smoke test were not run locally.Fixed Issues
$ #104135
PROPOSAL: #104135 (comment)
Tests
// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review"
// Please describe what tests you performed that validates your changed worked.
Offline tests
QA Steps
// TODO: The human co-author must fill out the QA tests you ran before marking this PR as "ready for review".
// Please describe what QA needs to do to validate your changes and what areas do they need to test for regressions.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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