Repository navigation
fix: size ordered list markers to their widest number - #1015
Merged
Merged
Conversation
…s with it The nested-item margin lives in BaseListSpan, driven by a markerExtraWidth that OrderedListSpan and TaskListSpan override, so a later change to nested margins has one formula to extend. ListContextManager saves and restores the widening like the rest of the list state, and the column is measured by a companion function instead of a throwaway span. The extra is rounded to whole pixels so the Int leading margins and the float marker positions agree at every depth. A task item inside a widened ordered list now moves with its numbered siblings on every platform, as the Swift package already did; before, the checkbox column stayed put and left a notch in long lists. iOS names the nesting offset ancestorMarkerOffset like Android, keeps the per-list extra cached on the context, and derives the default column width from ListStyle instead of a static on a sibling renderer. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The marker width suites become ListRenderingTest(s) on every platform, growing with later list fixes instead of one file per bug. The checkbox toggle test moves to TaskListInteractionTest. The RN Android package gets a test/ support package like the standalone one: a render helper, an AST factory, and the canvas that records drawn markers, which both Android packages now share. Task alignment tests assert that every row of a widened list, tasks and their children included, shifts by the same amount. The Android baselines for ordered_list_wide_markers_test are recaptured on the repo's Pixel 9 API 36 AVD, where the committed ordered-list baselines pass exact-match; the iOS captures reproduce byte for byte and are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5 of 6 tasks
eszlamczyk
approved these changes
Oct 16, 2026
This was referenced Oct 16, 2026
eszlamczyk
pushed a commit
that referenced
this pull request
Oct 16, 2026
* fix(clipboard): preserve table cell line breaks and math * fix(ios): keep hard breaks inside their block when exporting HTML collectParagraphsData split on lineRangeForRange:, which treats the U+2028 a hard break renders as like a paragraph end. A paragraph with a hard break exported as two <p> blocks and a list item as two <li> items, and with the new <br> escaping the first half gained a trailing <br>. Split on paragraphRangeForRange: so the break stays in its block and becomes <p>line one<br>line two</p>. Tests are named by feature like #1015: ClipboardExportTests.mm and ClipboardExportTest.kt, since both cover HTML and Markdown export. Added a rendered hard-break case on iOS, the code block gate on Android, a run that mixes escaped characters with a line break, and math nested in strong, on both platforms. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
4 of 6 tasks
4 of 6 tasks
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.
What/Why?
Ordered lists that reach
100.clip their markers: the column is sized for99.and numbers are right-aligned against it, so100.draws as00.. Each ordered list now measures its widest marker and widens its own column to fit;markerMinWidthstays the floor, lists under 100 keep the99.column, and nested lists move with a widened parent.This carries @mwolson's #1005 (8407374) unchanged as the first commit, plus two follow-up commits from a local review. #1005 stays open for the discussion there; GitHub refuses maintainer pushes to that branch because the fork's parent is
pingdotgg/enriched-markdown, so the follow-ups land here instead.Closes #1003.
Follow-up commits on top of #1005
Library
BaseListSpanvia an overridablemarkerExtraWidth, so there is one formula for fix(android): align mixed nested list indents with iOS #1006 to extend.ListContextManagersaves and restores the widening like the rest of the list state. The column is measured by a companion function instead of a throwaway span, and the new span arguments are named at call sites.Intleading margins and the float marker positions agree at every nesting depth with proportional fonts.listMarkerOffsetisancestorMarkerOffsetto match Android, the per-list extra stays cached on the RN context, and the Swift default column width is an extension onListStyleinstead of a static on a sibling renderer.Tests
ListRenderingTest(s)on every platform, with the checkbox toggle test inTaskListInteractionTest. The RN Android package gets atest/support package like the standalone one (render helper, AST factory, and the canvas that records drawn markers), shared by both Android packages.Baselines and docs
ordered_list_wide_markers_testrecaptured on the repo's Pixel 9 API 36 AVD, where the committed ordered-list baselines pass exact-match; the originals from fix: size ordered list markers to their widest number #1005 did not. iOS captures reproduce byte for byte on iPhone 17 / iOS 26.5 and are unchanged.markerMinWidthrows in the RN and Android docs mention the widening.Testing
ListRenderingTest(11) andTaskListInteractionTest(2); standalone AndroidListRenderingTest(8) with the full:uisuite; standalone iOSListRenderingTests(13) with the full package suite; RN iOSListRenderingTests(6) in the example test target. ktlint, swiftlint--strictand clang-format pass.ordered_list_wide_markers_testin the RN and native iOS examples; captures byte-identical to the committed baselines.ordered_list_wide_markers_testcaptured on two consecutive builds with identical output;ordered_list_testandnested_ordered_list_testpass exact-match against theirmainbaselines, so no code path changes for lists under 100 items on React Native and Android, and the existing ordered-list captures matchmainpixel for pixel.Notes
shortMixedNestsKeepTheirOriginalTextIndentspins the current mixed-marker indents and needs updating when it lands. With the extra inBaseListSpan, the combined resolution described in fix: size ordered list markers to their widest number #1005 should reduce to adding fix(android): align mixed nested list indents with iOS #1006's term to that one method.ParagraphLayoutWalkerTests.testLinesMatchTextSegmentsfails identically onmainwith Xcode 27 here, and the committed Androidtask_list_testbaseline differs from the Pixel 9 AVD by anti-aliasing only.PR Checklist
🤖 Generated with Claude Code