Skip to content
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 Registration: add SlotFill to extend a block's description #49887

Open
jeherve opened this issue Apr 18, 2023 · 4 comments
Open

Block Registration: add SlotFill to extend a block's description #49887

jeherve opened this issue Apr 18, 2023 · 4 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Extensibility The ability to extend blocks or the editing experience Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended

Comments

@jeherve
Copy link
Contributor

jeherve commented Apr 18, 2023

What problem does this address?

It was previously possible to use React nodes in a block's description, like so:

description: (
		<Fragment>
			<p>
				{ __(
					'This block does something really fancy and complex.',
					'my-fancy-complex-block'
				) }
			</p>
			<p>
				{ __( 'Here is a detailed description about the things my block does.', 'my-fancy-complex-block' ) }
			</p>
			<ExternalLink href={ supportLink }>{ __( 'Learn more about how to use me', 'my-fancy-complex-block' ) }</ExternalLink>
		</Fragment>
	),

This allowed adding extra information to a block's description, such as links to support documentation or more.

Unfortunately, this is no longer encouraged since #44455.

What is your proposed solution?

Instead of adding all that information to the block's description itself, and since adding it there can have some unintended side-effects, it would be nice to add a new SlotFill that would be displayed right below the block's description in the editor sidebar, and nowhere else.

@gziolo gziolo added [Feature] Block API API that allows to express the block paradigm. Needs Dev Ready for, and needs developer efforts [Feature] Extensibility The ability to extend blocks or the editing experience labels Apr 18, 2023
@mtias
Copy link
Member

mtias commented May 31, 2023

@jeherve I'm curious if you'd expect this slot to be rendered wherever a block description is rendered. For example, in block previews in the inserter.

@jeherve
Copy link
Contributor Author

jeherve commented Jun 1, 2023

I would expect it to appear in the primary block sidebar only, not in the previews in the inserter. That's just me though. Maybe this could be a parameter?

@mtias
Copy link
Member

mtias commented Jun 1, 2023

So it might be good to contextualize the slot as InspectorBlockInfo or similar instead of something more generic. A parameter would be problematic on its own. it's not easy to anticipate all the contexts in which a description of a block might be rendered where the extender didn't expect.

@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Jul 26, 2023
@gziolo gziolo added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Jan 23, 2024
@fabiankaegy
Copy link
Member

Since this ticket hasn't seen any progress since it was originally punted in the 6.3 release cycle, I'm going to talke it out of the release tracking borad. That doesn't mean that it couldn't go into a release if someone works on it. But since it isn't a major priority we don't need to track it in the release board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Extensibility The ability to extend blocks or the editing experience Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
Development

No branches or pull requests

5 participants