Skip to content

fix(docx): tracked text keeps its own lines, its decoration in longhands; tracked typing tested a second apart - #61

Merged
pierreneter merged 5 commits into
mainfrom
fix/track-marks-session
Dec 1, 2026
Merged

pierreneter merged 5 commits into
mainfrom
fix/track-marks-session

Conversation

@pierreneter

@pierreneter pierreneter commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #59. The net change against main is src/react/docx/render.tsx and one browser test.

Tracked text keeps its own lines (src/react/docx/render.tsx)

  • Lost lines. Struck-through text inserted with Track changes on showed only the change's underline, and underlined text deleted showed only the strike line, because the change's textDecoration replaced the text's. The change's line is now added to the text's own, in one solid style. The run's double or wavy style no longer reaches the change's line.
  • React warning. A tracked run had textDecoration together with textDecorationColor, and a formatted one had textDecoration together with textDecorationStyle. React warns in development when such a span's style changes, for example when text next to it is struck out: "Updating a style property during rerender (textDecoration) when a conflicting property is set (textDecorationColor)". Both functions now use textDecorationLine, which draws the same. Nothing else reads these styles; the docx tests read the computed textDecorationLine.

Test (e2e/docx-track.spec.ts)

Not in here: changes of two collaborators under the same name

This PR first tried to tell a collaborator's change from one made in this editor when both have the same author name (two people who never set a name are both "Me"). The marks made here carried a symbol, which JSON drops, so neither the file nor collaborators would get it. Review found that this broke ordinary sessions. A collaborator's paragraph change (Enter, alignment, bold) rewrites the paragraph with JSON copies, so my own marks lost the symbol. After that, Backspace on my own insertion struck it through instead of removing it, even when everyone had a different name. That is reverted (8f01bbd), and the rules are as on main.

A mark kept only by this editor can't tell two people with the same name apart. The collaboration has no stable user id to go by: UserInfo.id is optional, and a peer's site changes with the connection. A real fix would need hosts to give each user an id that marks carry. That is left for a separate decision.

Checks

  • bun test ./test: 1754 pass, 0 fail. tsc --noEmit: clean.
  • docx-track, docx, collab, comments-collab, docx-qa3, format-controls, viewer (Chromium): 81 pass, 0 fail.

🤖 Generated with Claude Code

pierreneter and others added 5 commits December 1, 2026 15:15
… mark of this editor, not by the file's w:id

The editor told a change it had made from one made before by the w:id the file gives. A collaborator's change has
none either, so under the same name (two people who never set one are both "Me"):
- what I typed next to their insertion went on with it, under their date;
- what I took out of it was gone for good, with nothing for a reviewer to see.

The marks this editor makes now carry a symbol: copies keep it, the file and the collaboration (JSON) never get it.
A change goes on with one carrying it only. Text taken out of an insertion under my name is gone for good when the
insertion was made here or read from the file (as Word does); a collaborator's becomes a deletion that keeps it.

Browser test: with the page's clock a second on at every reading, what is typed and struck out is one insertion and
one deletion, so the mark is carried along by the editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a run's style changes

A tracked run had `textDecoration` and `textDecorationColor`, a formatted one `textDecoration` and
`textDecorationStyle`: React warns ("Updating a style property during rerender ... when a conflicting property is
set") when such a span's style changes, as when text next to it is struck out. `textDecorationLine` draws the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t by a mark of this editor

Review: a collaborator's change rewrites a whole paragraph with copies that come as JSON, so the symbol on my own
marks was lost. My own insertion was then taken for someone else's: Backspace struck it through instead of removing
it, and typing next to it began a new change, in any shared session, also with different names. That is worse than
the case it was for (two collaborators under the same name), which no mark kept by this editor can tell apart: the
collaboration has no stable user id to go by (`UserInfo.id` is optional, a peer's `site` changes with the
connection). Back to the rules on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Struck-through text inserted with Track changes on showed only the change's underline (and underlined text deleted
only the strike line): the change's line replaced the text's. The change's line is now added to the text's own, in
one solid style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xt inserted shows both lines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pierreneter pierreneter changed the title fix(docx): a collaborator's change under my name is theirs; text decoration in longhands fix(docx): tracked text keeps its own lines, its decoration in longhands; tracked typing tested a second apart Dec 1, 2026
@pierreneter
pierreneter merged commit bfe776a into main Dec 1, 2026
2 checks passed
@pierreneter
pierreneter deleted the fix/track-marks-session branch December 1, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant