Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
There was a problem hiding this comment.
PR Summary
The refactor and redesign of the confirmation token amount feature introduces new components and updates existing ones to improve functionality and maintainability.
- New Component: Added
ui/components/app/confirm/info/row/text-token.tsxto format and display token amounts with precision. - Storybook Addition: Introduced
ui/components/app/confirm/info/row/text-token.stories.tsxfor visual testing of theConfirmInfoRowTextTokencomponent. - Unit Tests: Added
ui/components/app/confirm/info/row/text-token.test.tsxto ensure correct rendering and formatting of token values. - Refactor: Updated
ui/pages/confirmations/components/confirm/info/typed-sign/permit-simulation/permit-simulation.tsxto usecalcTokenAmountfor consistent token calculations. - Code Simplification: Modified
ui/pages/confirmations/components/confirm/row/dataTree.tsxto replace custom formatting with the newConfirmInfoRowTextTokencomponent.
6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
There was a problem hiding this comment.
PR Summary
(updates since last review)
The refactor and redesign of the confirmation token amount feature primarily involve renaming components and updating their usage to improve clarity and maintainability.
- Component Renaming:
ui/components/app/confirm/info/row/text-token.tsxrenamed totext-token-units.tsxto better reflect its functionality. - Export Update: Modified
ui/components/app/confirm/info/row/index.tsto exporttext-token-unitsinstead oftext-token. - Story and Test Updates: Renamed
text-token.stories.tsxandtext-token.test.tsxtotext-token-units.stories.tsxandtext-token-units.test.tsxrespectively, aligning with the new component name. - DataTree Component Update: Adjusted
ui/pages/confirmations/components/confirm/row/dataTree.tsxto useConfirmInfoRowTextTokenUnitsfor better naming consistency.
5 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
|
There was a problem hiding this comment.
PR Summary
(updates since last review)
The refactor introduces a reusable ConfirmInfoRowTextTokenUnits component to streamline token amount display across the application.
- New Component: Added
ConfirmInfoRowTextTokenUnitsinui/components/app/confirm/info/row/text-token-units.tsx. - Test Enhancements: Updated
shared/lib/transaction-controller-utils.test.jsto include precision handling tests. - Storybook Addition: Created
invalid-custom-network-alert.stories.tsxfor visual testing ofInvalidCustomNetworkAlert. - E2E Test Reliability: Improved
test/e2e/accounts/create-snap-account.spec.tsby adding wait conditions for popup handling. - UI Consistency: Modified
ui/pages/onboarding-flow/metametrics/index.scssto maintain consistent button width across screen sizes.
12 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Builds ready [d1f422d]
Page Load Metrics (171 ± 196 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26105 +/- ##
===========================================
- Coverage 69.67% 69.67% -0.00%
===========================================
Files 1405 1406 +1
Lines 49733 49731 -2
Branches 13751 13751
===========================================
- Hits 34651 34649 -2
Misses 15082 15082 ☔ View full report in Codecov by Sentry. |
| // FIXME - Precision may be lost for large values when using formatAmount | ||
| /** @see {@link https://github.com/MetaMask/metamask-extension/issues/25755} */ | ||
| const tokenValue = formatAmount('en-US', resultBn); | ||
| const tokenValueMaxPrecision = formatAmountMaxPrecision('en-US', valueBN); |
There was a problem hiding this comment.
valueBn should have been resultBn here. This caused the token decimal issue.



Description
No UI/UX changes
Create reusable ConfirmInfoRowTextTokenUnits
This also fixes the missing token decimals we had on the Permit value
notes:
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2888
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist