Skip to content

feat(input): list block types + marker rendering (lists 2/5)#511

Open
wildseansy wants to merge 2 commits into
software-mansion:mainfrom
wildseansy:feat/list-2-rendering
Open

feat(input): list block types + marker rendering (lists 2/5)#511
wildseansy wants to merge 2 commits into
software-mansion:mainfrom
wildseansy:feat/list-2-rendering

Conversation

@wildseansy

@wildseansy wildseansy commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The list stack (per the review ask, now including ordered lists — the shared machinery made them cheap to add):

  1. refactor(input): generalize empty-line anchor machinery beyond headings (lists 1/5) #510 — anchor machinery refactor (no behavior change)
  2. feat(input): list block types + marker rendering (lists 2/5) #511 — list block types + marker rendering
  3. feat(input): parse and serialize lists (lists 3/5) #512 — parser + serializer
  4. feat(input): list commands, keyboard editing, and empty-item anchors (lists 4/5) #513 — commands + keyboard + ZWSP/empty anchors
  5. feat(input): list state, toolbar, docs, and e2e (lists 5/5) #514 — state + toolbar + docs + e2e

GitHub can't base a fork PR on another fork branch, so every PR targets main and the diff shown for PR N is cumulative — this PR's own change is its last commit (each stage is exactly one commit on the previous branch). We'll merge bottom-up; after each merge the next PR's diff collapses to just its own commit. Checkout feat/list-5-state to test the full feature end-to-end.

This PR (last commit)

UNORDERED_LIST_ITEM / ORDERED_LIST_ITEM with 0-based nesting depth in the range's level payload, joined to the anchored-type set. The store's list-metadata pass clamps depths to valid ancestry (an item nests at most one level under the previous adjacent item — CommonMark cannot represent orphan nesting, so every editor state serializes losslessly) and computes each ordered item's 1-based ordinal from its position among adjacent same-depth, same-type siblings — numbering stays correct as items are added, removed, or re-nested.

Rendering: Android draws markers via LeadingMarginSpans (dot/ring/square by depth for bullets, right-aligned N. for ordered) plus a LineHeightSpan for the new listItemSpacing prop; iOS reserves the indent column via the paragraph style and draws the glyph/number in the layout manager, reading the ordinal from a stamped text attribute. One handler instance per type serves every depth, mirroring the heading handler.

The layout manager's empty-line marker API is exercised by the orchestrator in #513.

🤖 Generated with Claude Code

wildseansy and others added 2 commits July 5, 2026 10:03
Introduces BlockType.ANCHORED (Android) and ENRMBlockTypePersistsWhenEmpty
(iOS) and routes the block store's adjust/normalize passes, the formatter's
zero-length anchor stamping, and the views' orphan-anchor prune through them
instead of heading-only checks. No behavior change — headings are the only
anchored type until the list block type lands on top.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
UNORDERED_LIST_ITEM and ORDERED_LIST_ITEM with 0-based nesting depth in the
range's level payload, joined to the anchored-type set. The store's
list-metadata pass clamps depths to valid ancestry (an item nests at most
one level under the previous adjacent item, so every state serializes) and
computes each ordered item's 1-based ordinal from its position among
adjacent same-depth, same-type siblings. One handler instance per type:
Android renders via LeadingMarginSpans (bullet dot/ring/square by depth;
right-aligned number for ordered) plus a LineHeightSpan for spacing; iOS
reserves the indent column via the paragraph style and draws the glyph or
number in the layout manager, with the ordinal stamped as a text attribute.
listItemSpacing prop spaces items on both platforms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant