Skip to content
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

Markers behavior improvements #4448

Closed
scofalik opened this issue Dec 5, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1606
Closed

Markers behavior improvements #4448

scofalik opened this issue Dec 5, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1606
Assignees
Milestone

Comments

@scofalik
Copy link
Contributor

scofalik commented Dec 5, 2018

It is a high time we bring some improvements to how markers are converter and how they work in undo. These are needed for better user experience in collaboration features.

These are:

  1. Add an additional event fired by DowncastDispatcher when a non-collapsed marker is converted. Until now, for non-collapsed markers, DowncastDispatcher fired one event for each node in the marker's range. This was very inconvenient if one wanted to handle the whole marker "together" / "at once". Now, before events for nodes are fired, there will be one event fired for the whole marker. The events can be recognized by checking data object. The "global" event does not have data.item property. If the "global" event is consumed, then the events for nodes will not be fired.

  2. Better handling of markers during undo:

    • Whenever move, remove or merge action on model.Writer would affect a marker, a MarkerOperation is generated. It does not change the marker but acts as a "stamp". This "stamp operation" is used then in undo. It is in the undo step so it is transformed and thanks to this mechanism a marker can be correctly recreated during undo.

    • MarkerOperation transformations will use context now to make it possible to recreate them correctly during undo.

Creating a new marker operation each time marker is affected may have an impact on the undo efficiency and amount of data sent. However, at the moment, this is the least intrusive and the simplest way to deal with markers handling during undo.

@scofalik scofalik self-assigned this Dec 5, 2018
pjasiun referenced this issue in ckeditor/ckeditor5-engine Dec 21, 2018
Feature: Added an additional event in markers conversion. Improved how MarkerOperation is transformed during undo. Closes #1604.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 22 milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants