-
-
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
Rethink the contextual balloon API #5439
Comments
Our current idea for the API is that features should not listen to any editor events directly because we're not able then to handle input from those features inside the ctx balloon. E.g. we'd not able to synchronise the Link feature (which listens to Additionally, there are so many ways in which the user can interact with the editor that it's just hard to understand them. And then, some of the events we have (like In other words – it seems that the ctx balloon needs to unload features from all their current duties and it will then also be possible to implement more features. |
Related feature: https://github.com/ckeditor/ckeditor5-link/issues/152. |
cc @cedricium |
I guess |
In a F2F we agreed that:
So this is what we have ATM: And this is (more or less) what we could implement: |
There is one more case to consider: what if 2 plugins add panels to the same element and both should be shown? An example might be spellchecking on the link. We can not make one cover the other and I do not see any option that one panel knows about the other. |
Recent case when one should be shown: https://github.com/ckeditor/ckeditor5-widget/issues/60. |
Working on comments and balloon rotator we realized that there are far more problems with the balloon system then we though. I am sure that @oskarwrobel we be able to write more about it, but I can name a few. We should reconsider scenarios for balloonThere are more cases then we thought at the beginning. There are cases when one toolbar should hide when the other appears - like inline toolbar -> link toolbar. There are cases when two toolbars should be displayed together: for instance link toolbar and comments toolbar, it is hard to decide which one is more important. There is no navigation between these two plugins. They know nothing about each other. Right now we use rotator for such cases. There are also mixed cases: for instance, image toolbar which lets you create a new comment thread attached to the image and inline comments which are also displayed in the balloon. Such a case is tricky because, on the one hand, there is a "comments" icon in the toolbar, it is possible to create a new comment thread and switch, from the image toolbar to the comments thread panel. But on the other, one image might have multiple comment threads, so a rotator is needed anyway. Synchronise balloons life cyclesOne of the problems, we met, working on the balloon system, was the fact that right now, each plugin defines its own rules when its balloon should appear or hide. They are not only attached to different events but also do not handle the same user actions in the same way. For instance, some balloons appear only on click in the text (like link), some also on keyboard actions (like inline toolbar), some debounce keyboard actions, some do not. This is something what should be unified to avoid randomly jumping balloons. Synchronise balloon positioningFor some balloons, the default position is below the element (like for the balloon toolbar, when text is selected from left to right), for some, the default position is above the element (like for widget toolbar). This is a problem for comments balloon which can be attached to both text or widget and can be navigated from the regular toolbar. There should be some mechanism that helps us to keep the position of the toolbar. But I am not sure if we will be able to unify it. Balloons outside the editable areaImplementing narrow sidebar we met a problem with integrating a toolbar that is attached to the element which is not a part of the editable area. I hope @oskarwrobel will be able to tell better about issues we had, but I remember that it was tricky how to make you one balloon visible and how to handle focus properly. |
Related case #6443. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
There's so much wrong with this API now that I won't be able to describe all this here, so here goes a photo of my notes which kinda covers it all.
tl;dr is that when working on the highlight feature we realised that there are cases when two features may want to display their balloons at the same time. Right now we can't handle this reliably (display some merge of them) because we have a simple stack of balloons.
The problem comes from the fact that when we designed this API a year ago we still knew very little about all the requirements and use cases. Now, we see things like these conflicting features, real-time collaboration scenarios in which you need to carefully reposition the panel, many user actions that we need to handle (touch!), complexity of interaction (series of balloons – image toolbar => link info => link edit and back...), etc.
(click the image – it's not horizontal, really)
The text was updated successfully, but these errors were encountered: