feat: update hamburger menu to use drawer#39991
Conversation
✨ Files requiring CODEOWNER review ✨🔑 @MetaMask/accounts-engineers (1 files, +0 -58)
👨🔧 @MetaMask/core-extension-ux (11 files, +652 -435)
🫰 @MetaMask/core-platform (3 files, +22 -7)
🔔 @MetaMask/notifications (1 files, +14 -4)
🧪 @MetaMask/qa (1 files, +6 -0)
|
|
@metamaskbot update-policies |
|
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff 👀 lavamoat/browserify/beta/policy.json changes differ from main/policy.json policy changes |
Builds ready [d758ba2]
UI Startup Metrics (1336 ± 101 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/components/multichain/app-header/app-header-unlocked-content.tsx
Outdated
Show resolved
Hide resolved
Builds ready [1c18c6f]
UI Startup Metrics (1387 ± 111 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [dada7d2]
UI Startup Metrics (1399 ± 119 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
| navigate( | ||
| `${NOTIFICATIONS_ROUTE}?from=${encodeURIComponent(location.pathname)}`, | ||
| ); |
There was a problem hiding this comment.
When user navigates from drawer to page, and returns back to home page. For the first back button, we show the drawer on homepage with transition
| // Show chevron for route items that have a valid route | ||
| const showChevron = isRouteItem(item); | ||
| // Show chevron for route items or when explicitly requested (e.g. notifications) | ||
| const showChevron = isRouteItem(item) || item.showChevron === true; |
There was a problem hiding this comment.
when there are no notifications and the user clicks for first tim, then a modal is rendered but we still need to show the chevron because after opt in it becomes a route
| import React from 'react'; | ||
| import { fireEvent, waitFor } from '../../../../test/jest'; | ||
| import { renderWithProvider } from '../../../../test/lib/render-helpers-navigate'; | ||
| import configureStore from '../../../store/store'; | ||
| import mockState from '../../../../test/data/mock-state.json'; | ||
| import { |
There was a problem hiding this comment.
This file doesn't make sense since after using drawer, global-menu popover is deprecated. Actual component will be removed in separate PR
| "@headlessui/react@npm:^1.7.17": | ||
| version: 1.7.19 | ||
| resolution: "@headlessui/react@npm:1.7.19" | ||
| dependencies: | ||
| "@tanstack/react-virtual": "npm:^3.0.0-beta.60" | ||
| client-only: "npm:^0.0.1" | ||
| peerDependencies: | ||
| react: ^16 || ^17 || ^18 |
There was a problem hiding this comment.
wrote the drawer component from scratch so removed it
Builds ready [a0a8a2c]
UI Startup Metrics (1383 ± 93 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [1bc10fe]
UI Startup Metrics (1410 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚀 Bundle size reduced!]
|
baptiste-marchand
left a comment
There was a problem hiding this comment.
LGTM on the Notifications files
ameliejyc
left a comment
There was a problem hiding this comment.
Overall lgtm! The behaviour works as expected. My only nit is when resizing the sidepanel with the menu open, the drawer doesn't stick to the right as it should and makes the experience quite bumpy. This is something we can revisit.
Description
This PR is to update hamburger to use global-menu drawer instead of global-menu popover component.
Note: This PR also removed the headless-ui library and implemented the drawer from scratch. Hence, the changes in
package.json. It's not impacted other files because we added that library only for drawer componentChangelog
CHANGELOG entry: replaced global-menu with global-menu-drawer
Related issues
Fixes: issue
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2026-02-16.at.9.46.22.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches core navigation and the global header menu/drawer behavior, including custom transition/portal logic and new URL-driven state, which could introduce regressions in routing or overlay interactions across environments.
Overview
Replaces the header hamburger
GlobalMenupopover withGlobalMenuDrawerWithList, and persists the drawer open/close state via adrawerOpenURL search param to avoid close/reopen flashes across route changes.Refactors
GlobalMenuDrawerto drop@headlessui/reactin favor of a custom, phase-based transition implementation, with updated portal/positioning logic for fullscreen and sidepanel environments plus Escape/outside-click closing.Updates global menu navigation to carry a
fromquery param intoNotifications,Snaps, and permissions routes and adjusts back-button behavior innotifications,snap-list,permissions-page, andgator-permissions-pageaccordingly; menu list styling/testids were tweaked, unit/e2e tests updated/added, and@headlessui/reactwas removed from dependencies.Written by Cursor Bugbot for commit a0a8a2c. This will update automatically on new commits. Configure here.