-
Notifications
You must be signed in to change notification settings - Fork 62
IT-260 - fix: sync presentationEditor with hidden host #1856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…587) (#1806) * fix: remove dead code * refactor: table and paragraph converters to avoid redirection * test: adjust existing tests * fix: remove unused imports and dead code * fix: pass theme colors to node handlers * refactor: simplify type definitions for converters --------- Co-authored-by: Luccas Correa <luccas@superdoc.dev>
There was a problem hiding this 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: 213ec6def1
ℹ️ 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".
| // Apply decoration classes and attributes to painted elements | ||
| for (const entry of paintedEntries) { | ||
| for (const cls of decorationClasses) { | ||
| entry.el.classList.add(cls); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove stale decoration attributes on repaint
This sync only ever adds classes/data-* attributes to painted entries and never removes ones that were previously applied. Because the DOM painter reuses fragment elements across incremental paints (e.g., patchLayout updates existing elements without clearing classes), a decoration that is later removed or moved in the hidden ProseMirror view will leave stale highlight classes/data attributes in the visible editor. This shows up whenever a plugin toggles a decoration off or shifts it to a different range. Consider clearing previously synced decoration classes/attrs (or tracking the set per paint and removing those no longer present) before reapplying.
Useful? React with 👍 / 👎.
|
Hi @harbournick @artem-harbour @afn, when you have a chance I'd appreciate your eyes on this! This allows ProseMirror plugin decorations (like highlights) to appear in the presentationEditor by syncing decoration attributes from the hidden host to the painter host. |
No description provided.