Skip to content

FEATURE: rich editor link ui for editing it #32583

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

renato
Copy link
Contributor

@renato renato commented May 5, 2025

Displays a floating toolbar when the selection position is in a link, on desktop. On mobile, replaces the existing toolbar with the link toolbar temporarily.

Desktop

Kapture.2025-04-26.at.15.49.04.1.mp4

Mobile

image

@renato renato force-pushed the rich_editor_link_ui branch 2 times, most recently from bc77e39 to 3c033a8 Compare May 5, 2025 22:43
@renato renato force-pushed the rich_editor_link_ui branch from 3c033a8 to 7a4687d Compare May 12, 2025 17:22
@github-actions github-actions bot added the i18n PRs which update English locale files or i18n related code label May 12, 2025
@renato renato marked this pull request as ready for review May 12, 2025 22:33
@jjaffeux
Copy link
Contributor

We should remove the rounded corners here:

Screenshot 2025-05-13 at 08 09 52

@jjaffeux
Copy link
Contributor

When Im in this state:

Screenshot 2025-05-13 at 08 10 15

Pressing tab should bring me to the first item, atm I need multiple tabs.

@jjaffeux
Copy link
Contributor

Screenshot 2025-05-13 at 08 11 11

The last button has no hover state on desktop.

@jjaffeux
Copy link
Contributor

Can we avoid destroying/re-creating when my click ends up not changing the caret position?

Kapture.2025-05-13.at.08.12.22.mp4

@jjaffeux
Copy link
Contributor

@chapoi It's not due to this work, but it's very annoying that showing a modal is removing the browsers scrollbars, it makes the page all jumpy, I know there are techniques to avoid this, could designers try to give it a go please?

Kapture.2025-05-13.at.08.14.01.mp4

@jjaffeux
Copy link
Contributor

When I had focus through tab on one of the items menu and I press escape, I don't get back my caret position in the composer.

@jjaffeux
Copy link
Contributor

Im not sure we should have cursor: pointer on the link given we now treat is as text. It's debatable, given this is still an action. But my reasoning is that seeing the cursor makes me think it's going to open the link right away. What do you think @chapoi ?

@jjaffeux
Copy link
Contributor

When I edit a link by opening the modal, when I close it I don't get back my caret position in the composer.

@jjaffeux
Copy link
Contributor

We have no spacing between the back button on edit mode:

Screenshot 2025-05-13 at 08 23 18

While in normal mode we have a lot of spacing:

Screenshot 2025-05-13 at 08 23 37

Doesnt feel right @chapoi

@jjaffeux
Copy link
Contributor

What is this button, didnt get it in my tests?

Screenshot 2025-05-13 at 08 30 29

@chapoi
Copy link
Contributor

chapoi commented May 13, 2025

Im not sure we should have cursor: pointer on the link given we now treat is as text. It's debatable, given this is still an action. But my reasoning is that seeing the cursor makes me think it's going to open the link right away. What do you think @chapoi ?

Tricky one… I'd say keep the pointer, indicating something can be done feels most important. We could consider using context-menu maybe?

While in normal mode we have a lot of spacing:

Yes, I know, but that left side spacing is very hard/impossible to get right due to the use of grid. I'll see if I can tweak it a bit.

What is this button, didnt get it in my tests?

Shouldn't that be "unlink"?

@jjaffeux
Copy link
Contributor

Im not sure we should have cursor: pointer on the link given we now treat is as text. It's debatable, given this is still an action. But my reasoning is that seeing the cursor makes me think it's going to open the link right away. What do you think @chapoi ?

Tricky one… I'd say keep the pointer, indicating something can be done feels most important. We could consider using context-menu maybe?

FWIW slack is doing the regular text cursor, and some styling on hover of the link.

@jjaffeux
Copy link
Contributor

What is this button, didnt get it in my tests?

Shouldn't that be "unlink"?

Yes it should, but never got it showing

@renato
Copy link
Contributor Author

renato commented May 13, 2025

Yes it should, but never got it showing

@jjaffeux I’ll respond to the other things today, but getting this out first: Unlink is only available for non-autolinks, aren’t they working with [regular](links)?

I get it may be confusing, but I think supporting removing this autolink will still be confusing, with the caveat of being more work. Making a URL not autolink requires escaping it in the markdown, and I didn't think of a good way to make the escaped text linkable again/autolink on the rich editor - I think it's just simpler to omit the option in this case.

@jjaffeux
Copy link
Contributor

Yes it should, but never got it showing

@jjaffeux I’ll respond to the other things today, but getting this out first: Unlink is only available for non-autolinks, aren’t they working with [regular](links)?

I get it may be confusing, but I think supporting removing this autolink will still be confusing, with the caveat of being more work. Making a URL not autolink requires escaping it in the markdown, and I didn't think of a good way to make the escaped text linkable again/autolink on the rich editor - I think it's just simpler to omit the option in this case.

OK I see, we can for sure start like this and see the feedback we get 👍

@renato
Copy link
Contributor Author

renato commented May 19, 2025

Can we avoid destroying/re-creating when my click ends up not changing the caret position?

@jjaffeux I don't think we have an easy alternative in this case, what's destroying the menu is the closeOnClickOutside.

EDIT: We can skip the menu's default closeOnClickOutside, use our own, and check the caret position before deciding to close it. Doesn't seem that much work, I can test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n PRs which update English locale files or i18n related code
Development

Successfully merging this pull request may close these issues.

3 participants