Documentation Index
Fetch the complete documentation index at: https://superdoc-caio-pizzol-sd-3084-align-tracked-change-ids.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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).
Which id do I use?
For nearly every workflow,item.id is the answer.
| Question | Answer |
|---|---|
What do I pass to decide() or get()? | item.id |
What matches onCommentsUpdate? | payload.changeId / payload.comment.commentId, same value as item.id |
| Can I cache it during async work (LLM, dialog, etc.)? | Yes, while the document is loaded |
| Need to map back to the source DOCX revision? | item.wordRevisionIds |
Should I parse handle.ref? | No - treat it as opaque |
item.id is SuperDoc’s tracked-change id for the loaded document. It’s stable across edits, matches the id emitted by events, and is the value decide() and get() accept. Use it as your normal handle for everything UI- or API-related.
Source correlation (advanced)
wordRevisionIds is provenance, not another id. It carries the original Word w:id values from the imported DOCX, keyed by insert / delete / format. Only reach for it when you need to correlate a SuperDoc change with the source file or an external review system. It is not present for tracked changes created in the current session.
Story scope
When listing across stories (list({ in: 'all' })), the same id can appear in body and a footnote. Pair the id with address.story and pass { id, story } to decide:
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. |
TrackChangesItem is { id, change }. The change shape mirrors editor.doc.trackChanges.list(): type, author, authorEmail, excerpt, address, etc.
Theming
Insertion and deletion highlights are themable via--sd-tracked-changes-* CSS variables (--sd-tracked-changes-insert-background, --sd-tracked-changes-delete-border, etc.). 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.

