Docxodus 12.6.1 resolves the ordinary interior insertion case from #799. A remaining practical case is styled typing inside a run that contains a leading w:tab followed by ordinary w:t. The published API intentionally refuses mixed-content runs, so the React integration still needs the expensive atomic batch here.
The NVCA stress document contains this structure in a footnote:
<w:r>
<w:tab/>
<w:t xml:space="preserve">Consider adding other exceptions as provided in </w:t>
</w:r>
The caret is inside the text, at native paragraph offset 24. The surrounding footnote reference is in a separate run. This is an ordinary character boundary, outside a field or hyperlink.
Fixture: NVCA Model COI, October 1, 2025, 147,622 bytes; SHA-256 d75600769c12724990de48149d7a2bb161f3522daa54b1783672f93697d87d29.
Public-API reproduction
After loading the fixture bytes:
import { initialize, openDocxSession } from 'docxodus/core';
async function reproduce(bytes, wasmBasePath) {
await initialize(wasmBasePath);
const s = openDocxSession(bytes, {
emitMarkdownPatch: false,
persistAnchorIds: true,
});
try {
const [id] = Object.entries(s.project().anchorIndex).find(([id, a]) =>
/^(p|h|li):fn:/.test(id) &&
a.textPreview.startsWith('Consider adding other exceptions'));
const formatting = JSON.stringify(s.getFormatting(id));
const xml = s.raw.getXml(id);
const version = s.getVersion();
const edit = s.replaceMatch({
text: '',
enclosingAnchor: {
id, kind: id.split(':')[0], scope: 'fn', unid: id.split(':').at(-1),
},
span: { start: 24, length: 0 },
fragments: [], contextBefore: '', contextAfter: '', groups: [],
}, ' inserted ', { bold: true });
return {
edit,
versionUnchanged: s.getVersion() === version,
xmlUnchanged: s.raw.getXml(id) === xml,
formattingUnchanged: JSON.stringify(s.getFormatting(id)) === formatting,
};
} finally { s.close(); }
}
Observed on the unmodified npm docxodus@12.6.1: success: false, error.code: "offset_out_of_range"; version, XML, and formatting remain unchanged. This matches the release's mixed-content exclusion.
Measured impact
Two serial native-only contexts, without React, canvas, rendering, or a registered page map:
- Ordinary body-run interior insertion succeeds in 64.6–68.5 ms with one version and one-step undo/redo.
- The tab/text run is refused in 6.8–6.9 ms.
- The existing fallback (borrow one preceding ASCII character for
replaceMatch, then apply Bold only to inserted text inside executeBatch) takes 600.2–621.9 ms. BeginTransaction takes 248.7–265.0 ms and GetPackageContentHash 247.7–249.8 ms.
- The fallback preserves text, surrounding formatting, one-version atomicity, and undo/redo. Undo restores the paragraph XML when equivalent namespace-prefix spellings are normalized.
A production React editor run at application revision 4273011 measured an 816 ms input response at this same footnote location. Its fallback additionally flushed a native page map in 199.6 ms; transaction setup took 274.4 ms and the package hash 284.7 ms. All typed-text, native-formatting, surrounding-text, and key-count assertions passed. Ordinary body interior typing in the unprofiled module/studio runs peaked at 48/40 ms after the upgrade.
Environment: Intel Core Ultra 7 258V, eight logical CPUs, Linux x64, Chromium 143.0.7499.4, no CPU throttling. Browser Event Timing is quantized; these are diagnostic measurements on one machine, not a universal latency bound.
Requested capability
Please support atomic formatted insertion into the ordinary text portion of a tab/text run while preserving the tab's position, surrounding formatting, rollback, and one-step undo/redo. An alternative documented atomic operation that avoids a full-package checkpoint and receipt for this edit would also meet the integration's need. The React library continues to use released public operations and preserves the current fallback.
The reproduction is included in the existing performance PR, react-docxodus-viewer #43. Its native benchmark supports RDV_NATIVE_INSERTIONS_ONLY=1; the browser benchmark supports RDV_BENCH_TARGET=footnote RDV_BENCH_EXTENDED=1. Both use the checksum-pinned fixture above.
Docxodus 12.6.1 resolves the ordinary interior insertion case from #799. A remaining practical case is styled typing inside a run that contains a leading
w:tabfollowed by ordinaryw:t. The published API intentionally refuses mixed-content runs, so the React integration still needs the expensive atomic batch here.The NVCA stress document contains this structure in a footnote:
The caret is inside the text, at native paragraph offset 24. The surrounding footnote reference is in a separate run. This is an ordinary character boundary, outside a field or hyperlink.
Fixture: NVCA Model COI, October 1, 2025, 147,622 bytes; SHA-256
d75600769c12724990de48149d7a2bb161f3522daa54b1783672f93697d87d29.Public-API reproduction
After loading the fixture bytes:
Observed on the unmodified npm
docxodus@12.6.1:success: false,error.code: "offset_out_of_range"; version, XML, and formatting remain unchanged. This matches the release's mixed-content exclusion.Measured impact
Two serial native-only contexts, without React, canvas, rendering, or a registered page map:
replaceMatch, then apply Bold only to inserted text insideexecuteBatch) takes 600.2–621.9 ms.BeginTransactiontakes 248.7–265.0 ms andGetPackageContentHash247.7–249.8 ms.A production React editor run at application revision 4273011 measured an 816 ms input response at this same footnote location. Its fallback additionally flushed a native page map in 199.6 ms; transaction setup took 274.4 ms and the package hash 284.7 ms. All typed-text, native-formatting, surrounding-text, and key-count assertions passed. Ordinary body interior typing in the unprofiled module/studio runs peaked at 48/40 ms after the upgrade.
Environment: Intel Core Ultra 7 258V, eight logical CPUs, Linux x64, Chromium 143.0.7499.4, no CPU throttling. Browser Event Timing is quantized; these are diagnostic measurements on one machine, not a universal latency bound.
Requested capability
Please support atomic formatted insertion into the ordinary text portion of a tab/text run while preserving the tab's position, surrounding formatting, rollback, and one-step undo/redo. An alternative documented atomic operation that avoids a full-package checkpoint and receipt for this edit would also meet the integration's need. The React library continues to use released public operations and preserves the current fallback.
The reproduction is included in the existing performance PR, react-docxodus-viewer #43. Its native benchmark supports
RDV_NATIVE_INSERTIONS_ONLY=1; the browser benchmark supportsRDV_BENCH_TARGET=footnote RDV_BENCH_EXTENDED=1. Both use the checksum-pinned fixture above.