Repository navigation
Register out-of-the-box block patterns - #15
Merged
roborourke merged 2 commits intoJul 20, 2026
Merged
roborourke merged 2 commits into
roborourke merged 2 commits into
Conversation
Implements issue #13. Adds a 'Popups' pattern category and six ready-to-use block patterns so users can get started without building popups from scratch. Changes: - popup.php: register 'hm-popup' pattern category in action_init(); load and register pattern definitions from the new patterns/ directory using register_block_pattern() - patterns/exit-intent.php: exit intent popup with close button and a core/group with the 'natural' WP box shadow - patterns/page-load.php: page load popup with close button and a core/group with the 'natural' WP box shadow - patterns/click-popup.php: trigger button + click popup with close button and a core/group with the 'natural' WP box shadow - patterns/left-popout.php: left slide-in panel (is-style-side--left), click trigger, first inner group has minHeight 100vh and a grey right border - patterns/right-popout.php: right slide-in panel (is-style-side--right), click trigger, first inner group has minHeight 100vh and a grey left border - patterns/tooltip.php: anchored tooltip (is-style-anchored, anchorPosition top) triggered by hovering an info icon; uses the hover trigger from #12 https://claude.ai/code/session_01SjvQ7YTxjFF81uSb1WtPAH
…gger
The beforeEach hook inserts a click-triggered popup, so the hover
frontend test had two .wp-block-hm-popup elements on the page.
Playwright's toHaveAttribute throws on multiple matches, causing CI
to fail.
Fixes:
- Use '#hover-test-popup' selector instead of '.wp-block-hm-popup' to
target only the hover popup, avoiding ambiguity with the click popup
inserted by beforeEach
- Replace raw paragraph HTML link with core/buttons + core/button
(same pattern used in anchoring.spec.js) for a reliable trigger
- Check toHaveAttribute('open', '') after hover to precisely assert
that dialog.show() was called (sets the open attribute)
https://claude.ai/code/session_01SjvQ7YTxjFF81uSb1WtPAH
mattheu
approved these changes
May 28, 2026
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.
Closes #13
Summary
Registers a "Popups" block pattern category and six ready-to-use patterns so users can get started without building popup layouts from scratch.
Changes
popup.phphm-popuppattern category ("Popups") inaction_init().patterns/*.phpfiles and callsregister_block_pattern()for each.patterns/(new directory — 6 files)hm-popup/exit-intentnaturalWP box shadowhm-popup/page-loadnaturalWP box shadowhm-popup/click-popupnaturalWP box shadowhm-popup/left-popoutis-style-side--left; first group:minHeight 100vh, grey right borderhm-popup/right-popoutis-style-side--right; first group:minHeight 100vh, grey left borderhm-popup/tooltipis-style-anchored,anchorPosition: top; ℹ️ icon trigger; requires PR #14How to test
https://claude.ai/code/session_01SjvQ7YTxjFF81uSb1WtPAH
Generated by Claude Code