fix: numbered list item decorations missed on initial render#2734
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (3)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe IndexingPlugin's ChangesInitial Plugin State Handling
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
@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: |
Summary
This PR fixes a bug introduced in #2600, where list item indices would not be visible on the initial render. They would only show for a given numbered list item block, after the editor content before it was changed. This is because the decoration updates only occur when a transaction has a
changedRange, which is not the case when the editor is first initialized.To fix this, if
changedRangeisnull, the extension scans the whole document to apply decorations, rather than returning early.Rationale
This is a bug.
Changes
See above.
Impact
N/A
Testing
An e2e test for this (
"Check static rendering visually matches live editor"instatic.test.ts) is already present and shows the issue in the screenshot output. This e2e test wasn't updated in #2600, which caused the issue, and was then updated in #2690 without the mistake being caught. The screenshot has been updated in this PR.Screenshots/Video
Checklist
Additional Notes
N/A
Summary by CodeRabbit