useSuperDocTrackChanges() exposes the live tracked-change list in document order. Accept, reject, accept-all, reject-all, scroll-to, and next / previous navigation route through editor.doc.trackChanges.* underneath.
A live list of changes
items mirrors editor.doc.trackChanges.list(). Each item carries id plus the full change record (type, author, excerpt, address). If you configure modules.trackChanges.authorColors, each item also exposes authorColor, and authors contains the unique authors in document order with their resolved colors.
Per-author colors
Usemodules.trackChanges.authorColors when your review UI needs a stable legend or when imported DOCX files can contain authors your app did not know ahead of time.
Accept and reject
Navigate
next and previous walk the list in document order. They wrap. scrollTo scrolls the editor viewport to the change’s anchor and sets it as the active id.
Independent vs paired replacements
A typed-over selection in Suggest mode produces an insertion AND a deletion. Default'paired' mode collapses them into one tracked-change entity (accept once, both apply). Independent mode gives each half its own id.
Highlight the active card
The selection slice exposesactiveChangeIds. Use it to highlight the card matching the cursor.
What the snapshot looks like
| Field | Type | Meaning |
|---|---|---|
items | TrackChangesItem[] | Tracked changes in document order. |
total | number | Convenience count of items.length. |
activeId | string | null | Active change driven by selection or by next / previous / scrollTo. |
authors | TrackChangesAuthor[] | Unique tracked-change authors in document order. Present with resolved color values when modules.trackChanges.authorColors is configured. |
TrackChangesItem is { id, change, authorColor? }. The change shape mirrors editor.doc.trackChanges.list(): type, author, authorEmail, excerpt, address, etc. When author colors are configured, change.authorColor mirrors item.authorColor.
Theming
Insertion, deletion, and format-change highlights are themable via--sd-tracked-changes-* CSS variables (--sd-tracked-changes-insert-background, --sd-tracked-changes-delete-border, etc.). Per-author colors set those variables on the rendered tracked-change element. See Theming overview and Custom themes for the full token list.
Trade-offs
acceptAllandrejectAllapply across every story. To scope to body only, callaccept/rejectper id.- Tracked changes in headers, footers, and footnotes route correctly through
scrollTo. Non-body entities snap to view (story activation mounts the surface synchronously before alignment); body entities scroll smoothly. - The merged Activity feed pattern is consumer-owned. The controller stays minimal so apps that only render tracked changes don’t pay for comment merging, and apps that want an Activity panel decide their own ordering rules.

