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

LinkControl: Add support for linking headings #53147

Open
richtabor opened this issue Jul 29, 2023 · 3 comments
Open

LinkControl: Add support for linking headings #53147

richtabor opened this issue Jul 29, 2023 · 3 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

When applying an inline link, it'd be nice to be able to link to headings that exist within the post content.

The idea here is that all available headings would be available to select. When you select one, an anchor tag is automatically applied to the corresponding heading, as the anchor link is applied to the selected text.

This UX leverages the existing pattern of having additional tools within the footer of the link popover, as discussed in #50891. The pattern is also explored in this proposal (#50888) for adding blocks within the navigation link block. We should build this out pattern in a way where it could be shared across both.

Visual

inline-link-control-headings

cc: @getdave, as you've worked extensively on LinkControl. 🤜🤛

@richtabor richtabor added [Type] Enhancement A suggestion for improvement. [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Jul 29, 2023
@richtabor richtabor changed the title LinkControl: Add support to for linking headings LinkControl: Add support for linking headings Jul 29, 2023
@richtabor
Copy link
Member Author

Noting that this should only be available when linking inline — and if there are headings available.

@richtabor richtabor mentioned this issue Jul 29, 2023
13 tasks
@getdave
Copy link
Contributor

getdave commented Aug 8, 2023

Noting that if we want to achieve this we need to create the "back" functionality between Popovers. It would need to be configureable. This is not something we currently support.

The alternative would be to add this component as part of LinkControl, but we should first consider whether we can instead use some kind of extension point to avoid bloating that component.

@richtabor
Copy link
Member Author

richtabor commented Aug 9, 2023

Noting that if we want to achieve this we need to create the "back" functionality between Popovers.

Perhaps? It's essentially a state of the popover contents. Add heading link could change the state, back could always revert to the initial. Seems it may be a heavy lift to get it in popover though, if there's no other use cases outside of LinkControl (at least currently).

There're two related to LinkControl, this and #50888.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[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

2 participants