feat: swap in Overlay Menu block to replace template parts#438
feat: swap in Overlay Menu block to replace template parts#438laurelfulford merged 3 commits intotrunkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces the theme’s custom mobile/drawer menu template parts and JS/CSS menu system with the Newspack Overlay Menu block, updating header patterns accordingly.
Changes:
- Remove legacy mobile/drawer menu JS modules and drawer SCSS, and stop importing them from the front-end entry points.
- Replace
mobile-menu/drawer-menupattern usage in header patterns withnewspack/overlay-menublocks. - Delete now-unused menu pattern/template-part files and update internal documentation notes.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scss/style.scss | Stops importing drawer overlay styles. |
| src/scss/overlays/_drawer.scss | Removes legacy drawer toggle styling. |
| src/js/front-end/main.js | Removes legacy menu initializers from the front-end bundle. |
| src/js/front-end/menus/mobile.js | Deletes legacy mobile menu initializer. |
| src/js/front-end/menus/drawer.js | Deletes legacy drawer menu initializer. |
| patterns/header/header-mobile-style-1.php | Replaces mobile-menu template-part with Overlay Menu block. |
| patterns/header/header-mobile-style-2.php | Replaces mobile-menu template-part with Overlay Menu block. |
| patterns/header/header-mobile-style-3.php | Replaces mobile-menu template-part with Overlay Menu block. |
| patterns/header/header-mobile-style-4.php | Replaces mobile-menu template-part with Overlay Menu block. |
| patterns/header/header-mobile-style-5.php | Replaces mobile-menu template-part with Overlay Menu block (right slide). |
| patterns/header/header-mobile-style-6.php | Replaces mobile-menu template-part with Overlay Menu block (right slide). |
| patterns/header/header-desktop-style-2.php | Replaces drawer menu pattern with Overlay Menu block. |
| patterns/header/header-desktop-style-3.php | Replaces drawer menu pattern with Overlay Menu block. |
| patterns/header/header-desktop-style-4.php | Replaces drawer menu pattern with Overlay Menu block. |
| patterns/drawer-menu.php | Deletes legacy drawer menu pattern. |
| parts/mobile-menu.html | Deletes legacy mobile menu template part. |
| parts/mobile-contents.html | Deletes legacy mobile menu contents template part. |
| parts/drawer-contents.html | Deletes legacy drawer contents template part. |
| AGENTS.md | Removes documentation describing the legacy dual menu systems. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
adekbadek
left a comment
There was a problem hiding this comment.
Tested. The Overlay Menu block renders correctly in all desktop (2–4) and mobile (1–6) header patterns. Panels open/close properly, including the right-slide direction for mobile styles 5–6. The code removal is clean – drawer and mobile JS/SCSS/template parts are gone, with the shared menu infrastructure (menus/index.js, overlay base styles) correctly preserved for search and comments menus.
One suggestion: the mobile-contents template part registration in theme.json (line 1192) is now orphaned since parts/mobile-contents.html was deleted. Non-blocking, but should be cleaned up in this PR.
|
Thanks for the review, @adekbadek! And for catching that template part mention I missed 🤦♀️ It's been removed in 0b30e97, so I'll get this merged! |
|
🎉 This PR is included in version 1.28.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
This PR removes the mobile menu and drawer template parts, and replaces them with the Overlay Menu block.
It should be tested along with Automattic/newspack-plugin#4642, which fixes a bug in the Overlay Menu Block that only seems to crop up when you're switching between template parts.
Closes NPPD-1397
How to test the changes in this Pull Request:
npm run build.Other information: