Skip to content

fix(run-plugin): narrow accept/reject guard to actually-removed keys#2786

Merged
caio-pizzol merged 1 commit intomainfrom
caio/refine-run-plugin-accept-reject
Apr 12, 2026
Merged

fix(run-plugin): narrow accept/reject guard to actually-removed keys#2786
caio-pizzol merged 1 commit intomainfrom
caio/refine-run-plugin-accept-reject

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol commented Apr 12, 2026

No description provided.

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.
@caio-pizzol caio-pizzol added this pull request to the merge queue Apr 12, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +63 to +65
if (jsonStep.mark.type === 'textStyle') {
Object.entries(jsonStep.mark.attrs || {}).forEach(([key, value]) => {
if (value != null) removedKeys.add(key);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Merged via the queue into main with commit eec4cde Apr 12, 2026
54 checks passed
@caio-pizzol caio-pizzol deleted the caio/refine-run-plugin-accept-reject branch April 12, 2026 15:24
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in @superdoc-dev/react v1.1.1-next.3

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.3

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in esign v2.3.0-next.3

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in template-builder v1.5.0-next.3

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in superdoc v1.26.0-next.3

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in superdoc-cli v0.7.0-next.3

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot bot commented Apr 12, 2026

🎉 This PR is included in superdoc-sdk v1.5.1-next.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants