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: Surface contextual suggestions #50884

Closed
3 tasks done
richtabor opened this issue May 23, 2023 · 15 comments
Closed
3 tasks done

LinkControl: Surface contextual suggestions #50884

richtabor opened this issue May 23, 2023 · 15 comments
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

richtabor commented May 23, 2023

Part of #50891

Anytime you apply a link initial suggestions isInitialSuggestions should be available. Navigation Link block variations already do this; the behavior should be the default across any LinkControl implementation.

Default suggestions: Pages are the default suggestions, though if a suggestionsQuery is passed, those defined types use the suggested types instead—i.e. Category Link block uses categories as the default suggestions.

Search suggestions (results): Searching returns all content types, unless there is a suggestionsQuery passed. In that case, suggestions should be based on the suggestionsQuery type—i.e. Category Link block results are all categories.

Tasks

Visual

Before After
CleanShot 2023-08-14 at 21 15 13 CleanShot 2023-08-14 at 21 16 41
@richtabor richtabor added [Package] Components /packages/components [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels May 23, 2023
@richtabor richtabor mentioned this issue May 23, 2023
13 tasks
@getdave
Copy link
Contributor

getdave commented May 25, 2023

Remove the "Recently updated" search results label.

To confirm do you expect that visual users will have sufficient context to know that these are "recent". I think that's a fair assumption. However, for non-visual users we might like to retain this cue in a visually hidden way in order that they can better perceive the interface. Would you agree?

@richtabor
Copy link
Member Author

However, for non-visual users we might like to retain this cue in a visually hidden way in order that they can better perceive the interface.

Yea, this should do here: #50977

@getdave
Copy link
Contributor

getdave commented Aug 31, 2023

Questions

  • should suggestions always be showing on link creation or on editing as well?
  • should we apply this conditionally only to rich text links. This would avoid backwards compatibility issues with the UI/UX for consumers of the <LinkControl>. We have a prop showInitialSuggestions which governs this already.

@richtabor
Copy link
Member Author

Only on link creation I think. When you’re editing a link, you should see matched results (already there today).

@bph bph moved this from Needs Dev / Todo to Punted to 6.5 in WordPress 6.4 Editor Tasks Sep 18, 2023
@richtabor
Copy link
Member Author

@draganescu what do you think about rolling out the suggestions work to the general link editing?

Ideally, anytime you add a link you should have suggestions. This below would have suggestions:

CleanShot 2023-10-04 at 11 38 57

Related to #54622 (comment).

@draganescu
Copy link
Contributor

I thought about it as well. The problem is what to suggest? Pages? When linking random bits of text are the usual links more to external contents? Would suggestions that add clutter?

@richtabor
Copy link
Member Author

richtabor commented Oct 4, 2023

I thought about it as well. The problem is what to suggest? Pages?

Yes. What about pages for page post types, and posts for post post types perhaps?

When linking random bits of text are the usual links more to external contents? Would suggestions that add clutter?

I don't think they'll clutter. There's room as-is to fill in without adding much cognitive load.

@mikeicode
Copy link

Suggestion:

When adding pages to a navigation block using Page Link, a few page suggestions pop up. However, these options don't update once I add the page to the menu. Ideally, once I add the "services" page to the menu, it wouldn't suggest adding that page again.

Screen Shot on 2023-11-27 at 15_36_28

In this example, there is an "about" page on the site that I need to add to the menu; ideally, that would be one of the suggestions.

@richtabor
Copy link
Member Author

However, these options don't update once I add the page to the menu.

Makes sense to me, thanks for sharing this.

@draganescu
Copy link
Contributor

I think we should update the PR description and mockups to include this tiny spec of removing what is already added. It could be easily achieved with an exclude list coming from a flattening of the navigation tree.

@getdave
Copy link
Contributor

getdave commented Jan 5, 2024

@richtabor @draganescu I'm a bit lost as to the status of this one. I know Andrei did some work here but do we still want to do the tasks in the Issue description?

@getdave
Copy link
Contributor

getdave commented Jan 10, 2024

Search suggestions (i.e. results) return all content, unless there are types from suggestionsQuery

I think we do this already right? If so we can ✅ the relevant box in the description.

@draganescu
Copy link
Contributor

This doesn't currently work

Screenshot 2024-01-12 at 15 37 12

The idea is that we show suggestions (defaulting to pages) as soon as the input for link appears.

@getdave
Copy link
Contributor

getdave commented Jan 12, 2024

Will be partially solved by #57743.

@richtabor
Copy link
Member Author

Will be partially solved by #57743.

Let's close this now. Good work team.

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) [Package] Block editor /packages/block-editor [Type] Enhancement A suggestion for improvement.
Projects
No open projects
Status: Done
Status: Done
Development

No branches or pull requests

6 participants