Repository navigation
fix(core): restore undo of autoformat conversions - #3164
nperez0111 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughBlock conversion changes now use a strict replacement step for non-leaf-to-leaf conversions. The Yjs undo extension stops capturing when a transaction marks a ProseMirror history boundary. A thread-store test now cleans up its editor and Yjs document in a ChangesBlock Conversion Undo
Yjs History Boundaries
Yjs Thread Store Test Cleanup
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ProseMirror
participant YUndoExtension
participant YjsUndoManager
ProseMirror->>YUndoExtension: Dispatch transaction with closeHistory metadata
YUndoExtension->>YjsUndoManager: Call stopCapturing()
YUndoExtension-->>ProseMirror: Return no transaction
Merge Risk: ⚪ Minimal · up to The reviewed change ensures test resources are cleaned up even when an assertion fails. No actionable merge-blocking risk is established, so the change is mergeable under normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation The incremental change wraps an existing resolvable-position test in cleanup that destroys its editor and Yjs document. That cleanup does not test or implement the conversion or history-boundary behavior for [
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit typed three dashes with care, Comment |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
Summary
Fix undo of autoformat conversions in ordinary history and Yjs 13 collaboration.
Closes #3153.
Rationale
Two independent problems prevent the first undo from restoring the literal input-rule trigger:
setNodeMarkupcreates aReplaceAroundStepwhose inverse fails its structure check. Ordinary history can leave the divider unchanged and throw a selection-position error.closeHistoryboundary dispatched between insertion of the literal trigger and the input-rule conversion, so both changes can merge into one undo item.Changes
ReplaceStepfor non-leaf-to-leaf conversions, preserving the enclosing block, children, and neighboring nodes.closeHistorymarker intoUndoManager.stopCapturing()in the Yjs 13 undo extension.updateBlocktests with general conversion undo/redo and minimal-step inversion regressions across paragraphs, headings, code blocks, dividers, and images.Impact
No public API changes. Other block updates retain their existing minimal-step behavior. Consecutive collaborative edits still group normally when no explicit history boundary is present.
Testing
git diff --checkpassed.vp check --fix.Screenshots/Video
Not applicable: history/transaction fixes without visual styling changes.
Checklist
Additional Notes
This PR targets main directly and does not depend on #3090. Yjs 14 undo support and its equivalent upstream history-boundary fix are outside this PR's scope. No documentation changes are needed for this bug fix.
Summary by CodeRabbit