-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support searching for patterns #21944
Conversation
Size Change: +298 B (0%) Total Size: 825 kB
ℹ️ View Unchanged
|
e09675f
to
bdb84f5
Compare
This is working really well, Riad! 1. LabelsI know that this is following the proposal from #21080, but because patterns don't have a label, I don't know what to search for in the first place. I'd love to hear what you think @mapk and @mtias. I think labels are important for many reasons, search being one of them. 2. Global searchBecause the search box is above the 'Blocks' and 'Patterns' tabs, I expected searching to be global among those two categories. See #21080 (comment) for an example. Is this something we can try? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youknowriad – the revised search logic for blocks and patterns is just great 👏
This is looking good, nice work, good small iterative improvements as we learn what is necessary and what isn't. I'm seeing a horizontal scrollbar: If I apply Digging a little deeper, if I remove
after:
And you get this: |
@jasmussen this suggest change looks good but noting that I don't have the issue myself. It also seems the suggestions breaks the block previews for the style variations. |
Yes, at least they should show up when you search. We still need to work through the categories for patterns. |
dc257d4
to
30b556e
Compare
I restored the labels for patterns and I explored global search on this branch https://github.com/WordPress/gutenberg/tree/try/global-search the global search is a bigger change than I originally thought for the inserter code. Let me know how it feels and if you think we should merge it here or move forward with the separate search as v1. |
Let's do separate search to get it merged while we still refine the design. |
@jasmussen sorry a small mistake of mine, I force pushed (fixed) |
Ok, so for me this is ready to land as a V1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that it was introduced here, but the keyboard behavior for inserting a pattern appears broken:
- Navigate to Posts > Add New
- Toggle top-level inserter
- Press Tab to transition from search input to tabs
- Press ArrowRight to change to Patterns tab
- Press Tab to shift focus to the first pattern
- Press Enter to insert
Observe:
packages/block-editor/src/components/inserter/block-patterns.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/inserter/use-async-list.js
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/inserter/use-async-list.js
Outdated
Show resolved
Hide resolved
bb640a1
to
15b61e0
Compare
Keyboard insertion is fixed, it was broken in master too. |
a43c8fd
to
5d5e60e
Compare
Co-authored-by: Andrew Duthie <[email protected]>
5d5e60e
to
07a246a
Compare
"integrity": "sha512-ejdnDQcR75gwknmMw/tx02AuRs8jCtqFoFqDZMjiNxsu85sRIJVXDKHuLYvUUPRBUtV2FpSZa9bL1BUa3BdR2g==", | ||
"version": "0.5.3", | ||
"resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", | ||
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included to make travis tests pass (I had to reinstall deps to have the diff)
Curious has this been done? I just created a few custom block patterns using register_block_pattern and added keywords to the patterns, but if I'm in the Gutenberg editor and type a forward slash on a new line, I only see blocks (no patterns). Seems like this should also search for patterns (which I believe is what the OP was getting at). Anyways, thanks for you hard work! Cheers. |
@bradley2083 The search has only been implemented on the main inserter (not the slash inserter). having it on the slash inserter is a great idea though, would you mind opening an issue for it? |
Thank you |
closes #17122
Related #20951 #21080
this patterns allows searching for patterns (like blocks). Implicitly, it also adds "keywords" support for patterns.
I also updated the "no results" state to match #20951 (comment)