Repository navigation
Conversation
Replace stayOnHomePage opt-out flag with first-screen detection (location.key === 'default') in confirmation-router.tsx. The redirect now fires only when the popup is initially opened, not on subsequent in-app navigation, eliminating the need for every caller to pass stayOnHomePage: true. Remove stayOnHomePage from all navigation calls, type definitions, and tests (useMainNavItems, money-account-balance, useBatchSellSubmitQuotes, useBatchSellNavigation, useBridgeNavigation). Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Contributor
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/earn (2 files, +3 -9)
🔄 @MetaMask/swaps-engineers (5 files, +5 -28)
|
7 tasks
Contributor
Builds ready [bb6cc13]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
|
|
n3ps
marked this pull request as ready for review
November 4, 2026 04:06
n3ps
enabled auto-merge
November 4, 2026 04:07
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
In Popup, the router redirected to Swap on EVERY navigation while quotes existed.
Navigation links had to override this with a
stayOnHomePage.Now it redirects only on the popup's first screen (
location.key === 'default') so we can remove this "stayOnHomePage" overrideChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes core popup routing when bridge/batch-sell quotes exist; wrong
location.keyhandling could skip needed redirects or leave stale quote hijacks, though behavior is covered by new and updated router tests.Reviewed by Cursor Bugbot for commit bb6cc13. Bugbot is set up for automated code reviews on this repo. Configure here.