-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Directory: Installed blocks show up in the block directory results #24560
Comments
I would expect the regular block should be shown. The block directory should not show up at all. An exception to this could be down the road when a user can intentionally initiate a search of the block directory. Then, I would expect installed blocks would show something to indicate it's already installed. Like you mention, that could be as simple as changing the "Add block" button to "Insert." That will definitely need some design iteation.
I think that's also a good problem to solve early on if possible. |
This seems like a great first step and easy to implement.
Are there some small steps we can make towards this? |
I believe Having the Install button swap for Insert is a reasonable middle ground I feel, we could also clear the search cache after installing, but that would result in the Although I haven't tested it right now, searching for |
I think #22149 is looking into solving that problem. The next step is probably to get a prototype going. |
@tellyworth Possibly. I'm just starting to explore the options. |
The one challenge I see is that if the block doesn't add the keyword to its keyword list, that specific block will behave differently from other installed block directory blocks forever. We may want to consider updating the inserter algorithm to contain more information about the block to widen the net. Algorithm:
|
Describe the bug
Blocks found in the block directory that are already installed are not treated differently than uninstalled blocks. If you search for a term that does not match the local block, but does match the criteria for the block directory, the installed block will appear as an option to install.
If the user clicks "Add Block", this technically works, but does show an error in console, trying to request a page that doesn't exist (ex:
http://trunk.wordpress.test/wp-admin/undefined
). I'm guessing that has to do with the code to load new assets into the page.To reproduce
Steps to reproduce the behavior:
Expected behavior
Either the block in the regular block list should be shown, or the block directory entry should indicate that this is already installed. Or maybe nothing should change in the UI, and only the "add block" action should change?
Another approach could be finding out why "gradients" matches waves on wp.org, but not in the editor, and bringing that into line.
Screenshots
Waves is already installed, but it shows up to add here:
The text was updated successfully, but these errors were encountered: