fix(core): backspace mid-text next to columnList moves block BLO-1126#2629
fix(core): backspace mid-text next to columnList moves block BLO-1126#2629
Conversation
…nList handler The "move to end of prev columnList" backspace handler was missing a check for whether the cursor is at the start of the block. This caused mid-text backspace next to a columnList to move the entire block into the column instead of deleting a character. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds selection-position guards to keyboard shortcuts that move blocks around multi-column ( Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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. Comment |
… handler Same bug as the backspace handler — the "move first block from next columnList" delete handler was missing a selectionAtBlockEnd check, causing mid-text delete next to a columnList to incorrectly move blocks. Also adds 3 delete tests mirroring the backspace tests, and marks the mid-text tests with TODOs for vitest browser mode migration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@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
commit: |
|
fyi @nperez0111 @matthewlipski I think the keyboardshortcuts could use a rewrite in general. I'm not convinced the separation of different commands actually improve readability / testability. Example: I think it would be a cleaner to have 1 if-statement that checks for "is cursor at block end", and within that determines the operation needed, versus what we have now: x different chained commands that all check independently whether "is cursor at block end" |
Yep, it's a mess. commands aren't the recommended pattern here |
Summary
selectionAtBlockStartguard, causing mid-text backspace next to a columnList to move the entire block into the column instead of deleting a character.Closes #2621
Test plan
mid-text backspace next to columnList should not move block— verifies the fixbackspace at block start should move block into last column— verifies intended behaviorsecond backspace should merge into previous block in column— verifies merge after move🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests