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

Delay the creation of links in the Navigation block #42075

Open
javierarce opened this issue Jun 30, 2022 · 2 comments
Open

Delay the creation of links in the Navigation block #42075

javierarce opened this issue Jun 30, 2022 · 2 comments
Labels
[Block] Navigation Affects the Navigation Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement.

Comments

@javierarce
Copy link
Contributor

javierarce commented Jun 30, 2022

When a user adds a Navigation block and clicks the plus icon of the inserter, we immediately insert a placeholder link with the text "Add link". After this, the user searches for a page or, a bit confusingly IMHO, "transforms" that temporary element into a Site logo, Social icons, or Search.

If the user changes their mind and clicks outside of the popover to close it, the menu ends up with an empty link they'll need to remove. Removing a link requires (if they don't use the Ctrl+Z combination): first, clicking on the menu, then clicking on the temporary link (which opens the LinkControl popover), then clicking the ellipsis button of the block toolbar, and finally clicking the "Remove Custom Link" option of the menu). It's too much work.

I'm not sure if there's a design or technical reason for adding empty links (maybe the LinkControl currently requires to be invoked by an existing link?), but I think that a better approach would be to delay the link's insertion until the user decides to do something.

Implementing that change would also require two other updates:

  • Renaming the "Transform" label into "Insert" (which I think is more clear).
  • Displaying the LinkControl under the inserter (right now we show it under the placeholder link, which is the right thing to do)
@javierarce javierarce added [Block] Navigation Affects the Navigation Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Jun 30, 2022
@javierarce
Copy link
Contributor Author

maybe the LinkControl currently requires to be invoked by an existing link?

If that's the reason for this behavior, maybe we could explore the idea of removing the Custom Link if the user closes the popover?

@talldan
Copy link
Contributor

talldan commented Jul 5, 2022

I think it would be possible to make a custom block appender that launches the link control when the + button is clicked.

There is a little bit of a hidden behavior that when the navigation block contains non-links or submenus (like a social icons) that's been inserted via the Block Library, then clicking the + shows the quick inserter (#34041). I think it'd still be possible to do that, but there might also be other options.

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants