Skip to content

fix(MarkdownText): Pass necessary context to improve markdown rendering accuracy - #673

Merged
haiphucnguyen merged 2 commits into
mainfrom
feature/fix-rendering-markdown-issue
Aug 25, 2026
Merged

fix(MarkdownText): Pass necessary context to improve markdown rendering accuracy#673
haiphucnguyen merged 2 commits into
mainfrom
feature/fix-rendering-markdown-issue

Conversation

@haiphucnguyen

Copy link
Copy Markdown
Collaborator
  • Enables accurate rendering based on viewport position.
  • Allows rendering logic to handle streaming and run request states.
  • Addresses rendering issues in dynamic environments.

Screenshot:
Screenshot 2026-08-24 at 5 47 58 PM

Copilot AI lite review requested due to automatic review settings August 25, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and messageId through 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.

Comment thread desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MarkdownText.kt Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MarkdownText.kt Outdated
Comment thread desktop-shared/src/main/kotlin/io/askimo/ui/common/ui/MarkdownText.kt Outdated
…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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • renderListItem splits ListItem children into inlineContent and blockContent and 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)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@haiphucnguyen
haiphucnguyen merged commit 483f4c1 into main Aug 25, 2026
11 checks passed
@haiphucnguyen
haiphucnguyen deleted the feature/fix-rendering-markdown-issue branch August 25, 2026 01:45
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.

2 participants