Skip to content

fix(bridge): cp-7.67.0 fix "View on block explorer" button for swap and bridge transactions#26701

Merged
vinnyhoward merged 1 commit into
mainfrom
fix-25528-block-explorer-not-redirecting-to-browser
Feb 27, 2026
Merged

fix(bridge): cp-7.67.0 fix "View on block explorer" button for swap and bridge transactions#26701
vinnyhoward merged 1 commit into
mainfrom
fix-25528-block-explorer-not-redirecting-to-browser

Conversation

@vinnyhoward

@vinnyhoward vinnyhoward commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

The "View on block explorer" button on the Bridge/Swap Transaction Details screen was broken for both swaps and bridge transactions — pressing it did nothing.

Root causes:

  • Swap transactions: navigation.navigate(Routes.BROWSER.VIEW, ...) was called directly, but BROWSER.VIEW is a nested screen inside the BROWSER.HOME tab navigator. React Navigation silently ignores navigation calls to nested screens made from outside their parent. Additionally, navigating to a tab navigator replaces the current stack, so the back button would return to the home screen instead of activities.

  • Bridge transactions: navigation.navigate(Routes.BRIDGE.MODALS.TRANSACTION_DETAILS_BLOCK_EXPLORER, ...) was called directly, but this screen is nested inside BridgeModalStack (registered as Routes.BRIDGE.MODALS.ROOT). Same silent failure.

Fix:

  • Swap path now uses Routes.WEBVIEW.MAINRoutes.WEBVIEW.SIMPLE, which pushes a WebView on top of the current stack (back button returns to Transaction Details correctly)
  • Bridge path now navigates to Routes.BRIDGE.MODALS.ROOT with screen: TRANSACTION_DETAILS_BLOCK_EXPLORER as a nested param
  • Tightened the condition from a bare else to else if (isBridge) to prevent a swap with an unresolved explorer URL from accidentally opening the bridge modal

Changelog

CHANGELOG entry: Fixed "View on block explorer" button not working on Bridge/Swap Transaction Details screen

Related issues

Fixes: #26628

Manual testing steps

Feature: View on block explorer from Transaction Details

  Scenario: user views a completed swap on block explorer
    Given user has a completed swap transaction (same-chain)
    When user taps the transaction in Activity to open Transaction Details
    And user taps "View on block explorer"
    Then a WebView opens showing the block explorer for that transaction
    And tapping back returns the user to Transaction Details

  Scenario: user views a completed bridge on block explorer
    Given user has a completed bridge transaction (cross-chain)
    When user taps the transaction in Activity to open Transaction Details
    And user taps "View on block explorer"
    Then a bottom sheet appears with source and destination chain explorer options
    When user taps one of the explorer options
    Then a WebView opens showing that chain's block explorer for the transaction

Screenshots/Recordings

~

Before

before.mov

After

after.mov

Pre-merge author checklist

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 React Navigation targets for the “View on block explorer” flow and bridge explorer modal buttons, which is user-facing and could regress routing/back-stack behavior if route params or navigator structure differ across entry points.

Overview
Fixes the broken “View on block explorer” actions in Bridge/Swap transaction details by updating navigation to valid parent/nested routes.

Swaps now open the in-app WEBVIEW (Routes.WEBVIEW.MAINRoutes.WEBVIEW.SIMPLE) instead of Routes.BROWSER.VIEW, while bridges now navigate via Routes.BRIDGE.MODALS.ROOT to show the explorer-selection bottom sheet; the fallback logic is tightened to only open the modal for actual bridge transactions.

Updates/expands unit tests to mock navigation and assert the new webview/modal navigation behavior, including pressing source/destination explorer buttons in BlockExplorersModal.

Written by Cursor Bugbot for commit 77221e0. This will update automatically on new commits. Configure here.

@vinnyhoward vinnyhoward requested a review from a team as a code owner February 27, 2026 17:58
@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.

@metamaskbot metamaskbot added the team-mobile-ux Mobile UX team label Feb 27, 2026
@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: 85%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes modify navigation patterns in Bridge/Swap transaction details components:

  1. BlockExplorersModal.tsx: Changes navigation from Routes.BROWSER.VIEW to Routes.WEBVIEW.MAIN/SIMPLE for viewing block explorer links. This affects how users view transaction details on block explorers after bridge transactions.

  2. TransactionDetails.tsx:

    • For swaps: Changes from browser view to simple webview for block explorer links
    • For bridges: Fixes modal navigation to go through the proper modal stack (Routes.BRIDGE.MODALS.ROOT first)
    • Added explicit else if (isBridge) condition for clearer logic
  3. Test files: Updated to reflect the new navigation patterns with proper assertions.

These changes are scoped to the Bridge component's transaction details view, which is part of the bridge/swap flow. The SmokeTrade tag covers cross-chain bridging and token swaps, which is directly affected. Per tag guidance, SmokeConfirmations should also be selected when SmokeTrade is selected for swap/bridge flows since transaction confirmations are part of the flow.

The changes are navigation-related and don't affect core functionality, just the user experience of viewing block explorer links (using a simpler webview instead of the full browser with tabs).

Performance Test Selection:
The changes are purely navigation-related, switching from browser view to simple webview for block explorer links. There are no changes to UI rendering performance, data loading, state management, or critical user flows that would impact app performance. The navigation change is a simple route swap that doesn't affect render times or responsiveness.

View GitHub Actions results

@vinnyhoward vinnyhoward changed the title fix(bridge): fix "View on block explorer" button for swap and bridge transactions fix(bridge): cp-7.67.0 fix "View on block explorer" button for swap and bridge transactions Feb 27, 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.

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

expect(etherscanButtons).toHaveLength(1);
});

it('should navigate to webview when source chain explorer button is pressed', () => {

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.

New tests use prohibited "should" in names

Low Severity

The two newly added test names — 'should navigate to webview when source chain explorer button is pressed' and 'should navigate to webview when destination chain explorer button is pressed' — use the prefix "should", which violates the unit testing guidelines rule: "NEVER use 'should' in test names — this is a hard rule with zero exceptions." Action-oriented names like 'navigates to webview when …' are expected instead.

Additional Locations (1)

Fix in Cursor Fix in Web

Triggered by project rule: Unit Testing Guidelines

@vinnyhoward vinnyhoward Feb 27, 2026

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.

Not wasting my tokens on that right now

@vinnyhoward vinnyhoward added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit d7b7f79 Feb 27, 2026
189 of 196 checks passed
@vinnyhoward vinnyhoward deleted the fix-25528-block-explorer-not-redirecting-to-browser branch February 27, 2026 19:58
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 27, 2026
@metamaskbot metamaskbot added the release-7.69.0 Issue or pull request that will be included in release 7.69.0 label Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.69.0 Issue or pull request that will be included in release 7.69.0 size-M team-mobile-ux Mobile UX team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: View on block explorer does not redirect users to browser

4 participants