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(track-changes): structural tracked changes for whole-table insert/delete (SD-3360)
Support importing, listing, deciding, and exporting whole-table
insert/delete tracked changes in v1. A whole inserted/deleted table is
encoded in OOXML as <w:ins>/<w:del> inside each row's <w:trPr> (rows may
carry distinct w:ids); v1 previously dropped these on import, never
listed them, could not accept/reject them, and lost them on export.
- Schema: add a `trackChange` revision slot to the tableRow node.
- Import: tr-translator reads <w:ins>/<w:del> in <w:trPr> into the row attr.
- Enumerate: group a table's rows into ONE structural change
(kind.type='structural', subtype table-insert/table-delete) when every
row is tracked and shares one side; ids may differ. Partial/mixed rows
are surfaced but undecidable.
- Decide: accept-insert/reject-delete clear the rows; reject-insert/
accept-delete remove the table; partial-range fails closed with
INVALID_INPUT; non-whole-table shapes fail closed with
CAPABILITY_UNAVAILABLE; inline changes inside a removed table are
retired. Graph identity is table-scoped to avoid id collisions.
- Export: tr-translator emits <w:ins>/<w:del> in <w:trPr> for roundtrip.
- Contract: add 'structural' type + table-insert/table-delete subtype to
the document-api surface; regenerate artifacts.
Validated against the Labs oracle (sdk-v1): the eight failing-known
STRUCT-TABLE conformance/roundtrip/safety cases now pass, zero
regression. Deferred: visual paint, and row/column/cell + property
structural changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: apps/docs/document-api/reference/track-changes/get.mdx
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ Retrieve a single tracked change by ID.
20
20
21
21
## Expected result
22
22
23
-
Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available.
23
+
Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`, `structural`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available. Structural changes (whole-table insert/delete) carry a `subtype` of `table-insert` or `table-delete`.
24
24
25
25
## Input fields
26
26
@@ -60,7 +60,8 @@ Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `repl
Copy file name to clipboardExpand all lines: apps/docs/document-api/reference/track-changes/list.mdx
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ List all tracked changes in the document.
20
20
21
21
## Expected result
22
22
23
-
Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available.
23
+
Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`, `structural`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available. Structural changes (whole-table insert/delete) carry a `subtype` of `table-insert` or `table-delete`.
24
24
25
25
## Input fields
26
26
@@ -29,7 +29,7 @@ Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`
29
29
|`in`| StoryLocator \|`"all"`| no | One of: StoryLocator, `"all"`|
30
30
|`limit`| integer | no ||
31
31
|`offset`| integer | no ||
32
-
|`type`| enum | no |`"insert"`, `"delete"`, `"replacement"`, `"format"`|
32
+
|`type`| enum | no |`"insert"`, `"delete"`, `"replacement"`, `"format"`, `"structural"`|
33
33
34
34
### Example request
35
35
@@ -75,7 +75,7 @@ Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`
75
75
"targetKind": "text"
76
76
},
77
77
"id": "id-001",
78
-
"pairedWithChangeId": null,
78
+
"subtype": "table-insert",
79
79
"type": "insert"
80
80
}
81
81
],
@@ -123,12 +123,13 @@ Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`
123
123
"type": "integer"
124
124
},
125
125
"type": {
126
-
"description": "Filter by change type: 'insert', 'delete', 'replacement', or 'format'.",
126
+
"description": "Filter by change type: 'insert', 'delete', 'replacement', 'format', or 'structural'.",
127
127
"enum": [
128
128
"insert",
129
129
"delete",
130
130
"replacement",
131
-
"format"
131
+
"format",
132
+
"structural"
132
133
]
133
134
}
134
135
},
@@ -192,12 +193,20 @@ Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`
192
193
"null"
193
194
]
194
195
},
196
+
"subtype": {
197
+
"description": "Finer classification for structural changes (type === 'structural').",
description: 'List all tracked changes in the document.',
2483
2483
expectedResult:
2484
-
'Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available.',
2484
+
'Returns a TrackChangesListResult with tracked change entries (`insert`, `delete`, `replacement`, `format`, `structural`), total count, and raw imported Word OOXML revision IDs (`w:id`) when available. Structural changes (whole-table insert/delete) carry a `subtype` of `table-insert` or `table-delete`.',
description: 'Retrieve a single tracked change by ID.',
2498
2498
expectedResult:
2499
-
'Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available.',
2499
+
'Returns a TrackChangeInfo object with the change type (`insert`, `delete`, `replacement`, `format`, `structural`), author, date, affected content, and raw imported Word OOXML revision IDs (`w:id`) when available. Structural changes (whole-table insert/delete) carry a `subtype` of `table-insert` or `table-delete`.',
0 commit comments