Changelog

Block-scoped review reads

Read tracked changes for just the paragraphs on screen, insert page breaks at the caret, and validate collaboration updates before they reach a room.

Block-scoped review reads

A review panel on a long document had to list every tracked change to show the few on screen, and a custom page-break button could only append to the end of the document. This release scopes tracked-change reads to blocks, inserts page breaks at the caret, and lets a collaboration server check what an update does before applying it.

Added

Read tracked changes for specific blocks

In the browser editor, trackChanges.list accepts blockIds, so a review panel can read only the changes in the paragraphs it shows instead of listing the whole document. An empty array returns no changes. The option is not yet in the published trackChanges.list input schema, so SDK and CLI callers that validate against the contract may reject it.

const result = await superdoc.activeEditor.doc.trackChanges.list({
  blockIds: [paragraphId],
});

The other list options are covered in List and inspect changes.

Insert a page break at the browser caret

In a mounted browser editor, insert with a single page-break node and no target now inserts a native Word page break (w:br w:type="page") at the current caret instead of appending it to the document. It keeps tracked attribution in suggesting mode, joins shared undo history, and syncs to peers.

const receipt = await superdoc.activeEditor.doc.insert({
  content: { kind: 'break', break: { type: 'page' } },
});

Other untargeted inserts still append. A range selection, a table selection, or no text caret returns a failure. See Insert a native page break at the browser caret.

Validate collaboration updates before admission

The new superdoc/collaboration-validation entry point (Node.js ESM) classifies a raw Yjs V1 update against the room's accepted Y.Doc without applying it. classifyUpdate returns a decision such as comment, suggestion, edit, attribution, noop, invalid, unverifiable, or unsupported. isComment, isSuggestion, and isEdit are boolean shortcuts. A server can use them to let reviewers comment or suggest without granting direct edits. Drop noop updates without applying them, and admit attribution refreshes from writers already allowed in the room: the typed client sends one after a burst of edits, and rejecting it leaves that writer's next update unverifiable.

import { classifyUpdate } from 'superdoc/collaboration-validation';

function shouldApply(update: Uint8Array) {
  const decision = classifyUpdate({ accepted: roomDoc, update, roomName });
  if (decision.kind === 'noop') return false;

  return (
    (decision.kind === 'comment' && permissions.canComment) ||
    (decision.kind === 'suggestion' && permissions.canSuggest) ||
    (decision.kind === 'edit' && permissions.canEdit) ||
    (decision.kind === 'attribution' && permissions.canWriteRoom)
  );
}

See Gate y-websocket updates by operation for the supported room shapes and operations.

Changed

  • Review: listing tracked changes and accepting or rejecting one change are faster on large documents. Review marks paint for visible pages without waiting for the review warm-up.
  • History: undo and redo of many formatting changes stay incremental.
  • Opening: documents with many formatted runs open faster, and documents without tracked changes skip review preparation.
  • Saving: saving an unedited document preserves its original package.

Fixed

  • Track changes: tracked formatting, comment replies, and selection anchors survive edits, save, and reopen. Pressing Enter inside a tracked insertion or deletion splits it the way Word does, keeping author, date, and a new revision ID.
  • Lists: new list items get the List Paragraph style, and paragraphs with an empty w:lvlOverride are numbered as Word numbers them. Lists in headers, footers, footnotes, and endnotes lay out correctly.
  • Rendering: tracked table sizing and grids, grouped header pictures, and inline EMF images render as Word lays them out.
  • Memory: destroyed editors are released from module-level caches.

Document API compatibility

  • Every mutation that can return a CAPABILITY_UNAVAILABLE receipt now lists it in possibleFailureCodes. Clients that validate receipts against the published contract no longer reject real responses.
  • Tracked checkbox state changes and footnote configuration return CAPABILITY_UNAVAILABLE.
  • Tracked section breaks relative to a paragraph return an unsupported-target receipt.
  • Joining lists with incompatible numbering definitions requires explicit opt-in.