fix(behavior-tests): unblock main by fixing 3 failing specs#2785
fix(behavior-tests): unblock main by fixing 3 failing specs#2785caio-pizzol merged 2 commits intomainfrom
Conversation
…l in extract.spec - Line 40: removed superdoc.click() — the method doesn't exist on the fixture and the fixture already focuses the editor on setup. - Line 95: replaceText expects a SelectionTarget; findFirstTextRange returns a TextAddress, which fails doc.replace() validation. Switch to findFirstSelectionTarget.
…nd mark removal The SD-2517 lost-keys preservation was re-applying values from runNode.attrs.runProperties whenever a key in runPropertiesInlineKeys dropped out of the computed inline props. Two scenarios left stale values in place: 1. Track-change accept/reject: the restored marks are canonical but runNode.runProperties still reflects the pre-resolution (suggested) state, so preservation re-injected the rejected fontFamily/color/etc. 2. User toggles a standalone mark off (bold, italic, underline): the removed mark's value stayed in the run node's runProperties and preservation brought it back, causing new paragraphs created via Enter to inherit stale formatting (SD-2228). Skip preservation during 'acceptReject' transactions, and skip per-key when the transaction batch contains a RemoveMarkStep for that mark type. The SD-2517 heading round-trip case is unaffected (no mark changes occur during zero-edit import → export).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b75395df00
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // | ||
| // Skip entirely during accept/reject: the restored marks are canonical, and | ||
| // existing run.runProperties still reflect the pre-resolution (suggested) state. | ||
| if (hadInlineKeys && !isAcceptReject) { |
There was a problem hiding this comment.
Preserve unaffected inline keys during accept/reject
The new !isAcceptReject guard disables lost-key preservation for all inline keys whenever any accept/reject transaction runs, not just for keys that are actually stale from suggestion marks. In imported docs where explicit w:rPr keys can be dropped by style-equivalence comparison, accepting/rejecting a change now strips those keys from runProperties; exporter logic only writes keys that still exist in runProperties, so the original explicit formatting can be lost on round-trip export.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — narrowing the check so it only skips fields that were actually part of the removed marks, not all of them. Follow-up PR incoming.
|
🎉 This PR is included in vscode-ext v2.3.0-next.2 |
|
🎉 This PR is included in template-builder v1.5.0-next.2 The release is available on GitHub release |
|
🎉 This PR is included in @superdoc-dev/react v1.1.1-next.2 The release is available on GitHub release |
|
🎉 This PR is included in esign v2.3.0-next.2 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.26.0-next.2 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.7.0-next.2 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.5.1-next.2 |
f