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

Link handling tweaks #230

Merged
merged 4 commits into from
Nov 22, 2024
Merged

Conversation

bjhess
Copy link
Contributor

@bjhess bjhess commented Nov 22, 2024

Here are a few tweaks for your perusal. Feel free to bring in what you think is appropriate in whatever way you feel is appropriate!


4a95e51
Focus the editor when link dialog is closed.
This is especially useful when the ESC key is hit. Without this, the link dialog disappears, you expect to be able to continue editing, but the editor does not have focus. Now it does!


fc4e989
Update addLink behavior to handle editing link without a full selection.
When your cursor is within a node of linked text and the link dialog is opened, the intention is almost always to edit the link for the full node rather than insert a new link in place of the text for which the cursor is sitting.

Here's how this interaction worked before:

https://share.cleanshot.com/1NYHrBxP

With this change, editing a link when the cursor is within a linked node will edit the link for the entire linked text rather than replacing or inserting the new link in place of or in the midst of the linked node text.

Here is the change in action:

https://share.cleanshot.com/gLjDmjwN


f7ad92b
Show invalid URL message when link validity is broken.
Prior to this the text field would turn red, but the "Not a valid URL" message did not appear to the user.

This is especially useful when the ESC key is hit. Without this, the
link dialog disappears, you expect to be able to continue editing, but
the editor does not have focus. Now it does!
When your cursor is within a node of linked text and the link dialog is
opened, the intention is almost always to edit the link for the full
node rather than insert a new link in place of the text for which the
cursor is sitting.

Here's how this interaction worked before:

https://share.cleanshot.com/1NYHrBxP

With this change, editing a link when the cursor is within a linked
node will edit the link for the entire linked text rather than replacing
or inserting the new link in place of or in the midst of the linked
node text.

Here is the change in action:

https://share.cleanshot.com/gLjDmjwN
Prior to this the text field would turn red, but the "Not a valid URL"
message did not appear to the user.
Copy link

changeset-bot bot commented Nov 22, 2024

🦋 Changeset detected

Latest commit: de3fec3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
rhino-editor Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Nov 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
rhino-editor ❌ Failed (Inspect) Nov 22, 2024 9:48pm

@KonnorRogers KonnorRogers merged commit 588abba into KonnorRogers:main Nov 22, 2024
0 of 3 checks passed
@github-actions github-actions bot mentioned this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants