You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(lists): merge and split operations
* fix(lists): restart numbering
* fix(lists): return OOXML-stable paraId from lists.insert receipt
* docs(prompt): sub-point + nested-list recipes for agents
* test(lists): merge/split validator and wrapper tests
* fix(query-match-adapter): enhance error handling for discontiguous text ranges
* feat(numbering): add sanity checks for ordered list formatting and symbol font violations
- Introduced `numbering-consistency.js` to validate that ordered list levels do not use symbol fonts, preventing rendering issues in Word.
- Implemented `findSymbolFontsOnOrderedLevels` function to identify violations in OOXML abstractNum elements.
- Added comprehensive tests in `numbering-consistency.test.js` to ensure correct functionality and edge case handling.
* feat(lists): enhance list action validation and add new tests
- Updated `package.json` to refine the `clean` script and introduce new prebuild commands for benchmark dependencies.
- Added a new function `usesListAction` in `checks.cjs` to validate that the expected list action is called during evaluations.
- Introduced a new document `basic-list.docx` for testing list operations.
- Expanded benchmark and execution tests to include assertions for list actions, ensuring correct functionality for merging, splitting, and restarting lists.
- Implemented regression guards to check for symbol font violations in ordered lists.
* refactor(intent-dispatch): streamline case statements for intent actions
* refactor(intent-dispatch): simplify case statements for intent actions and improve readability
* refactor: require structural emptiness for paragraphs
- Updated test descriptions for clarity, removing references to specific bugs.
- Added new test cases for `lists.merge` and `lists.split` actions to ensure proper functionality and validation.
- Refactored `listsMergeWrapper` and `listsSplitWrapper` to improve handling of empty paragraphs and revision management during list operations.
* fix: update document API references to use 'document' instead of 'active editor'
* test(evals): assert list structural changes for merge/split/restart
Adds checkBulletsAndNumbersMerged, checkBulletListSplitAtWith, and
checkRestartAtAllSorts in evals/shared/checks.cjs that read
word/document.xml from the saved docx and verify the numId/ilvl change
the agent was supposed to make. Without these the merge/split/restart
evals could pass even if the list itself never changed.
Also reword the listsSplitWrapper doc comment to drop the misleading
"applied atomically" claim - the implementation runs as two sequential
steps and the inline note already documents the partial-apply failure
mode. And rename the validator test that read backwards (default is
restart-on, not opt-out).
---------
Co-authored-by: Caio Pizzol <caio@superdoc.dev>
Co-authored-by: Caio Pizzol <97641911+caio-pizzol@users.noreply.github.com>
@@ -196,6 +196,8 @@ The tables below are grouped by namespace.
196
196
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/join"><code>lists.join</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.join(...)</code></span> | Merge two adjacent list sequences into one. |
197
197
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/can-join"><code>lists.canJoin</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.canJoin(...)</code></span> | Check whether two adjacent list sequences can be joined. |
198
198
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/separate"><code>lists.separate</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.separate(...)</code></span> | Split a list sequence at the target item, creating a new sequence from that point forward. |
199
+
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/merge"><code>lists.merge</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.merge(...)</code></span> | Compound: merge two adjacent list sequences into one. Reassigns numId on the absorbed sequence (no strict abstractNumId check — absorbed items adopt the absorbing definition) and deletes empty paragraphs between the two sequences. Use this instead of lists.join for the user-facing "merge these lists" intent. |
200
+
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/split"><code>lists.split</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.split(...)</code></span> | Compound: split a list sequence at the target item into two independent sequences. Runs lists.separate then (by default) lists.setValue(1) so the new half starts numbering fresh at 1. Pass restartNumbering:false for raw separate semantics (new half continues the previous count). |
199
201
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/set-level"><code>lists.setLevel</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.setLevel(...)</code></span> | Set the absolute nesting level (0..8) of a list item. |
200
202
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/set-value"><code>lists.setValue</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.setValue(...)</code></span> | Set an explicit numbering value at the target item. Mid-sequence targets are atomically separated first. |
201
203
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/lists/continue-previous"><code>lists.continuePrevious</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.lists.continuePrevious(...)</code></span> | Continue numbering from the nearest compatible previous list sequence. |
@@ -338,9 +340,9 @@ The tables below are grouped by namespace.
338
340
339
341
| Operation | API member path | Description |
340
342
| --- | --- | --- |
341
-
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/get"><code>history.get</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.get(...)</code></span> | Query the current undo/redo history state of the active editor. |
342
-
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/undo"><code>history.undo</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.undo(...)</code></span> | Undo the most recent history-safe mutation in the active editor. |
343
-
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/redo"><code>history.redo</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.redo(...)</code></span> | Redo the most recently undone action in the active editor. |
343
+
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/get"><code>history.get</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.get(...)</code></span> | Query the current undo/redo history state of the document. |
344
+
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/undo"><code>history.undo</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.undo(...)</code></span> | Undo the most recent history-safe mutation in the document. |
345
+
| <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><ahref="/document-api/reference/history/redo"><code>history.redo</code></a></span> | <spanstyle={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.history.redo(...)</code></span> | Redo the most recently undone action in the document. |
0 commit comments