-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 feature UI/UX design #4712
Comments
In general, the process of linking comes down to the following diagram which depicts the transition from unlinked to linked state: Still, there are many different ways to implement the UI/UX of the ? step and there are multiple factors to consider, like accessibility, number of clicks to use the feature, space consumption, etc.. The result of this research will quite likely set the course of the entire UI and user interaction in v5. I see several different approaches to the problem but none of them is clearly superior to the others: Balloon pinned to the selectionBalloon would disappear when the selection changes. Pros:
Cons:
A panel pinned to the toolbar buttonPanel could disappear when the selection changes (?). (also my favorite) Pros:
Cons:
Toolbar tabThe tab becomes accessible when the link can be inserted or the link is already selected in editable. When clicked, the tab switches the toolbar to "link mode" revealing link–related inputs and stuff. Pros:
Cons:
DialogPros:
Cons:
Which strategy feels the best? Which is the easiest to implement, extend and maintain? |
Great research, as always. I just wanted to say that I am fine with spending more time on researching tooltips solutions. This is something that we have not tried yet and we will never know whether we like it or not, unless we do them. Since they could be used for different features too, it's nice to get some feel of them. So, even if we scratch them and remove the tooltip solution, I don't think that trying them will be a wasted time. As far as which solution is better, both have their problems, but I think that you overestimated them. The first one is only problematic when you scroll the selected content out of sight. I am not sure what should happen, if balloon should be scrolled-out too, or maybe it should just disappear? Other than that this is the solution Google Docs is using and I would check it closely if you are afraid about UX. Positioning can be solved, if you don't like moving tooltip, let's pin the tooltip at the beginning of the link, or move it to the side. My question is how exactly do you insert link? You select some text, click link icon and then empty tooltip appears? What about collapsed selection? I like the second solution less because it covers content. Other than that it is fine, too. Dialogs sucks because they disconnect the user from the experience too heavily. I think we should use them only when everything else failed. And I don't think we should propose multi-tabs as the primary UX solution. |
👍
Remember that GD is a closed, controlled environment. Google can implement there whatever they want, using whatever technology and hacks. CKE 5 is a component living a rough, unpredictable env called "random web page" and must work no matter how complex and hacky the surroundings might be.
It's all the same. Collapsed selection or not, one must click toolbar button to insert link, activating the UI. Do you have other ideas how to optimise it? (not talking about autolinking)
👍
👍 |
Having implemented a floating balloon solution before, I can tell you that it is indeed not trivial to implement (although not a lot of code either, but I didn't need to solve the scrolling issue), and especially if you want to retain the selection, you'll have to either use an iFrame (this is what Google does) or temporarily wrap the selection in an HTML tag (this is what Trix does). That being said, I like it because of its minimalistic appeal. |
Yeah, retaining the selection is always fun :) Fortunately, we've got a lot of experience from CKEditor 4. There's been a mechanism for saving selection before blur. It's been used e.g. when dialogs were opened or by a11y features (such as keyboard navigation through the toolbar). In CKEditor 5 we represent the selection in the model (on the AST), so once the editable is blurred, the selection simply stays in the model on its previous position. Later, you just have to focus the editable and the renderer will take the selection from the model and render it in the DOM. It means that most of the time you won't need to think about it. |
I'm for the balloon as well. It's the most "in-place" solution and, unlike a panel pinned to the toolbar, it will work when there's no toolbar (textarea/input-like editing – e.g. FB or Twitter). I wouldn't worry about bloatiness of such a solution if you add more stuff into the tooltip, because IMO you simply shouldn't. If you need more fields (like "more" or "advanced options"), just add a button opening additional modal dialog. The tooltip should stay simple, useful for 99% cases when you only want to set one or two things. As for unlinking – beside "Save" there should also be "Unlink" button in that tooltip. Now, that's about the UI. What, IMO, matters the most is the UX, in case of which the actual way how the URL input is displayed plays a secondary role. Things that matter are specific use cases. E.g.:
Etc, etc. Regardless of our approach to the dialog/balloon, we must solve the above issues, because they make for 90% of the UX. Linking should be fast and smooth using mouse or keyboard. |
I think that the complicated part of it is keeping it visible while the balloon has focus. |
Oh, that... I remember that we've had a plugin for that in CKE4, but I recall that we didn't like it and decided to not use it. In CKE5 its implementation will be very simple and its behavior won't affect anything, so we could bring back this feature. |
The design should follow Editor Recommendations.
A followup of ckeditor/ckeditor5-design#97.
The text was updated successfully, but these errors were encountered: