feat(block-theme): replace template parts with new search overlay block#153
feat(block-theme): replace template parts with new search overlay block#153laurelfulford wants to merge 11 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates newspack-block-theme to stop using the legacy “search-menu” template parts + theme JS/SCSS overlay implementation, and instead use the new newspack/overlay-search block (provided by the Newspack Plugin) in header patterns.
Changes:
- Replaced
wp:template-partusage of thesearch-menutemplate part in header patterns withwp:newspack/overlay-search. - Removed the theme’s search overlay front-end implementation (SCSS, JS import, and template parts).
- Simplified menu accessibility helpers and removed now-unused localized strings related to the old search menu.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| themes/newspack-block-theme/src/scss/style.scss | Stops including the removed search overlay SCSS. |
| themes/newspack-block-theme/src/scss/overlays/_search.scss | Removes legacy search overlay + Jetpack Instant Search theming styles from the theme. |
| themes/newspack-block-theme/src/scss/overlays/_base.scss | Removes the search-menu-specific scroll locking exception. |
| themes/newspack-block-theme/src/scss/_base.scss | Removes legacy search icon mask styling tied to the deleted search toggle. |
| themes/newspack-block-theme/src/js/front-end/menus/search.js | Removes the legacy search overlay menu JS implementation. |
| themes/newspack-block-theme/src/js/front-end/menus/index.js | Removes search-menu-specific accessibility handling (no longer needed). |
| themes/newspack-block-theme/src/js/front-end/main.js | Stops importing the removed search menu script. |
| themes/newspack-block-theme/patterns/header/header-mobile-style-2.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-mobile-style-4.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-mobile-style-6.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-desktop-style-1.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-desktop-style-2.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-desktop-style-3.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-desktop-style-4.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/patterns/header/header-desktop-style-5.php | Uses the new newspack/overlay-search block in this header pattern. |
| themes/newspack-block-theme/parts/search-menu.html | Removes the legacy search menu template part. |
| themes/newspack-block-theme/parts/search-contents.html | Removes the legacy search contents template part. |
| themes/newspack-block-theme/includes/class-core.php | Removes now-unused localized strings/flags for the legacy search menu behavior. |
| themes/newspack-block-theme/assets/images/icon-search.svg | Removes the legacy search icon asset used by the old template part. |
|
@thomasguillot flagging this one for you in case there's anything that should be changed about the button/implementation - thanks! |
|
@laurelfulford I pushed a few follow-up commits on top of this to polish the header triggers — flagging what changed: Theme (
Plugin (
Commits |
|
Question on Jetpack Instant Search styling Removing I grepped both the theme and the plugin and those Test step 7 confirms the Jetpack overlay opens, but not that it still looks like Newspack. So with Jetpack Instant Search enabled, the results UI will likely fall back to default Jetpack styling. |
|
Thanks @thomasguillot!
🤦♀️ Thanks for catching that! The Instant Search styles have been reinstated in 644387a; the CSS file still lives in the same place but I renamed it to _instant-search.scss since the styles are specifically for the instant search now. |
thomasguillot
left a comment
There was a problem hiding this comment.
Thank you @laurelfulford
🚢
All Submissions:
Changes proposed in this Pull Request:
This PR replaces the block theme's original template parts + JavaScript approach to adding a search overlay with a search overlay block, added to the Newspack Plugin in Automattic/newspack-plugin#4729.
Closes NPPD-1546
How to test the changes in this Pull Request:
Checking template part cleanup
Other information: