refactor(snap-keyring): migrate IconName import to @metamask/design-system-react#41445
Open
refactor(snap-keyring): migrate IconName import to @metamask/design-system-react#41445
Conversation
…ystem-react Replace the restricted cross-layer import of IconName from the deprecated ui/components/component-library/icon with the equivalent from @metamask/design-system-react. Removes the eslint-disable and TODO comments that were needed to suppress the no-restricted-paths rule. Made-with: Cursor
Contributor
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (2 files, +2 -6)
|
Contributor
Builds ready [6efcb63]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 1 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
|
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.



Description
IconNamewas imported from the deprecatedui/components/component-library/iconinto two background-script files inapp/scripts/lib/snap-keyring/. This was a restricted cross-layer import (background → UI) that required aneslint-disablecomment to suppress theimport-x/no-restricted-pathsrule, along with aTODOto remove it.@metamask/design-system-reactexports the sameIconNameenum (includingUserCircleAddandUserCircleRemoveused here), so we can import it from the shared package directly — removing the cross-layer violation entirely.ui/components/component-library/iconis deprecated and importing UI code into background scripts is a restricted pattern.IconNamefrom@metamask/design-system-reactand remove the associatedeslint-disableandTODOcomments.Changelog
CHANGELOG entry: null
Related issues
Fixes:
Pre-merge author checklist
Pre-merge reviewer checklist
Made with Cursor
Note
Low Risk
Low risk refactor that only changes where
IconNameis imported from, removing a background→UI cross-layer dependency. Runtime behavior should be unchanged aside from any potential enum mismatch/regression if the design-system export diverges.Overview
Updates the snap-keyring background code to import
IconNamefrom@metamask/design-system-reactinstead of the deprecated UI component library, and removes the associatedeslint-disable/TODO comments.This eliminates a restricted cross-layer (background → UI) import in
snap-keyring.tsandutils/showResult.tswithout changing the surrounding snap account flow logic.Written by Cursor Bugbot for commit 6efcb63. This will update automatically on new commits. Configure here.