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

Smart Linking: Implement "Apply to selection" mode #2691

Open
acicovic opened this issue Aug 9, 2024 · 4 comments
Open

Smart Linking: Implement "Apply to selection" mode #2691

acicovic opened this issue Aug 9, 2024 · 4 comments

Comments

@acicovic
Copy link
Collaborator

acicovic commented Aug 9, 2024

Is your feature request related to a problem?

Currently, our Smart Linking feature checks the selected block or whole post and determines the location where links should be inserted. This is fine, but to quote @jbao:

PCH users have often complained about the lack of flexibility in selecting the anchor word length, sometimes they already have some specific word/phrase in mind that they want to add link to, or they’re not happy with the link suggestion results and want to extend/shrink the suggested anchor words. In all these cases, we can provide users with more flexibility by adding Smart Linking to the toolbar, so that they can pre-select the best anchor words of their choice, click on the smart link icon. Our API will then suggest links based on the relevance to the anchor words, and return them in a dropdown menu.

image

Describe the solution you'd like

Add a Smart Linking icon to the toolbar, which will allow Smart Linking to run for the currently selected text. We still need to determine how the whole flow/UX should be when we start working on this.

Additional context

@jbao, wanted to check with you whether we'd be ready from an API standpoint regarding this, or if API work would be needed to make this possible.

@jbao
Copy link

jbao commented Aug 9, 2024

Thanks for keeping track of this! Additional API work is indeed needed. Right now, the smart linking endpoint takes the full text as input and implements its own logic to determine the anchor words to add link to. For this feature to happen, we basically need to implement a variant of smart linking that takes a single keyword/phrase as input (we could also include the full text for more context) and suggests the best content to link to.

More specifically, when a user clicks on the smart linking icon in the toolbar, we might want to preload the suggestions based on the words highlighted by the user. If they start typing in something different in the search box, we can then update the suggestions based on the input in the search box (we might also want to define a minimum number of characters, in order to make the suggestions meaningful). That said, it could be a bit tricky to implement it as a type of auto-completion, i.e. changing suggestions as the user is typing. What's your take?

Btw, what's your anticipated timeline for this? I wonder if we should squeeze the API work into the Q3 roadmap.

@acicovic
Copy link
Collaborator Author

acicovic commented Aug 9, 2024

Thanks for the input!

No specific timeline for this yet, maybe @danielabloch can chime in on this. We'll be busy with refactorings for all August, and probably part of September if we can afford it.

More specifically, when a user clicks on the smart linking icon in the toolbar, we might want to preload the suggestions based on the words highlighted by the user.

What you describe is probably the gist of this feature.

  • The user selects the desired text and clicks the Smart Linking icon.
  • The API call is made and we get the get suggestions back.
  • We show the suggestions to the user.
  • The user applies the desired suggestion or re-requests suggestions if needed (e.g. through a reload button).

If they start typing in something different in the search box, we can then update the suggestions based on the input in the search box

I think you're referring to the link dialog here, which is a different thing (invoked when we click the link icon). If we want to add functionality there, we'd need to see if/how the component's functionality can be modified. Sounds more complicated at first glance.

@jbao
Copy link

jbao commented Aug 9, 2024

I think you're referring to the link dialog here

True. I was basically thinking about something similar to the existing link tool (with a link icon plus some stars). But you're right, if it's too complicated, we can also leave that out in the first version.

@vaurdan
Copy link
Contributor

vaurdan commented Aug 9, 2024

This sounds like a pretty good idea - and actually the first prototype I worked on was based on a icon that was added to the toolbar, so definitely doable from a technical standpoint 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants