-
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
Try: Replace BlockDescription component with block type property #1924
Conversation
One concern with this change is that it wouldn't allow for markup in the description, would it? It also wouldn't allow for multiple paragraphs. I have this in a pending PR: #1625 |
This is a good point to raise. Technically with this revised implementation, the Related considerations:
|
As I mentioned a few times, The tl;dr: Do we need two types of description? A "real" description and something more like a help text? Help text definitely need to allow for markup, while a subtitle might not. |
My hunch is: probably? Thinking for example better explanation of a block's purpose in the inserter (tooltip, subtitle, etc). But these use-cases don't seem very well fleshed out yet. I'd be fine to punt this for now since there does seem an obvious need for markup in the inspector. Previous consideration still stands so far as needing localization solution for markup-interspersed-React-element-content. |
In recent developments, the sidebar has become tabbed, with a block option you can choose to have permanently open. As @swissspidy notes, this is a great place to show "help text" for every block. One of the things I think is important, is to wrap as much block functionality as possible, in as simple a block registration code as possible. And it would be really nice to have help text for every single block that registers itself with a description, using strong visual patterns like this: We might even want to show a message in the sidebar block tab, that "This block has no description", to encourage block authors to add one. We definitely do want to allow block authors to add still more stuff to the inspector, down below the help text up top. And we'd want to be sure authors can have links in their help text. But outside of that, I see great value in standardizing some of this stuff. |
Related: #1555
This pull request explores an alternative to #1555, wherein a block can add its description to the inspector by rendering the
<BlockDescription>
component in the block inspector slot. The intent here is to treat description as a base property of a block type, rather than one which is specific to the inspector or edit rendering. The purpose being: a description pairs well with other top-level properties (title, icon), may be useful outside the context of edit, is simpler to document for basic block behaviors, and may need explicit arrangement in the block inspector slot (see #1889 caveats).There is otherwise no functional difference from the behavior implemented in #1555.
Testing instructions:
Verify that the block description is shown in the sidebar "Block" inspector for the selected block.