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

Intercept text removal to "keep" comments, attached to it #16392

Closed
nikitin- opened this issue May 20, 2024 · 6 comments
Closed

Intercept text removal to "keep" comments, attached to it #16392

nikitin- opened this issue May 20, 2024 · 6 comments
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:comments resolution:resolved This issue was already resolved (e.g. by another ticket). type:question This issue asks a question (how to...).

Comments

@nikitin-
Copy link

Hello!
I'm looking for the feature in ckeditor to keep track of "deleted comments"

  1. Create a text and add comment over it
  2. Delete the text - this will also delete the comment (comment thread), attached to it.

I need to somehow intercept the text removal to "keep" comments, attached to it.

Screencast.from.20.05.2024.16.16.04.WEBM

Thank you in advance!

@nikitin- nikitin- added the type:question This issue asks a question (how to...). label May 20, 2024
@nikitin-
Copy link
Author

Now I'm playing around with registerPostFixer and getMarkersToRemove but not sure that this is a good way. ...

document.registerPostFixer( writer =>  {
    const changes = document.differ.getChanges();
    const del_markers = document.differ.getMarkersToRemove()
    if (del_markers) {
        debugger;
    }
});

@Witoso
Copy link
Member

Witoso commented May 20, 2024

Hi! As per docs:

When you remove the document content related to a comment thread from the document, the comment thread becomes unlinked. It is then moved to the comments archive. Since it has not been technically resolved, it does not display the usual related information.

Comments archive.

You can access those comments via archivedThreads. Hope this helps!

@Witoso Witoso added pending:feedback This issue is blocked by necessary feedback. domain:dx This issue reports a developer experience problem or possible improvement. package:comments labels May 20, 2024
@nikitin-
Copy link
Author

@Witoso - Thank you for the answer!
Is CommentsArchive (@ckeditor/ckeditor5-comments/src/comments/commentsarchive) a separate plugin or it comes bundled to ckeditor5 "core" ?

As for now I have ckeditor5 version 35.4.0-1 (in some entreprise software :) ) - so I can not "upgrade" it.

@Witoso
Copy link
Member

Witoso commented May 21, 2024

CommentsArchive appeared in v37.0.0, with changes in the deleted content in v40.0.0. I strongly suggest upgrading; otherwise you would need to duplicate the feature that is provided out of the box :)

@nikitin-
Copy link
Author

@Witoso
ok - in case when I can not upgrade to these versions ... Is it a good start point to grab the deleted comments like this ? #16392 (comment)

@CKEditorBot CKEditorBot removed the pending:feedback This issue is blocked by necessary feedback. label May 22, 2024
@nikitin-
Copy link
Author

Ok I have tested the update for ckeditor v.40 .
This update "broke" current application due to "incompatibility/dependency/whatever" problems.
So I will stick with this approach #16392 (comment)

Thank you for answerring my questions!

@Witoso Witoso added the resolution:resolved This issue was already resolved (e.g. by another ticket). label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. package:comments resolution:resolved This issue was already resolved (e.g. by another ticket). type:question This issue asks a question (how to...).
Projects
None yet
Development

No branches or pull requests

3 participants