Skip to content

refactor(perps): use MMDS BannerAlert for service interruption banner#33364

Open
brianacnguyen wants to merge 2 commits into
mainfrom
refactor/perps-home-interruptionbanner
Open

refactor(perps): use MMDS BannerAlert for service interruption banner#33364
brianacnguyen wants to merge 2 commits into
mainfrom
refactor/perps-home-interruptionbanner

Conversation

@brianacnguyen

@brianacnguyen brianacnguyen commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Description

Align the Perps service interruption (outage) banner with the MetaMask Design System by replacing the custom Box/Text/Icon layout with BannerAlert (BannerAlertSeverity.Warning) and a Contact support action button. Also move the banner above the Perps Home title with 16px bottom spacing so it’s more visible during an outage.

What changed:

  • Replaced the custom PerpsServiceInterruptionBanner UI with MMDS BannerAlert (warning severity, title, description, actionButtonLabel / actionButtonOnPress for Contact support)
  • Moved the banner on Perps Home from below the title / above balance actions to above the TitleHub, wrapped with px-4 mb-4 (16px bottom spacing)
  • Gated rendering with isServiceInterruptionBannerEnabled at the Perps Home placement site
  • Updated unit tests to press the Contact support action button via text instead of the old inline support-link testID

Changelog

CHANGELOG entry: Updated the Perps service interruption banner to use the design system warning alert with a Contact support action, and moved it above the Perps Home title

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/TAT-3565

Manual testing steps

Feature: Perps Home service interruption banner

  Scenario: user sees the outage banner above the Perps Home title
    Given the Perps service interruption banner feature flag is enabled
    And the user opens Perps Home

    When the home screen loads
    Then a BannerAlert Warning shows above the Perps Home title with 16px spacing below the banner
    And the banner shows the outage title, description, and a Contact support action button

  Scenario: user contacts support from the outage banner
    Given the Perps service interruption banner is visible on Perps Home

    When the user presses Contact support
    Then the app navigates to the support destination

  Scenario: user does not see the banner when the flag is off
    Given the Perps service interruption banner feature flag is disabled
    And the user opens Perps Home

    When the home screen loads
    Then the service interruption banner is not shown

Unit tests:

yarn jest app/components/UI/Perps/components/PerpsServiceInterruptionBanner/PerpsServiceInterruptionBanner.test.tsx

Screenshots/Recordings

Before

Simulator Screenshot - iPhone 15 Pro Max - 2026-07-14 at 11 49 08

After

Simulator Screenshot - iPhone 15 Pro Max - 2026-07-14 at 23 48 14

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

Low Risk
UI and layout-only changes with unchanged support webview navigation; no auth, data, or trading logic touched.

Overview
Replaces the custom Perps outage banner with design-system BannerAlert (warning severity, description, and a Contact support action button instead of an inline link).

On Perps Home, the banner is moved above the TitleHub (with horizontal padding and 16px bottom spacing) and is only mounted when isServiceInterruptionBannerEnabled is true at the home screen level.

Unit tests now assert support navigation via the Contact support action label rather than the old support-link testID.

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

Replace the custom outage banner with BannerAlert Warning and an action button, and place it above the Perps Home title with 16px spacing.

Co-authored-by: Cursor <cursoragent@cursor.com>
@brianacnguyen brianacnguyen self-assigned this Jul 15, 2026
@brianacnguyen brianacnguyen requested a review from a team as a code owner July 15, 2026 16:23
@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.

@github-actions github-actions Bot added the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 15, 2026
@metamask-ci metamask-ci Bot added the team-design-system All issues relating to design system in Mobile label Jul 15, 2026

@cursor cursor Bot left a comment

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.

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 244f441. Configure here.

Comment thread app/components/UI/Perps/Views/PerpsHomeView/PerpsHomeView.tsx
@github-actions github-actions Bot added the risk:low AI analysis: low risk label Jul 15, 2026
@brianacnguyen brianacnguyen removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokePerps, SmokeWalletPlatform, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR makes two focused changes to the Perps feature:

  1. PerpsServiceInterruptionBanner.tsx: Refactored from a custom-built banner (Box/Text/Icon with StyleSheet) to use the BannerAlert component from @metamask/design-system-react-native. This is a UI component swap — same functionality, different implementation. The action button (contact support navigation) is preserved via actionButtonOnPress.

  2. PerpsHomeView.tsx: The PerpsServiceInterruptionBanner was moved from an unconditional render position (below the title section) to a conditional render inside the title section, gated by isServiceInterruptionBannerEnabled. This changes both the visual position and the rendering logic.

  3. PerpsServiceInterruptionBanner.test.tsx: Unit test updated to match the new BannerAlert API.

Tag selection rationale:

  • SmokePerps: Directly covers the Perps home view and Add Funds flow. The banner positioning change and conditional rendering logic in PerpsHomeView need validation.
  • SmokeWalletPlatform: Required per SmokePerps tag description — Perps is a section inside the Trending tab, and changes to Perps views (headers, lists, full views) affect Trending.
  • SmokeConfirmations: Required per SmokePerps tag description — Add Funds deposits are on-chain transactions that go through the confirmations flow.

Risk is low because this is a UI refactor (component swap + repositioning) with no changes to business logic, data fetching, or navigation routing.

Performance Test Selection:
The changes are purely UI refactoring — replacing a custom banner implementation with a BannerAlert design system component, and repositioning the banner within PerpsHomeView. There are no changes to data fetching, state management, rendering loops, or performance-sensitive operations. The @PerformancePreps tag covers perps market loading and position management, but this UI-only change does not meaningfully impact those measured performance scenarios.

View GitHub Actions results

@github-actions github-actions Bot added risk:medium AI analysis: medium risk and removed risk:low AI analysis: low risk labels Jul 15, 2026
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

risk:medium AI analysis: medium risk size-M team-design-system All issues relating to design system in Mobile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant