Skip to content

TUI - enable segmented markdown rendering - #3851

Merged
dgageot merged 1 commit into
docker:mainfrom
krissetto:tui-progressive-markdown
Jul 27, 2026
Merged

TUI - enable segmented markdown rendering#3851
dgageot merged 1 commit into
docker:mainfrom
krissetto:tui-progressive-markdown

Conversation

@krissetto

Copy link
Copy Markdown
Contributor

This change lets streaming consumers receive Markdown output as two sections: completed top-level blocks that can be retained, and the trailing block that may still change as new text arrives.

The existing renderer already avoided reparsing completed blocks. This change will enable us to avoid repeatedly joining, scanning, splitting, and styling the full rendered response.

The renderer remains conservative around unfinished or context-sensitive Markdown, and tests compare every intermediate result with the result of rendering the complete accumulated response from scratch.

This PR enables a subsequent change, where transcript and viewport code retain the completed rendered lines and replace only the changing tail. It will not bring any noticeable performance improvements on its own

@krissetto
krissetto requested a review from a team as a code owner July 27, 2026 14:05

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟡 NEEDS ATTENTION

Lower-confidence findings (not posted inline)

  • [low] pkg/tui/components/markdown/incremental.go:317 — renderPlainParagraph tail-render fallback leaves plainInputPrefix advanced while block-level state reflects full render (confidence: weak 52/100)

Comment thread pkg/tui/components/markdown/incremental.go Outdated
Comment thread pkg/tui/components/markdown/incremental.go Outdated
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 27, 2026
@krissetto
krissetto force-pushed the tui-progressive-markdown branch from b8e50ba to 48a26af Compare July 27, 2026 15:11
Sayt-0
Sayt-0 previously approved these changes Jul 27, 2026

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The segmented rendering design is sound and well-tested. One minor stats-accounting issue was found in the error-fallback path.

Comment thread pkg/tui/components/markdown/incremental.go Outdated
@krissetto
krissetto force-pushed the tui-progressive-markdown branch from 6f87fbb to 6bec609 Compare July 27, 2026 15:55
@dgageot
dgageot merged commit d95aa23 into docker:main Jul 27, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants