Skip to content

fix: add bridge missing-price warning flow#29250

Merged
bfullam merged 5 commits into
mainfrom
swaps-missing-prices-warning
Apr 24, 2026
Merged

fix: add bridge missing-price warning flow#29250
bfullam merged 5 commits into
mainfrom
swaps-missing-prices-warning

Conversation

@bfullam

@bfullam bfullam commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds the missing-price warning flow for bridge quotes when price data is unavailable. It shows an inline danger banner in the bridge view, presents a confirmation modal before submission, and keeps the warning order consistent so token warnings are handled before the missing-price prompt. It also adds unit coverage for the new banner, modal, and warning sequencing.

Changelog

CHANGELOG entry: Added a warning flow in bridge quotes when token price data is unavailable.

Related issues

Fixes: SWAPS-4387

Manual testing steps

Feature: bridge missing-price warning flow

  Scenario: user sees a missing-price warning on the quote
    Given a bridge quote is available without price data

    When user reviews the bridge quote
    Then the bridge view shows a danger warning about missing price information

  Scenario: user confirms a bridge quote with missing price data
    Given a bridge quote is available without price data

    When user taps the button to continue with the bridge quote
    Then a missing-price confirmation modal is shown before submission

  Scenario: user sees token warning before missing-price confirmation
    Given a bridge quote is available with a token warning and without price data

    When user taps the button to continue with the bridge quote
    Then the token warning modal is shown first
    And continuing from the token warning opens the missing-price confirmation modal

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

Not applicable for this warning-flow change.

  • 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
Changes the bridge confirmation routing to block submission and require an extra modal confirmation when quote price data/price impact is missing, which could affect transaction flow if the detection logic misfires. UI-only banner/text updates are low risk, but the new gating impacts a core swap/bridge path.

Overview
Adds a missing price data warning flow for bridge quotes: when activeQuote.quote.priceData or priceImpact is absent/empty, the Bridge view now shows an inline danger BannerAlert and the confirm action routes to a new MissingPriceModal instead of submitting.

Introduces hasMissingPriceData() for shared detection, wires the new modal into Routes/bridge modal stack, and ensures warning precedence: token warning modal is shown first, and proceeding from TokenWarningModal can redirect into the missing-price modal. Updates the English copy for the missing-price title/body and adds unit tests covering banner rendering and modal routing/ordering.

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

@bfullam bfullam requested a review from a team as a code owner April 23, 2026 11:47
@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-swaps-and-bridge Swaps and Bridge team label Apr 23, 2026
@github-actions github-actions Bot added size-L risk:high AI analysis: high risk labels Apr 23, 2026
Comment thread app/components/UI/Bridge/utils/hasMissingPriceData.ts
@bfullam bfullam changed the title Fix bridge flows for missing price data fix: add bridge missing-price warning flow Apr 23, 2026
Comment thread app/components/UI/Bridge/Views/BridgeView/index.tsx

@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 3448bbe. Configure here.

Comment thread app/components/UI/Bridge/components/MissingPriceModal/MissingPriceModal.test.tsx Outdated
@github-actions

Copy link
Copy Markdown
Contributor

AI PR Analysis

🚫 Merge safe: false | 🟠 Risk: high

Merge decision: AI analysis did not complete — manual review required before merging.

AI analysis did not complete. Manual review recommended.

View run

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR introduces a new "Missing Price Data" warning flow in the Bridge/Swap UI:

  1. New hasMissingPriceData utility - detects when price impact data is absent from a quote
  2. New MissingPriceModal component - a bottom sheet that warns users when price data is unavailable, with Proceed/Cancel options that can still execute the bridge/swap
  3. New route Routes.BRIDGE.MODALS.MISSING_PRICE_MODAL registered in the modal stack
  4. BridgeView - shows a BannerAlert danger banner when an active quote has missing price data
  5. SwapsConfirmButton - intercepts the confirm action to navigate to MissingPriceModal before proceeding when price data is missing
  6. TokenWarningModal - when proceeding from the token warning modal, redirects to MissingPriceModal if price data is also missing
  7. Localization - updated warning text strings

All changes are scoped to the Bridge/Swap feature area. The new modal intercepts the swap/bridge confirmation flow, so:

  • SmokeTrade is required: covers bridge and swap execution flows that are directly modified
  • SmokeConfirmations is required: per SmokeTrade tag description, "when selecting SmokeTrade for swap/bridge, also select SmokeConfirmations"

No changes to core controllers, navigation infrastructure, account management, network management, or other feature areas. The changes are UI-level additions to the bridge flow with no performance-critical impact (no list rendering, no state management changes, no app startup changes).

Performance Test Selection:
The changes are limited to adding a new warning modal and banner in the Bridge/Swap UI flow. There are no changes to list rendering, account loading, state management, app startup, or other performance-sensitive areas. The new MissingPriceModal is a simple bottom sheet that only appears in edge cases (missing price data), and the BannerAlert is a lightweight UI component. No performance tests are warranted.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
12 value mismatches detected (expected — fixture represents an existing user).
View details

@bfullam bfullam added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 3d37a2f Apr 24, 2026
161 of 163 checks passed
@bfullam bfullam deleted the swaps-missing-prices-warning branch April 24, 2026 08:26
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.76.0 Issue or pull request that will be included in release 7.76.0 label Apr 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.76.0 Issue or pull request that will be included in release 7.76.0 risk:high AI analysis: high risk size-L team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants