fix(MarkdownText): Pass necessary context to improve markdown rendering accuracy - #673
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves Compose markdown rendering by propagating viewport/streaming/run-request context into list rendering and ensuring block-level nodes inside list items (e.g., fenced code blocks) are rendered through the normal block dispatch path.
Changes:
- Pass
viewportTopY,isStreaming,onRunRequest, andmessageIdthrough bullet/ordered list rendering to list items. - Render block-level content (fenced code blocks, block quotes, tables) found inside list items via
renderSingleNode.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…tate - Allows rendering components to receive necessary context for streaming. - Integrates support for run requests and message identification into render nodes. - Ensures consistent state flow across list and block element rendering.
haiphucnguyen
force-pushed
the
feature/fix-rendering-markdown-issue
branch
from
August 25, 2026 01:27
06a6c30 to
9076810
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MarkdownText.kt:513
renderListItemsplitsListItemchildren intoinlineContentandblockContentand then renders all inline content before all block content. This can reorder markdown when a list item contains multiple blocks (e.g., Paragraph → FencedCodeBlock → Paragraph): the second paragraph will be rendered before the code block. Consider iterating the list-item children in a single pass and rendering each node in sequence (prefixing the marker only for the first inline/paragraph line) to preserve document order.
var child = item.firstChild
while (child != null) {
when (child) {
is BulletList, is OrderedList, is FencedCodeBlock, is BlockQuote, is TableBlock -> blockContent.add(child)
else -> inlineContent.add(child)
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.
Screenshot:
