-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Some blocks, like the Paragraph, Navigation Link, and Button block, require a URL for the block to function. Right now these blocks tend to open addition UI to allow for manipulation of this required data:
You'll notice that the Paragraph block alters the link icon in the toolbar, allowing a user to unlink the selected text. Navigation Link and Button blocks don't follow this pattern, instead clicking on the icon always opens the link UI.
For the Navigation Link block specifically, we've been looking at exposing the URL directly within the block's toolbar (#23023):
The next logical step for this UI is to allow manipulation of the data from directly within the toolbar. As this isn't an isolated need, this issue aims to explore how we could allow for manipulation of URL (or general text-based) data directly from any block's toolbar.
--
The somewhat mysterious link icon is replaced with a more obvious text label; Edit Link when a link has been set, and Link when there is no link set.
If there's a link, hovering over this button for a few seconds will display the current URL in a tooltip:
When clicked, a new Link UI appears with :focus
moved to the URL input alongside options like "Open in new window" and a Done button. The Link UI consumes the toolbar, hiding the selected block's buttons.
--
This also touches on some recent work around Reusable blocks and Templates (#23213), where there is often the need to display/change a descriptive name: