You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URLInput and LinkControl are powering every other link editing UI. Let’s see how they’re used:
<MediaReplaceFlow />
It makes it possible to replace one media file with another without removing the media block. <LinkControl /> powers the „Current media URL” part of the popover below:
Suggestions are not displayed, but it seems like they’re still requested as the following progress indicator suggests:
I don’t think the entire machinery of <LinkControl /> needs to be used here - this is essentially a regular input field and we could replace it with one.
What's needed here is the input and the suggestions list. We don't need link preview, settings (opens in new tab), or a way to create a new post inline (?). It could also use some cleaning up (e.g. getting rid of the „post” badge or the localhost:8889 part of the URL).
LinkEditor is used in a few different contexts. When used in media placeholder or social link, it’s just a regular input field that doesn’t need to fetch any suggestions:
I recommend replacing the URLInput in the above components with a regular input field or a component from @wordpress/components.
Then there is a the following color picker which, surprisingly, uses a URLPopover internally:
It doesn’t have anything to do with URLs though, and we even have a different color picker component that uses a regular Popover:
I recommend replacing the URLPopover in the above components with a regular Popover component.
Lastly, the image block uses a customized version of URLPopover to support Media File and Attachment Page choices. Upon typing, it displays page suggestions using only page title and no URL:
This should be solved as a part of the in-toolbar link editing in #23375.
Summary
I believe this covers all places where URLInput or LinkControl are being used. Let's discuss proper next steps in respective issues listed at the top.
The text was updated successfully, but these errors were encountered:
What is this issue?
This is an issue which sole purpose is supporting the discussion in #24099. This issue is not a bug report or a feature request on it's own.
Basic building blocks
URLInput
As of July 17th, we use
<URLInput />
as a basic building block for all things related to URL editing:URLInput is a component that renders an input and has the following responsibilities:
showSuggestions
state flagThat’s a lot and it doesn’t fit all contexts easily (e.g. it’s challenging to use it in
BlockToolbar
)Referenced in:
LinkControl
The most widely used UI for editing links:
It acts as a wrapper on top of
URLInput
which:Referenced in:
URL Editing UIs
URLInput and LinkControl are powering every other link editing UI. Let’s see how they’re used:
<MediaReplaceFlow />
It makes it possible to replace one media file with another without removing the media block.
<LinkControl />
powers the „Current media URL” part of the popover below:Suggestions are not displayed, but it seems like they’re still requested as the following progress indicator suggests:
I don’t think the entire machinery of
<LinkControl />
needs to be used here - this is essentially a regular input field and we could replace it with one.Referenced in:
<PageSwitcher/>
Full site editing provides a page switcher widget that has a free typing lookup feature:
Referenced in:
What's needed here is the input and the suggestions list. We don't need link preview, settings (opens in new tab), or a way to create a new post inline (?). It could also use some cleaning up (e.g. getting rid of the „post” badge or the
localhost:8889
part of the URL).<InlineLinkUI />
Referenced in:
Note that this will be replaced by in-toolbar link editing explored in issue #23375.
<URLInputButton/>
It’s not used anywhere, I’d say let’s try removing it entirely.
<LinkEditor />
/<URLPopover />
Referenced in:
LinkEditor is used in a few different contexts. When used in media placeholder or social link, it’s just a regular input field that doesn’t need to fetch any suggestions:
I recommend replacing the URLInput in the above components with a regular input field or a component from @wordpress/components.
Then there is a the following color picker which, surprisingly, uses a URLPopover internally:
It doesn’t have anything to do with URLs though, and we even have a different color picker component that uses a regular Popover:
I recommend replacing the URLPopover in the above components with a regular Popover component.
Lastly, the image block uses a customized version of URLPopover to support Media File and Attachment Page choices. Upon typing, it displays page suggestions using only page title and no URL:
This should be solved as a part of the in-toolbar link editing in #23375.
Summary
I believe this covers all places where URLInput or LinkControl are being used. Let's discuss proper next steps in respective issues listed at the top.
The text was updated successfully, but these errors were encountered: