Start trial
PricingContact Us
Log InStart For Free

Resolving comments

July 6th, 2023

3 min read

Two faces in an animated style converse with comments

Written by

Qiran Gabrielle-Grace

Category

World of WYSIWYG

Don’t you just love it when people respond? You feel that you’re being acknowledged and it makes you feel involved. Having conversations online encourages those same feelings of involvement, and can include experiences you have face-to-face – including agreement, disagreement, and the need to resolve issues.. That’s why TinyMCE lets you ‘resolve’ items in the Comments plugin, with the resolve comments options. 

So what’s so special about that? I’m glad you asked. This post clarifies the exact difference between resolving vs deleting comments, configurations, and retrieving resolved comments. You might also ask, when exactly should you resolve (or delete) an item? There’s no right or wrong answer but there's definitely a ‘safe’ option, and that’s to resolve comments.

Difference between deleting and resolving comments

Resolving comments vs deleting comments is a bit like spring cleaning. Some items you want to store away to use again later, but then others are ready to be tossed out. When you’re resolving a comment, it’s tucked out of sight, but still available for other users to access at their leisure. 

When the TinyMCE Comments plugin is configured in callback mode and connects to an external server, the resolved comments can be looked up if they’re needed again.

On the other hand, deleting a comment means throwing away the conversation. Now that’s not a good or bad thing – it just means you can’t retrieve the information. It does though declutter discussion threads and the database comments and reply tables (depending on how your database schema is set up), which are all good things.  

Marking a comment as a ‘resolved comment’ grants the ability to stay on top of tasks in a multi-user environment. It also adds an additional layer of intuitiveness and informational transparency that's often seen in high-performing collaborative editing platforms such as Google Docs and MS Word.

How to delete comments

Here’s one example of the Comments plugin in TinyMCE with some demo content in the text area. To delete the comment, click on the options icon next and select Delete:

The delete comments button working.

The option to resolve comments is available next to the Delete button when the tinycomments_resolve option is enabled.

How to resolve comments

There are two options available that you can configure to resolve comments. The following demo is configured to resolve conversations, effectively resolving all comments at once. To do this, click on the options icon, and select the Resolve Conversation button:

The resolve comments option working in the browser

How to configure resolving comments

The two options available for configuring the ability to resolve comments are tinycomments_resolve and tinycomments_can_resolve. As demonstrated in the previous section, the tinymce_can_resolve option unlocks the ability to resolve all comments at once.  Configure the tinycomments_resolve option to enable the ability to resolve one specific comment at a time. The following is a basic example of the tinymce_can_resolve configuration in embed mode:

   <script>

      const currentAuthor = 'Dorothy Gale';

      tinymce.init({
          selector: '#editor',
          plugins: 'tinycomments',
          tinycomments_mode: 'embedded',
          tinycomments_author: currentAuthor,
          tinycomments_can_resolve: (req, done, fail) => {
            const allowed = req.comments.length > 0 &&
                req.comments[0].author === currentAuthor;
            done({
              canResolve: allowed || currentAuthor === '<administration>'
            });
          }
        });
     </script>

How to view resolved comments

Using the getEventLog() API method, it’s possible to retrieve a list of comments that have been resolved. It can either return the log in full, or all events after a time-stamp. You could run the following commands to log the resolved comments to the console:

const comments = tinymce.activeEditor.plugins.tinycomments;

console.log(comments.getEventLog());

How to bring back a resolved comment

Resolving a comment means that the conversation still exists, and the tinycomments_lookup option is available to help retrieve comments. It’s a function that can get a conversation back by looking it up in the app database using the conversation id and the comment author’s display name. Configure the tinycomments_lookup callback to return something like this JSON object to the caller to bring back any resolved comments:

{
 conversation: {
   uid: string,
   comments: [
    {
      author: string, 
      createdAt: date,
      content: string,
      modifiedAt: date, 
      uid: string
    },
    {
      author: string,
      createdAt: date,
      content: string,
      modifiedAt: date,
      uid: string
    }
  ]
 }
}

NOTE: the unique ids may be stored as integers in the database, but they need to be returned as strings. Make sure that your server-side script converts these items into strings (For example, CAST AS in an SQL database query).

Get TinyMCE’s Comments

The Comments plugin is one of TinyMCE’s Premium plugins, and is included in the TinyMCE Professional Plan. If you’re curious about exploring Comments, or wondering how you can elevate collaboration on your platform, have a chat with our Tiny Experts today!

CollaborationConfiguration
byQiran Gabrielle-Grace

Helping get the word out about all the great things Tiny has to offer. Loving the WFH life because he can play loud music and dance, while still calling it work.

Related Articles

  • World of WYSIWYGOct 23rd, 2024

    Upgrades to Enhanced Comments, Read-Only Templates - TinyMCE 7.4

Join 100,000+ developers who get regular tips & updates from the Tiny team.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Tiny logo

Stay Connected

SOC2 compliance badge

Products

TinyMCEDriveMoxieManager
© Copyright 2024 Tiny Technologies Inc.

TinyMCE® and Tiny® are registered trademarks of Tiny Technologies, Inc.