Skip to content

Link UI: Add and edit links directly within the block toolbar #23375

Open

Description

@shaunandrews

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:

image

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):

image

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.

--

linke-ui-4

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.

image

If there's a link, hovering over this button for a few seconds will display the current URL in a tooltip:

image

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.

image

--

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:

image

Activity

  1. adamziel commented on Jun 23, 2020

    @adamziel
    Contributor

    #23023 now contains a super rough prototype of this idea, more progress will come

  2. changed the title [-]Support for text-based data manipulation directly within the block toolbar[/-] [+]Link UI: Add and edit links directly within the block toolbar[/+] on Jun 23, 2020
  3. added
    [Feature] List ViewMenu item in the top toolbar to select blocks from a list of links.
    [Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)
    on Jun 23, 2020
  4. mtias commented on Jun 24, 2020

    @mtias
    Member

    Really like absorbing the link editing flow in the toolbar for these blocks, it's the natural progression. However, I don't think the link icon is any more mysterious than the other icons in use, and the verbiage clearly starts to break down in the image block example with three text based buttons which starts to affect the ability to scan, in my opinion.

    Also I think showing "Edit Link" for navigation menu items is worse than displaying the actual link, which gives me better and quicker information. I think it's fine for the link to collapse to the icon in other cases like images, but for navigation it's the primary element.

  5. pablohoneyhoney commented on Jun 24, 2020

    @pablohoneyhoney

    Word form of the action only makes sense when it creates a better hierarchy with the surrounding UI, or there’s no better way to describe the action itself. It gets convoluted with various words. Worth pushing the possibilities of the icon, and only use word form when we exhausted the capabilities of the icons.

  6. adamziel commented on Jun 24, 2020

    @adamziel
    Contributor

    A more advanced prototype available in #23023 (comment) - any feedback is appreciated!

  7. shaunandrews commented on Jun 24, 2020

    @shaunandrews
    ContributorAuthor

    Thanks for the feedback above. I've been working more on this and have some progress to share with regards to the Link UI in context of the Paragraph block:

    linke-ui-5

    This one uses the link icon as the way to toggle the Link UI, and as a visual anchor for the Link UI's toolbar. Once you start typing, search results are shown — this is similar to the current Link UI, but with some style updates and simplification:

    image

    Once the link is added a dropdown icon appears with more advanced options:

    image

    There's also a new "linked" state for the Link button in the toolbar, which is shown here with a subtle (maybe too subtle) blue background, matching the blue background we use to highlight links in the block content:

    image

  8. adamziel commented on Jun 25, 2020

    @adamziel
    Contributor

    As the design discussion is still going, I will put my PR on hold for now

  9. shaunandrews commented on Jun 25, 2020

    @shaunandrews
    ContributorAuthor

    Here's a few quick GIFs that shows how this would work on the Button and Navigation blocks:

    linke-ui-buttons

    linke-ui-nav

  10. 28 remaining items

  11. afercia commented on Sep 2, 2020

    @afercia
    Contributor

    Worth mentioning the proposed pattern, that basically "replaces on the fly" part of the toolbar with another UI still needs to be fully evaluated from an accessibility perspective, as noted in #24805.

    There are serious concerns this pattern can be reasonably reconducted to an accessible pattern that provides a predictable, expected, interaction and semantics. To name a few of the main concerns:

    • the accessibility team pointed out several times that replacing a portion of the DOM that contains focus with another UI is problematic for assistive technologies and totally unexpected for users
    • even for users with no particular accessibility needs, I'd argue the replacing-on-the-fly effect is unexpected, jarring, and adds cognitive load
    • semantically, an ARIA toolbar must exclusively contain "a collection of commonly used function buttons or controls represented in compact visual form" while in this proposal it will also contain a form, which is unexpected
    • the Gutenberg toolbars implement the arrow keys navigation and the "roving tabindex" patterns, which are the expected interaction patterns for toolbars: the replaced additional UI would break this pattern in the same way it's already breaking it for the Image block "editing tools", see Accessing image block's crop tools with keyboard results in focus loss #24676 and The image block's editing tools break the toolbar keyboard accessibility #24766

    Overall, a toolbar is expected to only contain buttons that open menu or "do something". Also important: assistive technology software are designed to understand the ARIA toolbar pattern if it's built according to the specs. Breaking the expected pattern by injecting an extraneous UI within a toolbar would prevent assistive technologies from working correctly thus making the UI not operable by the persons who use that software.

  12. paaljoachim commented on Sep 22, 2020

    @paaljoachim
    Contributor

    Taking a step back and looking at the current UX patterns.

    Existing-UX-pattern

    The above gif shows how we interact with the toolbar. When clicking an icon that contains additional options a drop down is seen.

    With the new link control inline editing current version Navigation screen PR:

    Inline-Editing

    The UX:

    Inline editing is a new UX pattern. Actions happen inside the toolbar. The toolbar changes to show an action.

    It breaks the consistency seen in the current toolbar in Gutenberg where one clicks an icon to open a drop down showing additional options. The interaction happens outside the toolbar. The toolbar remains unchanged by any drop down action. Having a non changing toolbar like a mountain can be very comforting. Changing elements are kept outside what is seen as static.

    Will additional toolbar actions be brought inline creating a more dynamic toolbar? It feels like inline editing is just one of multiple bigger changes that will make the toolbar more dynamic based on the action being selected. Leaving the consistency of the non changing toolbar to something that reacts to the action of the user.


    Edit: 17 May 2021. Adding in the following comment as we closed this issue:
    URLInput: Include date as context for link search results
    #8573
    The now closed issue mentions showing the date beside the post/page title. (I like likely added a comment above but since the issue is closed, I am adding a comment again.)
    Similar to this example from the Classic Editor like so:
    Screen Shot 2021-05-17 at 21 43 39

  13. tnchuntic commented on Dec 23, 2022

    @tnchuntic
  14. paaljoachim commented on Dec 23, 2022

    @paaljoachim
  15. jordesign commented on Aug 24, 2023

    @jordesign
    Contributor

    This issue is still relevant for Navigation items and Images. But in my testing the behaviour is resolved for Buttons.

  16. draganescu commented on Aug 24, 2023

    @draganescu
    Contributor

    In light of the efforts in #50891 is this proposal still open for exploration? The accessibility review here is pretty blocking.

    I love the interaction in this design issue - opening a popover from a poover is not the best experience. However switching in and out of these modes echoes the problems in #53852.

    cc @richtabor

  17. getdave commented on Aug 24, 2023

    @getdave
    Contributor

    It's worth noting that this is a different context to #53852. The primary objections there (once I added the visible Submit/Cancel buttons) were from Design and were specifically due to the UI's location within the List View which is a very "busy" part of the interface.

    Perhaps in a different context this would be workable. However, I would caution against anyone proceeding here without some upfront design exploration to determine whether or not inline editing in this location is feasible from a Design perspective.

  18. Mamaduka commented on Nov 26, 2024

    @Mamaduka
    Member

    @WordPress/gutenberg-design, is this proposal still under consideration?

    It seems that implementing similar design pattern and making fully accessible is the real problem. Ref: #24676, #53852.

  19. added and removed
    [Feature] List ViewMenu item in the top toolbar to select blocks from a list of links.
    on Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] BlocksOverall functionality of blocks[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions