Skip to content

[IT-925] fix(presentation-editor): skip expensive decoration checks on doc changes#2854

Open
mattConnHarbour wants to merge 4 commits intomainfrom
IT-925
Open

[IT-925] fix(presentation-editor): skip expensive decoration checks on doc changes#2854
mattConnHarbour wants to merge 4 commits intomainfrom
IT-925

Conversation

@mattConnHarbour
Copy link
Copy Markdown
Contributor

No description provided.

@linear
Copy link
Copy Markdown

linear bot commented Apr 17, 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: d3288f3980

ℹ️ 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 +640 to +644
// No cached data, but this is a doc-changing transaction.
// Return empty rather than calling expensive plugin.props.decorations().
// Decorations will be properly synced on the next meta-only transaction
// (e.g., setFocus, search update) which doesn't use this fast path.
return { ranges: [], decorationSet: DecorationSet.empty };
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 Recompute plugin decorations when doc changes

This doc-change fast path returns cached/empty ranges without calling plugin.props.decorations(), so any plugin whose decoration set actually changes on edits (for example, content-driven external highlights) can get stuck with stale state: new highlights never appear when previous ranges were empty, and cleared highlights can persist after content changes until a later meta-only transaction happens. Because this method is used by both collectDecorationRanges() and sync(), the stale result affects both run-splitting and DOM decoration sync during normal typing.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown
Contributor

📦 Preview published: superdoc@1.25.0-pr.2854.1776397995

npm install superdoc@pr-2854

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.

1 participant