chore: Integrate SnapInsightsController#26411
Merged
FrederikBolding merged 5 commits intodevelopfrom Aug 19, 2024
Merged
Conversation
fc23b5b to
79bbdfd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #26411 +/- ##
===========================================
- Coverage 70.19% 70.18% -0.01%
===========================================
Files 1420 1420
Lines 49769 49773 +4
Branches 13828 13828
===========================================
- Hits 34933 34930 -3
- Misses 14836 14843 +7 ☔ View full report in Codecov by Sentry. |
Collaborator
Builds ready [5e429ca]
Page Load Metrics (480 ± 344 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ritave
previously approved these changes
Aug 16, 2024
ui/hooks/useTransactionInsights.js
Outdated
Contributor
There was a problem hiding this comment.
if (insightSnaps.length === 1) {
//////
assert(data !== undefined && data.length === 1);
//////
insightComponent = (
<Tab
className="confirm-page-container-content__tab"
name={snapsNameGetter(selectedSnap.id)}
>
// And we remove the null check here.
<SnapInsight snapId={selectedInsightSnapId} data={data[0]} />
</Tab>
);
}9ed9ea7 to
56cd133
Compare
david0xd
previously approved these changes
Aug 16, 2024
Collaborator
Builds ready [56cd133]
Page Load Metrics (332 ± 352 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
56cd133 to
351d047
Compare
|
david0xd
approved these changes
Aug 19, 2024
Collaborator
Builds ready [351d047]
Page Load Metrics (67 ± 7 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ritave
approved these changes
Aug 19, 2024
matthewwalsh0
approved these changes
Aug 19, 2024
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Description
This PR integrates the
SnapInsightsControllerand ports the existing insights functionality to use this controller instead of the existing hooks. This replaces our existing implementations with auseInsightSnapshook that returns all insights for a given confirmation ID directly from the UI state.The intention is that this matches the existing implementation as much as possible, with one caveat that the timing for loading the insights might have changed. Each insight is now added to state as soon as the Snap responds.
Related issues
Closes: MetaMask/snaps#2568
Manual testing steps