-
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
Adds a default text label to the block appender when it can only insert a single block type #22293
Conversation
Size Change: +289 kB (25%) 🚨 Total Size: 1.12 MB
ℹ️ View Unchanged
|
packages/block-editor/src/components/button-block-appender/index.js
Outdated
Show resolved
Hide resolved
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.
It works as expected and I was only able to nit pick a few low hanging fruits. Approving as there's no need to block it.
One note, if we're going to have this here I think it's important to say 'add link' not the longer text. Can we get an interaction with that, please? |
I am not sure about this thing. @mtias the original implementation of "if there is a single block type that can be appended, append that directly" added a tooltip that reads "Add blockname". Do we want custom shorter text for the navigation block, because the block name of the Navigation Link block is Navigation Link :) |
@draganescu for me the 'add' type is link though, I don't think it needs the navigation declaration. |
It should have the full block name. If we want to trim it down then we should trim down the block name itself. |
packages/block-editor/src/components/button-block-appender/style.scss
Outdated
Show resolved
Hide resolved
packages/block-editor/src/components/button-block-appender/index.js
Outdated
Show resolved
Hide resolved
also refactores out useless component
Description
Closes #20728
Adds a default text label to the block appender when it can only insert a single block type.
How has this been tested?
Tested locally by:
a) for the Navigation / Buttons block when selected the appender shows when the block is selected
b) for the Navigation / Buttons block when selected the appender has a label specifying the kind of block to add when the parent block is selected
c) for the columns block the default appender (after inserting a paragraph) does not show a label, but does show a tooltip with the text "Add block"
Screenshots
Types of changes
Non breaking change that reuses the text for the existing tool tip of the appender to show a default label next to the icon.
Issues
As can be seen in the GIF above, there are a few issues:
A separate issue is that is appears that blocks don't use the same appender. E.g. the social icons block does not show the "Add block" tooltip as you'd expect. neither is shows another tooltip at all, which means it uses a custom appender.