This issue has been created
There are 5 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-321bcb48-0147-4f6b-9b99-c1dc11c9d189 XWIKI-25803 Open

Pre-fill the link target with the selected text or the typed query in the BlockNote link modal

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-f0cf1414-f530-45ab-b317-9dbad17a77e0 Marius Dumitru Florea created this issue on 19/Nov/26 13:54
 
Summary: Pre-fill the link target with the selected text or the typed query in the BlockNote link modal
Issue Type: cid:jira-generated-image-avatar-321bcb48-0147-4f6b-9b99-c1dc11c9d189 Improvement
Affects Versions: 18.7.0-rc-1
Assignee: Unassigned
Components: BlockNote
Created: 19/Nov/26 13:54
Priority: cid:jira-generated-image-static-major-57668fe2-8e71-4523-b30d-90790d8d5c24 Major
Reporter: Marius Dumitru Florea
Description:

When creating a link from a text selection in the BlockNote editor, the link modal pre-fills the display text with the selected text, but leaves the link target empty. The same happens when choosing Link to... in the link suggestion menu (slash menu Link item or [[ trigger) after typing a query: the link modal opens with an empty target and the query is lost.

So the user has to type the target again, even though the text they selected or typed is very often what they want to link to:

  • Getting suggestions: the user sees "Sandbox" in the text, selects it and opens the link modal to link to the Sandbox page. They have to type "Sandbox" again in the target field to get page suggestions.
  • Linking to a new page: the user selects "Task Force" to create a link to a new (missing) page with that name. They have to type the page name again in the target field.
  • Same with the link suggestion menu: the user types "link" in the slash menu, then "Procedure" to get suggestions. None of the suggested pages fits, so they choose Link to... to create a link to a new page "Procedure", but have to type "Procedure" again.

Proposal

Pre-fill the link target with the selected text (when creating a link from a selection) or with the typed query (when choosing Link to... in the link suggestion menu):

  • The target is the page named after the text, relative to the edited page. Since the page search box is focused when the link modal opens, the pages matching the text are suggested right away, and the user can close the suggestions and submit to link to a page named after the text, whether it exists or not.
  • When the text is a URL (e.g. https://xwiki.org or john@example.orgmail_small.gif), the target is that URL.
  • When the text is empty or spans several lines (e.g. a selection of several blocks), the target is left empty, as before.
  • When choosing Link to..., the display text is still left empty, so that the link label is generated from its target.
 
 

5 updates

 
cid:jira-generated-image-avatar-f0cf1414-f530-45ab-b317-9dbad17a77e0 Changes by Marius Dumitru Florea on 19/Nov/26 13:54
 
Fix Version: 18.10.0-rc-1
Difficulty: Unknown Easy
Assignee: Marius Dumitru Florea
Priority: Major Minor
Tests: Unit,Integration