Skip to content

feat(ai-chat): render Markdown while assistant replies stream#1919

Merged
datlechin merged 3 commits into
TableProApp:mainfrom
byteoxo:ai-chat
Jul 21, 2026
Merged

feat(ai-chat): render Markdown while assistant replies stream#1919
datlechin merged 3 commits into
TableProApp:mainfrom
byteoxo:ai-chat

Conversation

@byteoxo

@byteoxo byteoxo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

AI Chat now renders Markdown while the assistant reply is still streaming, instead of showing raw text until the turn finishes. Existing code-block actions (Copy / Insert) and the rest of the chat UI stay the same.

What's included

  • Stream assistant text through MarkdownView for the full reply, not only after isStreaming clears
  • Keep unclosed fenced code blocks ( /~~~`) as open code blocks while tokens arrive, then mark them closed when the fence completes
  • During streaming, render code with a lightweight monospaced view so Copy / Insert stay available without rebuilding SourceEditor on every chunk
  • After the stream ends, switch code blocks to the existing syntax-highlighted editor
  • Throttle re-parses (~48ms) while streaming and flush immediately when the stream completes
  • Unit tests for open/closed fences, partial tables, headers/lists, and fence length matching
  • CHANGELOG entry under [Unreleased]

Testing

  • Unit: TableProTests/MarkdownBlockParserTests
  • Unit: TableProTests/AIChatCodeBlockDetectionTests
  • Manual: ask the model for a full Markdown sample (headings, bold/italic, lists, blockquotes, tables, thematic breaks, fenced code) and confirm progressive rendering while tokens stream
  • Manual: open SQL/JS code blocks mid-stream still show as code blocks before the closing fence
  • Manual: Copy and Insert on streaming and completed code blocks still work
  • Manual: stream completion does not leave raw Markdown or a broken code-block chrome

@datlechin
datlechin merged commit 33e5c03 into TableProApp:main Jul 21, 2026
2 checks passed
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