fix(bridge): cp-7.67.0 fix "View on block explorer" button for swap and bridge transactions#26701
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
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: |
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.
| expect(etherscanButtons).toHaveLength(1); | ||
| }); | ||
|
|
||
| it('should navigate to webview when source chain explorer button is pressed', () => { |
There was a problem hiding this comment.
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)
Triggered by project rule: Unit Testing Guidelines
There was a problem hiding this comment.
Not wasting my tokens on that right now


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, butBROWSER.VIEWis a nested screen inside theBROWSER.HOMEtab 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 insideBridgeModalStack(registered asRoutes.BRIDGE.MODALS.ROOT). Same silent failure.Fix:
Routes.WEBVIEW.MAIN→Routes.WEBVIEW.SIMPLE, which pushes aWebViewon top of the current stack (back button returns to Transaction Details correctly)Routes.BRIDGE.MODALS.ROOTwith screen:TRANSACTION_DETAILS_BLOCK_EXPLORERas a nested paramChangelog
CHANGELOG entry: Fixed "View on block explorer" button not working on Bridge/Swap Transaction Details screen
Related issues
Fixes: #26628
Manual testing steps
Screenshots/Recordings
~Before
before.mov
After
after.mov
Pre-merge author checklist
Pre-merge reviewer checklist
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.MAIN→Routes.WEBVIEW.SIMPLE) instead ofRoutes.BROWSER.VIEW, while bridges now navigate viaRoutes.BRIDGE.MODALS.ROOTto 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.