metamask-mobile icon indicating copy to clipboard operation
metamask-mobile copied to clipboard

feat: shield-deep-link

Open tuna1207 opened this issue 1 month ago • 2 comments

Description

This PR add shield deep link handle which open shield website in app browser instead of showing invalid deeplink screen for shield

Changelog

CHANGELOG entry: Handle shield deep link

Related issues

Fixes:

Manual testing steps

Feature: shield deep link

  Scenario: user use shield deep lnk
    Given app with wallet created

    When user press shield deep link
    Then app open with in app browser to shield website

Screenshots/Recordings

Before

After

https://github.com/user-attachments/assets/053920c9-104c-4d68-9277-788a4c2bc9fd

Pre-merge author checklist

Pre-merge reviewer checklist

  • [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • [x] 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] Adds ACTIONS.SHIELD deep link that opens the MetaMask Transaction Shield website in the in-app browser, with support in both legacy and v2 navigation handlers and accompanying tests.

  • Deep link handling:
    • Add ACTIONS.SHIELD and SHIELD_WEBSITE_URL constant (https://metamask.io/transaction-shield).
    • Legacy handler: route shield links to handleBrowserUrl with SHIELD_WEBSITE_URL.
    • V2 NavigationHandler: support shield, navigate to Routes.BROWSER.VIEW with { newTabUrl: SHIELD_WEBSITE_URL, linkType: EXTERNAL_LINK_TYPE, timestamp }.
  • Tests:
    • Legacy universal link tests: add case asserting shield is handled.
    • V2 navigation tests: add case asserting navigation to browser with SHIELD_WEBSITE_URL.

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

tuna1207 avatar Dec 04 '25 10:12 tuna1207

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 78.87%. Comparing base (71b1e6e) to head (9b593f8). :warning: Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23663      +/-   ##
==========================================
- Coverage   78.89%   78.87%   -0.03%     
==========================================
  Files        4050     4054       +4     
  Lines      106202   106308     +106     
  Branches    21458    21492      +34     
==========================================
+ Hits        83789    83849      +60     
- Misses      16536    16573      +37     
- Partials     5877     5886       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov-commenter avatar Dec 11 '25 13:12 codecov-commenter

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeCore
  • Risk Level: low
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

The changes add a new deeplink action "SHIELD" that opens the MetaMask Shield website in the in-app browser. This is an additive change that:

  1. Creates a new constant file (app/constants/shield.ts) with a URL
  2. Adds SHIELD to the ACTIONS enum in deeplinks.ts
  3. Adds a new case handler in handleUniversalLink.ts that uses the existing handleBrowserUrl function
  4. Includes comprehensive unit tests for the new functionality

The change follows established patterns already used by similar actions (like PREDICT) and doesn't modify any existing functionality. The handleBrowserUrl function being used is already well-tested and stable.

While the files are in app/core/ (marked as critical), the changes are minimal, additive, and well-tested at the unit level. No E2E tests exist specifically for deeplink handling in the test suite.

Selecting SmokeCore as a sanity check since this touches core deeplink infrastructure, but the risk is low given the additive nature and pattern-following implementation.

View GitHub Actions results

github-actions[bot] avatar Dec 13 '25 05:12 github-actions[bot]