Environment: superdoc@2.12.0 + @superdoc/react@2.7.0 (@superdoc/docx-engine@0.11.0), browser adapter, Chrome 152. Compared against superdoc@1.45.0.
What changed
On 1.x a host could attribute a programmatic tracked change to a chosen author by swapping the editor's user around the write:
editor.setOptions({ user: { name: 'Automated Reviewer', email: 'bot@example.com' } })
await doc.replace({ target, text }, { changeMode: 'tracked' })
editor.setOptions({ user: originalUser })
The created w:ins / w:del carried w:author="Automated Reviewer".
On 2.x setOptions and options.user are gone, and we could not find a replacement. What we looked at:
superdoc.user is the closest surviving field. Mutating it around the write does not reach the mark: the revision comes out attributed to the signed-in user, the one passed as user at construction.
MutationOptions accepts changeMode, dryRun and expectedRevision only.
TextReplaceInput accepts target / ref, text and in.
- No
setUser or equivalent method on the public surface.
modules.trackChanges exposes enabled, visible, mode, replacements, authorColors and semanticColors. authorColors colours an author but does not set one.
If there is a supported way to do this that we missed, pointing at it would be enough and this can be closed.
Why it matters
An application that writes tracked changes on the user's behalf cannot distinguish them from the user's own. Both come out under the same name, so opening the file in Word shows one author for two different kinds of edit, and nothing downstream (accept/reject by author, filtering, audit) can separate them.
Steps to reproduce
- Construct SuperDoc with
user: { name: 'Human Editor', email: 'human@example.com' }.
- Set
superdoc.user = { name: 'Automated Reviewer', email: 'bot@example.com' }.
await doc.replace({ target, text }, { changeMode: 'tracked' }) over any text range.
- Read the created revisions back with
doc.trackChanges.list(...), or export and inspect w:author on the new w:ins / w:del.
- Observed:
Human Editor. Expected: Automated Reviewer, as 1.x produced with setOptions.
Restoring superdoc.user after the write, or leaving it swapped, makes no difference.
Ask
A supported way to set the author of a tracked change created through the Document API. Either of these would work for us:
- An author field on
MutationOptions, so it is per write and needs no global mutation.
- A documented instance-level setter, the 2.x equivalent of
setOptions({ user }).
Environment:
superdoc@2.12.0+@superdoc/react@2.7.0(@superdoc/docx-engine@0.11.0), browser adapter, Chrome 152. Compared againstsuperdoc@1.45.0.What changed
On 1.x a host could attribute a programmatic tracked change to a chosen author by swapping the editor's user around the write:
The created
w:ins/w:delcarriedw:author="Automated Reviewer".On 2.x
setOptionsandoptions.userare gone, and we could not find a replacement. What we looked at:superdoc.useris the closest surviving field. Mutating it around the write does not reach the mark: the revision comes out attributed to the signed-in user, the one passed asuserat construction.MutationOptionsacceptschangeMode,dryRunandexpectedRevisiononly.TextReplaceInputacceptstarget/ref,textandin.setUseror equivalent method on the public surface.modules.trackChangesexposesenabled,visible,mode,replacements,authorColorsandsemanticColors.authorColorscolours an author but does not set one.If there is a supported way to do this that we missed, pointing at it would be enough and this can be closed.
Why it matters
An application that writes tracked changes on the user's behalf cannot distinguish them from the user's own. Both come out under the same name, so opening the file in Word shows one author for two different kinds of edit, and nothing downstream (accept/reject by author, filtering, audit) can separate them.
Steps to reproduce
user: { name: 'Human Editor', email: 'human@example.com' }.superdoc.user = { name: 'Automated Reviewer', email: 'bot@example.com' }.await doc.replace({ target, text }, { changeMode: 'tracked' })over any text range.doc.trackChanges.list(...), or export and inspectw:authoron the neww:ins/w:del.Human Editor. Expected:Automated Reviewer, as 1.x produced withsetOptions.Restoring
superdoc.userafter the write, or leaving it swapped, makes no difference.Ask
A supported way to set the author of a tracked change created through the Document API. Either of these would work for us:
MutationOptions, so it is per write and needs no global mutation.setOptions({ user }).