Repository navigation
fix(docx): tracked text keeps its own lines, its decoration in longhands; tracked typing tested a second apart - #61
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #59. The net change against
mainissrc/react/docx/render.tsxand one browser test.Tracked text keeps its own lines (
src/react/docx/render.tsx)textDecorationreplaced 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.textDecorationtogether withtextDecorationColor, and a formatted one hadtextDecorationtogether withtextDecorationStyle. 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 usetextDecorationLine, which draws the same. Nothing else reads these styles; the docx tests read the computedtextDecorationLine.Test (
e2e/docx-track.spec.ts)xyztyped andrmstruck out are saved as one insertion and one deletion: fix: three flaky tests: Find's late selection in the long document, tracked typing across a second, the big CSV's time #59's fix, checked in the browser.xyz, struck through, shows both lines. This fails onmain: the strike line never shows, and React logs the warning above.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 onmain.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.idis optional, and a peer'ssitechanges with the connection. A real fix would need hosts to give each user anidthat 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