feat(markdown): render list items as nested containers#694
Draft
remorses wants to merge 5 commits intoanomalyco:mainfrom
Draft
feat(markdown): render list items as nested containers#694remorses wants to merge 5 commits intoanomalyco:mainfrom
remorses wants to merge 5 commits intoanomalyco:mainfrom
Conversation
added 4 commits
February 16, 2026 14:21
…istency Extract createBlockRenderable() as a centralized dispatch method that maps token types to their corresponding renderables. This replaces the scattered if/else logic in createDefaultRenderable(). Also extract getBlockMarginBottom() helper to replace repeated ternary expressions, and fix a bug where marginBottom was not being updated when tokens were unchanged (the fast paths in updateBlocks for same-reference and same-raw tokens now properly set marginBottom on the existing renderable).
When createBlockRenderable is called for nested content (e.g. inside blockquote children), space tokens should produce a visible renderable rather than returning null. The top-level createDefaultRenderable still filters out space tokens for block-level rendering.
Replace flat text chunk rendering of lists with BoxRenderable containers.
Each list becomes a column box containing item boxes. The first inline
text stays on the marker line ('- Item text'), and remaining child tokens
(nested lists, code blocks) are added as children with marginLeft: 2
for visual indentation.
Supports:
- Nested unordered/ordered lists
- Task list checkboxes ([ ] and [x])
- Code blocks inside list items
- Any block content inside list items via createBlockRenderable
Removes the old renderListChunks method and adds createListRenderable.
Updates updateBlockRenderable and rerenderBlocks to handle list type
by removing and reinserting (since container structure changes).
…ndering Add two comprehensive snapshot tests: - llm-style response mixing quotes, nested lists, hr, and paragraphs - complex markdown document with nested lists inside blockquotes, task lists, tables, code blocks, links, and multiple quote blocks These catch regressions in the interaction between all the new container-based rendering for lists and blockquotes. Also fix comment wording and snapshot whitespace.
@opentui/core
@opentui/react
@opentui/solid
@opentui/core-darwin-arm64
@opentui/core-darwin-x64
@opentui/core-linux-arm64
@opentui/core-linux-x64
@opentui/core-win32-arm64
@opentui/core-win32-x64
commit: |
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.
Split from #597 to make review easier. Depends on #692.
Replaces flat text chunk list rendering with BoxRenderable containers. Each list item gets its own box, with the first inline text on the marker line and remaining child tokens (nested lists, code blocks) as indented children. Supports nested lists, task checkboxes, and code blocks inside list items.