Skip to content

Fix ordered list numbering after headings#5011

Merged
zbeyens merged 1 commit into
mainfrom
codex/fix-4985-list-heading-numbering
Jun 14, 2026
Merged

Fix ordered list numbering after headings#5011
zbeyens merged 1 commit into
mainfrom
codex/fix-4985-list-heading-numbering

Conversation

@zbeyens

@zbeyens zbeyens commented Jun 13, 2026

Copy link
Copy Markdown
Member
  • Auto release

🐛 Fixes #4985

🟢 95-100% confidence

Phase 🧪 Tests 🌐 Browser
Reproduced 🔴 pnpm --filter @platejs/list test normalizeListStart failed before fix: paragraph items after numbered headings normalized as 3, 4. ➖ N/A
Verified 🟢 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. ➖ N/A

✅ Outcome
Ordered paragraph lists start independently after numbered headings. Heading numbering and paragraph numbering stay in separate tracks.

⚠️ Caveat
No browser proof: issue marks Browser surface No and the behavior is owned by package normalization. pnpm check emits an existing eslint warning in apps/www/src/components/ui/sidebar.tsx but 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. toggleList uses the same lookup for listRestartPolite, and heading detection uses editor-resolved node types. The large normalizeListStart regression file runs as *.slow.tsx so CI fast-suite budget stays clean without dropping coverage.

🧪 Verified
@platejs/list focused 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:slowest no longer reports normalizeListStart over the fast-suite file threshold. Final pnpm check passed.

@zbeyens zbeyens requested a review from a team June 13, 2026 23:34
@codesandbox

codesandbox Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot

changeset-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6cfc128

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@platejs/list Patch

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

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. patch Bugfix & documentation PR plugin:list labels Jun 13, 2026
@zbeyens zbeyens force-pushed the codex/fix-4985-list-heading-numbering branch 2 times, most recently from 307f9a6 to 782c787 Compare June 14, 2026 07:49
@zbeyens zbeyens force-pushed the codex/fix-4985-list-heading-numbering branch from 782c787 to 6cfc128 Compare June 14, 2026 08:15
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jun 14, 2026
@zbeyens zbeyens merged commit f7cfef2 into main Jun 14, 2026
5 checks passed
@zbeyens zbeyens deleted the codex/fix-4985-list-heading-numbering branch June 14, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bugfix & documentation PR plugin:list size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ordered list numbering continues from heading to paragraph

1 participant