Skip to content

feat: integrate ui settings from core PreferencesController #17286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

fabiobozzo
Copy link
Contributor

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?

  • Prepare the ground for cross-platform settings synchronization between extension and mobile
  • Centralize general settings management under PreferencesController
  • Remove dependencies on scattered Redux state locations for settings

What is the improvement/solution?

  • Migration 089 moves 6 general settings (currentLocale, theme, useBlockie, currentCurrency, hideZeroBalanceTokens, showNativeTokenAsMainBalance) from various locations to the core (PreferencesController)
  • All UI components now use new PreferencesController selectors and actions instead of old Redux state
  • Created proper actions that use PreferencesController methods instead of Redux dispatches

Changelog

Migration:

  • Migration 089 migrates 6 general settings to PreferencesController

UI Components Updated:

  • ThemeSettings/index.tsx - Uses selectTheme and updateTheme
  • MultichainTransactionListItem.tsx - Uses selectTheme
  • util/theme/index.ts - Uses selectTheme in theme utilities
  • Identicon/index.tsx - Uses selectUseBlockie
  • WalletAccount/WalletAccount.tsx - Uses selectUseBlockie
  • AccountRightButton/index.tsx - Uses selectUseBlockie
  • CaipAccountSelectorList.tsx - Uses selectUseBlockie
  • GeneralSettings/index.js - Uses new selectors and actions
  • UrlAutocomplete/index.tsx - Uses PreferencesController selectCurrentCurrency

Actions Updated:

All actions now use proper PreferencesController methods:

  • updateThemePreferencesController.setTheme
  • updateUseBlockiePreferencesController.setUseBlockie
  • updateCurrentCurrencyPreferencesController.setCurrentCurrency
  • updateHideZeroBalanceTokensPreferencesController.setHideZeroBalanceTokens

Related issues

Related to: MetaMask/metamask-extension#34327
Depends on: MetaMask/core#6111

Manual testing steps

  1. Install the app and verify migration 089 runs successfully
  2. Go to Settings > General Settings
  3. Change theme setting and verify it persists after app restart
  4. Toggle "Use Blockies" setting and verify avatar changes across the app
  5. Change currency setting and verify it updates throughout the app
  6. Toggle "Hide tokens with zero balance" and verify token list updates
  7. Verify all settings are stored in PreferencesController state (not old Redux locations)
  8. Test that settings work correctly in components like:
    • Theme selection modal
    • Account avatars/identicons
    • Currency displays
    • Token list filtering

Screenshots/Recordings

Before

TODO

After

TODO

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​preferences-controller@​18.4.0 ⏵ 18.4.1-preview-32f9004a100 +2100100 +28100 +3100

View full report

@fabiobozzo fabiobozzo closed this Jul 18, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants