Basic usage

Paid add-on

Learn the essential workflows for using the Tracked Changes extension — enabling suggestion mode, managing users, and reviewing suggestions.

Enabling and disabling tracked changes

Toggle track changes mode on and off:

// Enable track changes
editor.commands.enableTrackedChanges()

// Disable track changes
editor.commands.disableTrackedChanges()

// Toggle track changes
editor.commands.toggleTrackedChanges()

Setting the current user

Change the user for new suggestions:

editor.commands.setTrackedChangesUser({
  userId: 'user-456',
  userMetadata: { name: 'Jane Smith' },
})

Accepting and rejecting suggestions

Accept or reject suggestions individually:

// Accept suggestion at current selection
editor.commands.acceptSuggestion()

// Reject suggestion at current selection
editor.commands.rejectSuggestion()

// Accept specific suggestion by ID
editor.commands.acceptSuggestion({ id: 'suggestion-123' })

// Reject specific suggestion by ID
editor.commands.rejectSuggestion({ id: 'suggestion-123' })

Formatting changes are reviewed through the same suggestion workflow. A tracked bold, italic, link, or other mark change appears as a markChange suggestion and can be accepted or rejected just like an insertion, deletion, or replacement.

If you need to create formatting suggestions from application logic, use the programmatic mark commands described in the commands reference: addTrackedMark, removeTrackedMark, and toggleTrackedMark.

Batch operations

Accept or reject all suggestions at once:

// Accept all suggestions
editor.commands.acceptAllSuggestions()

// Reject all suggestions
editor.commands.rejectAllSuggestions()

Accept or reject suggestions within a specific document range:

// Accept suggestions in a range
editor.commands.acceptSuggestionsInRange({ from: 10, to: 50 })

// Reject suggestions in a range
editor.commands.rejectSuggestionsInRange({ from: 10, to: 50 })

Accept or reject all suggestions by a specific user:

// Accept all suggestions from a user
editor.commands.acceptSuggestionsByUser({ userId: 'user-123' })

// Reject all suggestions from a user
editor.commands.rejectSuggestionsByUser({ userId: 'user-123' })