Make Nav Link Block text also editable from within the hyperlinklink creation UI #19413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental.
In the current Navigation Block, it could be argued that there is something of a disconnect between adding link text and creating the hyperlink destination of the link. when creating a Nav Link.
To add a hyperlink you interact with a
LinkControl
popover. This affords the ability to add a URL by direct entry or searching for an existing Post. However it does not enable editing of the link text itself.To edit link text you need to switch away from the
LInKControl
popover and edit within the Block richtext directly. Whilst it is obviously desirable to retain the direct manipulation pattern established on blocks, it can feel a little clunky (and somewhat confusing) to have to switch between hyperlink UI and the block itself in order to create a link.This PR is an experiment to see whether introducing the ability to edit the Nav Item text from within the hyperlink UI as well as the block richtext would improve the usability.
This follows established UI patterns such as that found in Google Docs (see screenshot below) which enables manipulation of the link text within the hyperlink UI:
I'm expecting that this will be rejected on the grounds of breaking the direct manipulation paradigm, but I felt it was worth exploring so we can at least rule it out and have documented evidence of this process having occurred.
Please note there is a currently a major bug in this implementation whereby editing the text within the hyperlink UI will cause focus to immediately jump back to the block richtext. This is likely due to a "bug" in
RichText
which would need to be fixed in order for this to work (cc @ellatrix ). Therefore please suspend disbelief when testing this PR or just take the screenshot at face value.How has this been tested?
Manual for now.
Screenshots
Types of changes
New feature (non-breaking change which adds functionality).
Checklist: