feat: integrate ui settings from core PreferencesController #17286
+559
−58
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 completes the
PreferencesController
(core) integration for mobile to enable cross-platform syncing of general (aka UI) settings, in a future release. Following the extension implementation, this change migrates 6 general settings from scattered Redux locations to the centralized PreferencesController and updates all UI components to use the new architecture.What is the reason for the change?
What is the improvement/solution?
currentLocale
,theme
,useBlockie
,currentCurrency
,hideZeroBalanceTokens
,showNativeTokenAsMainBalance
) from various locations to the core (PreferencesController)Changelog
Migration:
UI Components Updated:
ThemeSettings/index.tsx
- UsesselectTheme
andupdateTheme
MultichainTransactionListItem.tsx
- UsesselectTheme
util/theme/index.ts
- UsesselectTheme
in theme utilitiesIdenticon/index.tsx
- UsesselectUseBlockie
WalletAccount/WalletAccount.tsx
- UsesselectUseBlockie
AccountRightButton/index.tsx
- UsesselectUseBlockie
CaipAccountSelectorList.tsx
- UsesselectUseBlockie
GeneralSettings/index.js
- Uses new selectors and actionsUrlAutocomplete/index.tsx
- Uses PreferencesControllerselectCurrentCurrency
Actions Updated:
All actions now use proper PreferencesController methods:
updateTheme
→PreferencesController.setTheme
updateUseBlockie
→PreferencesController.setUseBlockie
updateCurrentCurrency
→PreferencesController.setCurrentCurrency
updateHideZeroBalanceTokens
→PreferencesController.setHideZeroBalanceTokens
Related issues
Related to: MetaMask/metamask-extension#34327
Depends on: MetaMask/core#6111
Manual testing steps
Screenshots/Recordings
Before
TODO
After
TODO
Pre-merge author checklist
Pre-merge reviewer checklist