Fix ordered list numbering after headings#5011
Merged
Merged
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
🦋 Changeset detectedLatest commit: 6cfc128 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
307f9a6 to
782c787
Compare
782c787 to
6cfc128
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Fixes #4985
🟢 95-100% confidence
pnpm --filter @platejs/list test normalizeListStartfailed before fix: paragraph items after numbered headings normalized as3,4.pnpm --filter @platejs/list test isSameListSequence;pnpm test:slow packages/list/src/lib/normalizers/normalizeListStart.slow.tsx;pnpm --filter @platejs/list test toggleList;pnpm turbo typecheck --filter=./packages/list;pnpm lint:fix;pnpm test:slowest;.agents/skills/autoreview/scripts/autoreview --mode local;pnpm check.✅ Outcome
Ordered paragraph lists start independently after numbered headings. Heading numbering and paragraph numbering stay in separate tracks.
No browser proof: issue marks Browser surface No and the behavior is owned by package normalization.
pnpm checkemits an existing eslint warning inapps/www/src/components/ui/sidebar.tsxbut exits 0.🏗️ Design
The sibling lookup splits only same-indent, same defined list-style heading/non-heading transitions. Nested headings, plain headings, differently styled headings, and non-heading blocks such as blockquotes do not reset the parent paragraph list.
toggleListuses the same lookup forlistRestartPolite, and heading detection uses editor-resolved node types. The largenormalizeListStartregression file runs as*.slow.tsxso CI fast-suite budget stays clean without dropping coverage.🧪 Verified
@platejs/listfocused tests cover heading-to-paragraph independence, configured heading node types, nested headings, non-numbered headings, non-heading mixed-block continuation, and polite restart behavior after headings and blockquotes.pnpm test:slowestno longer reportsnormalizeListStartover the fast-suite file threshold. Finalpnpm checkpassed.