-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove LinkControl #24099
Comments
Great work collecting all the examples and thinking through this ⭐ I fully agree we shouldn't maintain multiple link editing components. What I'm not sure about is point 2:
The problem with this is that the input and the list of results aren't easily separable, because each have to contain aria attributes, labels and ids pointing to one another in order for the whole thing to make sense to a screen reader. So, my questions:
|
Thanks for starting this discussion and good analysis. The screenshots above are very inconsistent, some come from old designs, some from half-refactored ones and new ones never implemented. I still have doubts about whether removing LinkControl is the way to go for several reasons:
I'd love to see desired mockups for all the actual use-cases in Gutenberg right now, as this would help us figure out the best API we want to expose. |
They are already separated though, the
I see it as a good fit for all the instances of editing a link that's somehow related to a block: a button, a media block, a link inside a paragraph block. It wouldn't work where there is no block and toolbar to start with, but at the moment we don't have any link editing in a non-block context so that's not a big issue.
Potentially, it's always a tradeoff between customizability and the ease of use.
Potentially, sounds like something that's worth exploring 👍
@youknowriad you just described the scope of the design work required to bring in-toolbar editing to all the blocks :-) Maybe this issue came ahead of it's time - let's keep moving in-toolbar editing forward and have more atomic discussions on a per-use case basis in each specific PR. If/when in-toolbar editing is brought to all the blocks, let's revisit this issue. CC @shaunandrews |
True, but it has a default suggestions markup with the correct attributes, and that experimental prop is only being used in |
I'm still in favour of retaining By removing this control we'd be going backwards towards asking developers to manually wire together several highly complex components. This will likely return us to a fragmented user experience and add additional overhead where's it's not needed. |
This was heavily based on this
which never materialized because of the difficult a11y issues. I'll close this, we can come back to this idea once we have a clear alternative in place of |
tl;dr:
Let’s completely remove the concept of LinkControl as it exists today:
And expose the basic building blocks via @wordpress/components instead (names and details are up for discussion):
Motivation
The link editing experience across Gutenberg is far from being consistent. We have plenty of link editing components and UI, most of them could be disposed of. Recently @shaunandrews proposed an in-toolbar link editing UI (#23375) which I really like. I only have two problems with it: 1. It’s yet another link editing interface 2. It requires using our basic building blocks in a ways they were not designed/programmed for. During my refactoring journey (#23869) I found that the link editing UI is a subject of endless issues and debates - there are bugs, missing features, inflexible abstractions. So instead of adding another UI on top of what’s already in place, I decided to take a look at the big picture first and see if there’s an elegant way of using this opportunity as a launchpad to solving the bulk of our link editing problems.
All existing link editing UIs listed in one place
To keep this issue nice and short, I listed all the existing UIs in a dedicated issue here: #24089
All the related issues listed in one place
The list below was put together by @youknowriad in the comment under a related PR:
#18061 #22439 #22438 #22437 #22435 #20271 #20138 #20136 #20051 #19526 #17293
The gist of these issues is that:
rel
(at least noreferrer/noopener),target
(at least new tab or same tab), a custom CSS class.Analysis
We would have to either:
The in-toolbar link editing by @shaunandrews (#23375) could replace almost all LinkControl usages listed in #24089. It would likely need some more discussion to decide about e.g. editing a CSS class, or linking to a media file, but apart from these tactical details it’s just what we need in general.
The only remaining LinkControl instance that wouldn’t be affected by the introduction of in-toolbar editing is
PageSwitcher
(see #24089):It doesn’t use the full power of LinkControl too - it’s just an input, a loading indicator, and navigable suggestions. There is no link preview, „create new page” control, or a way to use verbatim input as typed.
So I’d say, let’s remove the LinkControl component as it exists today:
CC @talldan @youknowriad @shaunandrews @draganescu @tellthemachines @noisysocks @getdave
The text was updated successfully, but these errors were encountered: