fix(run-plugin): narrow accept/reject guard to actually-removed keys#2786
fix(run-plugin): narrow accept/reject guard to actually-removed keys#2786caio-pizzol merged 1 commit intomainfrom
Conversation
The previous fix skipped the SD-2517 lost-keys preservation for every inline key whenever an accept/reject transaction ran. That was too broad: in imported docs where explicit w:rPr keys may drop out of computed inline props via style-equivalence, an unrelated accept/reject on the same run stripped those keys from runProperties, losing inline formatting on export. Collect the specific keys removed in this batch instead — mark type name for standalone marks, and each truthy attr key for removed textStyle marks — and only block preservation for those keys. Unrelated inline keys on the same run keep their import-time fallback. Replaces the blanket !isAcceptReject guard introduced in 4537381.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 435280800c
ℹ️ 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".
| if (jsonStep.mark.type === 'textStyle') { | ||
| Object.entries(jsonStep.mark.attrs || {}).forEach(([key, value]) => { | ||
| if (value != null) removedKeys.add(key); |
There was a problem hiding this comment.
Compute removed textStyle keys from net mark diff
removedKeys currently adds every non-null attr from each removeMark textStyle step, but textStyle updates are often implemented as replace-in-place (remove old mark, then add a new one). In those cases, unchanged attrs are still treated as “removed”, so the lost-key fallback later skips restoring them even when they were re-added and only disappeared due style-equivalence filtering. This can drop imported inline keys (for example fontFamily) after unrelated formatting edits or accept/reject flows that rewrite textStyle marks.
Useful? React with 👍 / 👎.
|
🎉 This PR is included in @superdoc-dev/react v1.1.1-next.3 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.3.0-next.3 |
|
🎉 This PR is included in esign v2.3.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in template-builder v1.5.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.26.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-cli v0.7.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.5.1-next.3 |
No description provided.