Skip to content

feat: implement rich notification setting config using AUS#30106

Open
baptiste-marchand wants to merge 14 commits into
mainfrom
GE-13-integrating-AUS-with-notification-setting
Open

feat: implement rich notification setting config using AUS#30106
baptiste-marchand wants to merge 14 commits into
mainfrom
GE-13-integrating-AUS-with-notification-setting

Conversation

@baptiste-marchand
Copy link
Copy Markdown
Contributor

@baptiste-marchand baptiste-marchand commented May 13, 2026

Description

Revamps the notifications settings UX into section-based configuration (wallet activity, perps, Social AI, marketing) with a new NotificationSettingsSection screen and updated navigators to route into it.

Changelog

CHANGELOG entry: Revamp notification settings and enrich them with several sections

Related issues

Core PR: MetaMask/core#8784
Fixes: https://consensyssoftware.atlassian.net/browse/GE-13

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-05-15.at.17.16.52.mov
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2026-05-15.at.17.17.52.mov

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
Moderate risk: introduces new AUS-backed preference read/merge/write flows and rewires navigation/UI for notification settings, which could impact preference persistence and routing if edge cases (missing prefs/loading) are mishandled.

Overview
Revamps notification settings into section-based configuration (wallet activity, perps, Social AI, marketing) by adding a new NotificationSettingsSection screen and updating navigators to route into it.

Adds AUS-backed preference fetching/updating via useNotificationStoragePreferences (optimistic cache update + read/merge/write persistence) and wires Social AI preferences to this shared storage; Social leaderboard entry points now deep-link into the new settings section or fall back to NotificationsSettings when no AUS row exists.

Updates the notifications list UI to use HeaderCompactStandard with explicit close/settings actions, and removes legacy components/paths (SettingsNotification, resetNotifications, and the old NotificationPreferencesView).

Reviewed by Cursor Bugbot for commit 8c759d9. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
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.

@baptiste-marchand baptiste-marchand changed the title Ge 13 integrating aus with notification setting feat: implement rich notification setting config using AUS May 15, 2026
@baptiste-marchand baptiste-marchand force-pushed the GE-13-integrating-AUS-with-notification-setting branch from e017e79 to 8993554 Compare May 15, 2026 15:04
@baptiste-marchand baptiste-marchand marked this pull request as ready for review May 15, 2026 15:05
@baptiste-marchand baptiste-marchand requested a review from a team as a code owner May 15, 2026 15:05
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 15, 2026

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​metamask/​authenticated-user-storage@​2.0.07310010092100
Updatednpm/​@​metamask/​notification-services-controller@​23.1.0 ⏵ 24.1.09810088 +197100

View full report

Comment thread app/components/Views/Notifications/index.test.tsx Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/notification-services-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/notification-services-controller. Running all tests.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8c759d9. Configure here.

withHorizontalPadding={false}
/>
</>
);
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.

Conflicting write paths silently revert socialAI push toggle

High Severity

When type is socialAI, the parent NotificationSettingsSection manages push/in-app toggles via useNotificationStoragePreferences().updatePreference, while the child SocialAINotificationPreferencesContent independently writes the entire socialAI slice via useNotificationPreferences().applyChangeupdatePreferencesSection('socialAI', nextSocialAI). If a user toggles a trader (creating an optimistic overlay in the child with stale pushNotificationsEnabled: true), then flips the parent's push toggle off, the child's overlay retains the old push value. When the child's queued persist runs, it overwrites the parent's change — silently reverting the push toggle back to true on the server.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8c759d9. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
69.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

const getStatusText = (prefs?: NotificationPreferenceStatus | null) => {
const active = [];
if (prefs?.pushNotificationsEnabled) {
active.push('Push');
Copy link
Copy Markdown
Contributor

@samir-acle samir-acle May 15, 2026

Choose a reason for hiding this comment

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

question (non-blocking): do these need to be localized?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes definitely! I'll make sure I didn't forget any other string

title={strings('app_settings.notifications_opts.marketing_title')}
status={getStatusText(preferences?.marketing)}
iconName={IconName.Campaign}
onPress={() =>
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.

question: For the marketing section, should the In-app toggle also keep the existing feature-announcement controller flag in sync?

It looks like core still gates product-announcement notifications on NotificationServicesController.state.isFeatureAnnouncementsEnabled here:
https://github.com/MetaMask/core/blob/main/packages/notification-services-controller/src/NotificationServicesController/NotificationServicesController.ts#L1260-L1263

Turning off Marketing > In-app updates AUS but I think it still might allow Contentful productAnnouncement items in the notification list.

item={item}
evmAddress={evmAddress}
icon={accountAvatarType}
disabledSwitch={shouldDisableSwitches}
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.

thought (non-blocking): the social AI section disables the secondary options when push notifications is disabled. Should we do something similar here? If the user does not have wallet push or in-app notifications on, then we disable the accounts options.

Copy link
Copy Markdown
Contributor

@samir-acle samir-acle left a comment

Choose a reason for hiding this comment

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

Works great. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants