[IT-925] fix(presentation-editor): skip expensive decoration checks on doc changes#2854
[IT-925] fix(presentation-editor): skip expensive decoration checks on doc changes#2854mattConnHarbour wants to merge 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 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".
| // 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 }; |
There was a problem hiding this comment.
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 👍 / 👎.
|
📦 Preview published: npm install superdoc@pr-2854 |
No description provided.