feat: added markdown rendering - #76
Merged
Merged
Conversation
Co-authored-by: Justin Wilkin <justin@entr.net.au>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds terminal markdown rendering for finalized agent output in the Forge TUI, using a new wrapper around charmbracelet/glamour and integrating it into the message commit path so rendered content reflows on resize.
Changes:
- Introduces
pkg/executor/tui/markdownrenderer package (plus unit tests) to render markdown to ANSI with width-aware reflow. - Switches finalized agent messages (and loop-breaking full-inline tool results) to use markdown rendering via
DisplayMessage.RenderFn. - Updates Go dependencies and adds product/ADR documentation for the feature.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/executor/tui/result_display.go | Exposes loop-breaking tool classification for downstream rendering decisions. |
| pkg/executor/tui/model.go | Adds mdRenderer to the TUI model. |
| pkg/executor/tui/messages.go | Adds newMarkdownMsg helper for width-aware render closures. |
| pkg/executor/tui/markdown/markdown.go | Implements markdown rendering (glamour) + code-block post-processing + render caching. |
| pkg/executor/tui/markdown/markdown_test.go | Adds unit tests for renderer behavior and width fallback. |
| pkg/executor/tui/init.go | Initializes mdRenderer in initialModel(). |
| pkg/executor/tui/events.go | Renders finalized agent messages (and loop-breaking tool results) using markdown renderer closures. |
| go.mod | Bumps lipgloss and adds glamour + related indirect deps. |
| go.sum | Updates sums for new/updated dependencies. |
| docs/product/features/tui-markdown-rendering.md | Adds PRD-style documentation for markdown rendering feature. |
| docs/adr/0054-tui-markdown-rendering.md | Adds ADR describing the markdown rendering approach. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…` and promote indirect deps to direct Co-authored-by: Justin Wilkin <justin@entr.net.au>
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.
No description provided.