Skip to content

feat: braze banner#29301

Merged
samir-acle merged 49 commits into
mainfrom
feat/braze-banner
May 14, 2026
Merged

feat: braze banner#29301
samir-acle merged 49 commits into
mainfrom
feat/braze-banner

Conversation

@samir-acle
Copy link
Copy Markdown
Contributor

@samir-acle samir-acle commented Apr 24, 2026

Description

Adds a new BrazeBanner component to the wallet home screen that displays Braze campaign content as a dismissible banner card.

What changed:

  • New BrazeBanner UI backed by BrazeBannerCard for rendering campaign content (title, body, image, CTA)
  • useBrazeBanner hook drives the state machine: loading → visible | empty, visible → dismissed
  • Banner deeplinks are validated against an allowlist before being routed through the app's deeplink pipeline
  • Dismissal is always in-memory for the session; for non-test-send campaigns with a campaign_name property, dismissal is also persisted to Redux and Braze is notified — so the same banner is suppressed on the following session's first render, then the guard is cleared
  • New banners Redux slice field lastDismissedBrazeBanner + migration 133
  • New Braze core helpers: getBannerForPlacement, refreshBrazeBanners, logBrazeBannerImpression, logBrazeBannerClick, dismissBrazeBanner
  • Braze identity sync now refreshes banners on sign-in
  • Banner is integrated into the Wallet home screen behind the brazeBannerHome remote feature flag, taking priority over the existing Carousel, wrapped in ComponentErrorBoundary

Changelog

CHANGELOG entry: Added a Braze-driven promotional banner to the wallet home screen

Related issues

Fixes:

Manual testing steps

To test with real banners, share your Braze profile ID with the author so a campaign can be targeted to your device.

Feature: Braze home banner

  Scenario: User sees the banner on app open
    Given the user has an active Braze banner campaign targeting their profile
    When the user opens the app and navigates to the wallet home screen
    Then the banner is displayed at the top of the home screen

  Scenario: User dismisses the banner
    Given the banner is visible on the home screen
    When the user taps the dismiss button
    Then the banner disappears immediately
    And the banner does not reappear for the rest of that session
    And the same banner is not shown on the next app session

  Scenario: Banner rotates between sessions
    Given the user has previously dismissed a banner
    When the user closes the app and reopens it
    Then a different banner (if available) may be shown
    And the previously dismissed banner is not shown

Screenshots/Recordings

Before

After

image

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
Adds a new Braze-powered banner surface on wallet home with deeplink routing and persistent dismissal state, touching analytics and navigation paths. Risk is mitigated by an explicit deeplink allowlist, error boundary wrapping, and extensive unit tests, but it still introduces remote-content driven UI/flows.

Overview
Adds a new Braze-backed promotional banner on wallet home, rendered via BrazeBanner/BrazeBannerCard and controlled by a small state machine (loading/visible/empty/dismissed) in useBrazeBanner with warm-cache probing, event subscription, timeouts, and foreground refresh.

Integrates the banner into the Wallet screen behind a new remote feature flag (brazeBannerHomeMinVersion), taking priority over the existing Carousel when enabled and wrapped in ComponentErrorBoundary so failures don’t block the home UI.

Extends Braze and Redux plumbing: adds core helpers for banner fetch/refresh and impression/click/dismiss logging; introduces banners.lastDismissedBrazeBanner with migration 134 to persist the last dismissed campaign; and adds a deeplink allowlist (isAllowedBrazeDeeplink) to block unsafe schemes/hosts and explicitly reject MWP connection links. Updates test mocks/registries accordingly.

Reviewed by Cursor Bugbot for commit 38b9ee6. 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.

Comment thread ios/MetaMask/AppDelegate.mm Outdated
@samir-acle samir-acle marked this pull request as ready for review April 27, 2026 20:39
@samir-acle samir-acle requested review from a team as code owners April 27, 2026 20:39
Comment thread app/store/migrations/133.ts Outdated
Comment thread app/store/migrations/133.test.ts Outdated
Copy link
Copy Markdown
Contributor

@baptiste-marchand baptiste-marchand left a comment

Choose a reason for hiding this comment

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

Great work! Just a few comments

Comment thread app/components/UI/BrazeBanner/BrazeBannerWebView.tsx Outdated
Comment thread app/components/UI/BrazeBanner/BrazeBanner.tsx
Comment thread app/components/Views/Wallet/index.tsx Outdated
Comment thread app/components/UI/BrazeBanner/selectors/featureFlags/index.ts Outdated
Comment thread app/components/UI/BrazeBanner/useBrazeBanner.ts Outdated
@baptiste-marchand
Copy link
Copy Markdown
Contributor

@samir-acle we need to do this #29301 (comment)

@baptiste-marchand
Copy link
Copy Markdown
Contributor

Otherwise your changes look good to me! 🚀

@samir-acle samir-acle requested review from a team as code owners May 5, 2026 16:22
Comment thread app/components/UI/BrazeBanner/BrazeBannerCard.tsx Outdated
Comment thread app/components/UI/BrazeBanner/BrazeBanner.tsx Outdated
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.

There's a bunch of unrelated file changes. Probably a missed merge?

cortisiko
cortisiko previously approved these changes May 6, 2026
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 2 potential issues.

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 38b9ee6. Configure here.

Comment thread app/components/UI/BrazeBanner/BrazeBanner.tsx
Comment thread app/util/test/testSetup.js
@samir-acle samir-acle force-pushed the feat/braze-banner branch from 4e34f74 to 3d2a63a Compare May 7, 2026 12:33
Copy link
Copy Markdown
Contributor

@baptiste-marchand baptiste-marchand left a comment

Choose a reason for hiding this comment

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

LGTM!

@samir-acle samir-acle removed request for a team May 14, 2026 11:15
@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue May 14, 2026
@samir-acle samir-acle moved this from Needs dev review to Has approvals, needs CODEOWNER in PR review queue May 14, 2026
gantunesr
gantunesr previously approved these changes May 14, 2026
cortisiko
cortisiko previously approved these changes May 14, 2026
Cal-L
Cal-L previously approved these changes May 14, 2026
Copy link
Copy Markdown
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation Bot moved this from Has approvals, needs CODEOWNER to Review finalised - Ready to be merged in PR review queue May 14, 2026
@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: %
click to see 🤖 AI reasoning details

E2E Test Selection:
Fallback: AI analysis did not complete successfully. Running all tests.

Performance Test Selection:
Fallback: AI analysis did not complete successfully. Running all performance tests.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarqubecloud
Copy link
Copy Markdown

@samir-acle samir-acle added this pull request to the merge queue May 14, 2026
@samir-acle samir-acle changed the title Feat/braze banner feat: braze banner May 14, 2026
Merged via the queue into main with commit 71d5a1c May 14, 2026
311 of 339 checks passed
@samir-acle samir-acle deleted the feat/braze-banner branch May 14, 2026 20:10
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue May 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-XL team-engagement

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants