visual-space / visual-editor

Rich text editor for Flutter based on Delta format (Quill fork)
MIT License
290 stars 46 forks source link

Markers - New markers can override existing markers #142

Closed adrian-moisa closed 9 months ago

adrian-moisa commented 2 years ago

If the text selection perfectly matches a marker then the dropdown works fine. However if the selection does not overall the marker then no layers are displayed. This is probably happening because the rules for the other styles are different. If you select text that is partly bold partly regular, then the bold button is not highlighted. Meaning that when you click it you have the option to add bold. I believe this behaviour is rather logical and should not change.

https://user-images.githubusercontent.com/11160141/193290910-18858923-b87c-4229-be1e-680f9427903c.mov

New Markers override existing markers Related to the same behaviour. If we select text that contains a marker inside then when we attempt to add a new marker, the old one or old ones get discarded and the new marker is added. This behaviour is unacceptable for VS. We can't simply lose metadata because the editor overrode the markers and therefore we lost the internal UUID that linked the markers to the metadata objects.

As you can see in this demo, we are not supposed to lose old markers.

https://user-images.githubusercontent.com/11160141/193288374-ed1f8ce8-26c0-4585-8435-b8f9cd43e8e1.mov

Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.