Open Reinmar opened 3 months ago
The advantage of this option is that the integrator will still be able to relatively simply replace this with their own implementation of sidebars toggling. We can be pretty sure that many integrators have custom implementations anyway.
Could you name a few options on how this could differ between integrations, and where the differences could be?
Do I understand correctly, that you would like to make these "collapse document outline" and "collapse sidebar" buttons a part of the CKE5 code?
I am not sure if I necessarily agree with that, given that these UI components may be quite customized in various applications.
I like this solution more:
A more comprehensive option would be to also wrap the logic of what happens upon clicking those buttons. This would become a full sidebars implementation (together with default styles). We'd need to pay attention to what's configurable, but we could e.g. propose an opinionated solution to handling "stickiness".
But then we need to define what sidebars are, what kinds of sidebars we have, and how they behave. Still, I am not sure if this is something that we should propose.
Could you name a few options on how this could differ between integrations, and where the differences could be?
Some integrators have sidebar next to the content (the default way), why other have positioned absolutely somewhere far outside of the editor editable (and e.g. have 100% height for that). Other applications combine our sidebar with their own features and implement tabs to navigate. Then we have implementations that may use multiple editors, or even fields between them. Then, of course styling, of all of this can differ.
📝 Provide a description of the improvement
The new builder returns these snippets to implement the toggleable sidebars:
They are awfully long.
I think it's worth optimizing the length of the integration code and standardizing some of these samples, as long as we're not doing too much magic there.
So, the "least magical" option would be to register the buttons in the component factory and probably giving them some nice API to plug the necessary logic. We'd probably need to move a bit of CSS too. However, in this option, the logic of how the DOM is managed to toggle those sidebars would still be in the sample.
The advantage of this option is that the integrator will still be able to relatively simply replace this with their own implementation of sidebars toggling. We can be pretty sure that many integrators have custom implementations anyway.
A more comprehensive option would be to also wrap the logic of what happens upon clicking those buttons. This would become a full sidebars implementation (together with default styles). We'd need to pay attention to what's configurable, but we could e.g. propose an opinionated solution to handling "stickiness".
The advantage of this option is that the builder snippet would be much shorter. Integrators looking for quick drop-in solutions would be happy. But there's a big question of how many of them need custom sidebars anyway and whether they wouldn't be confused on what's happening. To prevent that, the plugin/component would need to act sort of as an "enhancer" of a plain DOM element. So, removing it would bring back a plain sidebar.
If you'd like to see this improvement implemented, add a 👍 reaction to this post.