Skip to content

fix: Correct name for useSnapNavigation return value#40950

Merged
FrederikBolding merged 1 commit intomainfrom
fb/fix-snaps-links
Mar 17, 2026
Merged

fix: Correct name for useSnapNavigation return value#40950
FrederikBolding merged 1 commit intomainfrom
fb/fix-snaps-links

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Mar 17, 2026

Description

Fixes an issue where defining metamask:// URLs in Snaps would not work because the return value for useSnapNavigation was updated without changing all the usages.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Fixed an issue with Snaps links


Note

Low Risk
Low risk rename-alignment change limited to Snap UI link handling; main risk is regressions in metamask: link click behavior if any callers still expect the old navigate return shape.

Overview
Fixes Snap UI metamask: link handling by updating SnapUILink and SnapUIMarkdown to call useSnapNavigation()’s renamed handleSnapNavigate function instead of the previously-referenced navigate.

This restores in-app navigation for metamask: URLs originating from Snap-rendered links and markdown.

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

@FrederikBolding FrederikBolding requested a review from a team as a code owner March 17, 2026 10:09
@metamaskbot metamaskbot added the team-core-platform Core Platform team label Mar 17, 2026

const isMetaMaskUrl = href.startsWith('metamask:');
const { navigate } = useSnapNavigation();
const { handleSnapNavigate } = useSnapNavigation();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value was changed in f167e26

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Mar 17, 2026

✨ Files requiring CODEOWNER review ✨

🫰 @MetaMask/core-platform (2 files, +4 -4)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 snaps/
          • 📁 snap-ui-link/
            • 📄 snap-ui-link.js +2 -2
          • 📁 snap-ui-markdown/
            • 📄 snap-ui-markdown.js +2 -2

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Mar 17, 2026
@sonarqubecloud
Copy link

@FrederikBolding FrederikBolding added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit 4639825 Mar 17, 2026
195 of 198 checks passed
@FrederikBolding FrederikBolding deleted the fb/fix-snaps-links branch March 17, 2026 11:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2026
@metamaskbot metamaskbot added the release-13.24.0 Issue or pull request that will be included in release 13.24.0 label Mar 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template release-13.24.0 Issue or pull request that will be included in release 13.24.0 size-XS team-core-platform Core Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants