Skip to content

fix: improve TUI markdown rendering#183

Merged
jy-tan merged 2 commits into
mainfrom
agent-text-apply-markdown-formatting
Mar 7, 2026
Merged

fix: improve TUI markdown rendering#183
jy-tan merged 2 commits into
mainfrom
agent-text-apply-markdown-formatting

Conversation

@jy-tan
Copy link
Copy Markdown
Contributor

@jy-tan jy-tan commented Mar 6, 2026

Summary

Improve agent message rendering in the setup UI by adding Markdown-based formatting in TUI, avoiding headless Markdown rendering overhead, and preventing broken mailto: artifacts for emails and Git remotes.

Changes

  • add shared renderAgentMessage helper for rendering agent text with Markdown in TUI
  • sanitize scp-style Git remotes and plain emails before rendering to prevent mailto: autolink artifacts
  • add regression tests to verify rendered output does not include mailto: for those patterns
  • keep headless mode plain/wrapped text only (no glamour rendering) for predictable low-overhead output
  • update Markdown link styling to use Tusk theme accent color (styles.PrimaryColor) with underline so links are readable in both dark and light backgrounds

@jy-tan jy-tan requested a review from sohil-kshirsagar March 6, 2026 23:58
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/agent/markdown_render.go">

<violation number="1" location="internal/agent/markdown_render.go:24">
P2: Fallback wrapping uses the markdown-sanitized string, so headless/plain output can contain literal backticks. Preserve and wrap the original input text in the fallback path.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/agent/markdown_render.go
@jy-tan jy-tan merged commit 43b3f54 into main Mar 7, 2026
13 checks passed
@jy-tan jy-tan deleted the agent-text-apply-markdown-formatting branch March 7, 2026 01:32
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