feat(tron): use the shared EstimatedChanges UI component - #396
Open
Julink-eth wants to merge 3 commits into
Open
Julink-eth wants to merge 3 commits into
Julink-eth wants to merge 3 commits into
Conversation
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The shared component integration is consistent with its contract and adequately covers the intended behavior changes.
Review effort: Balanced
Findings: None
What changed in this PR
Replaces Tron’s local estimated-changes UI with the shared network utility component.
Changes:
- Preserves estimated changes during background rescans.
- Displays unavailable messaging for failed scans.
- Adds tests, changelog details, and updated coverage thresholds.
| File | Description |
|---|---|
ConfirmTransactionRequest.tsx |
Passes scan status to estimated changes. |
ConfirmSignTransaction.tsx |
Passes scan status to estimated changes. |
EstimatedChanges.tsx |
Adapts Tron scan data to the shared component. |
EstimatedChanges.test.tsx |
Tests loading, error, rescan, and asset states. |
snap.manifest.json |
Updates the bundle checksum. |
jest.config.js |
Adjusts coverage thresholds. |
CHANGELOG.md |
Documents user-visible behavior changes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
This branch was successfully 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
This PR replaces Tron's local EstimatedChanges implementation with the shared component from @metamask/snap-networks-utils.
Behavior change
Re-scans:
Before: Tron showed its loading skeleton again during a background re-scan, even when estimated changes were already on screen.
After: The previous estimated changes stay visible while the confirmation re-scans.
Scan errors:
Before: A scan result with status: 'ERROR' and no assets (e.g. a malformed transaction) showed "No estimated changes".
After: It shows "Estimated changes are not available".
Layout: Asset rows use the shared layout, with one -10 TRX label per row.
To note: Lowers the global Jest coverage thresholds slightly (by 0.04 to 0.14 points). The new wrapper is 100% covered, but removing about 140 well-covered lines lowers the overall percentage.
References
Checklist