feat: social leaderboard opt out#32982
Conversation
|
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. |
# Conflicts: # package.json # yarn.lock
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Approving to unblock the request for changes so that @aganglada and @zone-live can review
|
One thing to add next in a follow-up PR is metrics, I'm sure Rizvi will want to know if users are doing the opt-out 👍🏼 |
| createEventBuilder( | ||
| MetaMetricsEvents.SOCIAL_TRADER_LEADERBOARD_VISIBILITY_TOGGLED, | ||
| ) | ||
| .addProperties({ show_account_on_leaderboard: enabled }) |
There was a problem hiding this comment.
do we have the segment-schema PR prepared already?
There was a problem hiding this comment.
Yeah just pushed it: https://github.com/Consensys/segment-schema/pull/666
# Conflicts: # app/core/Analytics/MetaMetrics.events.ts # package.json # yarn.lock
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 ac2d297. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag selection rationale:
No performance tests are needed as these changes are UI/settings additions with no impact on app launch, asset loading, or other performance-sensitive flows. Performance Test Selection: |
|





Description
Adds a way for users to opt out of the Top Traders leaderboard from within the app.
Reason: MetaMask previously had no in-app way for a user to remove their account's addresses from the Top Traders leaderboard.
@metamask/social-controllers@2.4.0added theoptOutOfLeaderboardcapability (messenger actionSocialController:optOutOfLeaderboard); this PR wires it into the mobile UI.Solution:
@metamask/social-controllersfrom2.3.1→2.4.0.selectSocialLeaderboardEnabled).TopTradersSettingsscreen with an Opt out of leaderboard row.LeaderboardOptOutBottomSheet(composed from the design-systemBottomSheet, mirroring the existingTradingSignalsSetupBottomSheet) that callsSocialController:optOutOfLeaderboard, showing a loading/disabled state, closing on success, and logging + recovering on failure.SETTINGS.TOP_TRADERSandSOCIAL_LEADERBOARD.OPT_OUTwith navigator registrations, param-list types, i18n strings, and testIDs.Changelog
CHANGELOG entry: Added a Top Traders section in Settings that lets users opt out of the Top Traders leaderboard.
Related issues
Figma: https://www.figma.com/design/HzPB0InxHBY5hPkOukPCqv/Social?node-id=3017-31866&t=R8yrnl1Yo45ffgJO-4
Fixes: TSA-830
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes public visibility of trading accounts via backend opt-in/out; risk is mitigated by feature flags, non-optimistic persistence, and tests, but still touches privacy-sensitive social settings.
Overview
Adds a Top Traders block on Security & privacy so users can control whether their account appears on the leaderboard, behind both
aiSocialLeaderboardEnabledand the newaiSocialLeaderboardOptFlowEnabledremote flag.Toggling calls
SocialController:optInToLeaderboard/optOutOfLeaderboard(withSocialServiceactions delegated on the social controller messenger). Reduxsettings.showAccountOnLeaderboardis updated only after a successful backend response (default shown); failures are logged and the toggle stays unchanged. A new MetaMetrics opt-in event Trader Leaderboard Visibility Toggled fires on success, and the section is covered by unit tests plus i18n and feature-flag registry entries.Reviewed by Cursor Bugbot for commit f2929c3. Bugbot is set up for automated code reviews on this repo. Configure here.