Skip to content

feat(tron): use the shared EstimatedChanges UI component - #396

Open
Julink-eth wants to merge 3 commits into
mainfrom
feat/tron-shared-estimated-changes
Open

Julink-eth wants to merge 3 commits into
mainfrom
feat/tron-shared-estimated-changes

Conversation

@Julink-eth

Copy link
Copy Markdown
Contributor

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

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@Julink-eth
Julink-eth requested a review from a team as a code owner September 30, 2026 16:19
@Julink-eth
Julink-eth deployed to default-branch September 30, 2026 16:19 — with GitHub Actions Active
@Julink-eth

Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/bitcoin-wallet-snap@3.1.0-preview-1ad90ff1
@metamask-previews/snap-networks-utils@1.0.0-preview-1ad90ff1
@metamask-previews/solana-wallet-snap@7.0.0-preview-1ad90ff1
@metamask-previews/stellar-wallet-snap@1.1.0-preview-1ad90ff1
@metamask-previews/tron-wallet-snap@4.0.0-preview-1ad90ff1

@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

This branch was successfully deployed

1 active (outdated) deployment
default-branch — 551dc585 Deployed Sep 30, 2026 by Julink-eth via Determine whether this PR is a release PR #1404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants