refactor: Use MarkdownContentView in rich chat bubbles

Replace inline AttributedString(markdown:) in RichMessageBubble with
the shared MarkdownContentView for consistent styled rendering of
headers, lists, blockquotes, and inline formatting in chat messages.
Code blocks continue to use CodeBlockView with its copy button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alan Wizemann
2026-04-09 00:13:17 -04:00
parent 66d04d838d
commit 521c6d63fc
@@ -76,13 +76,7 @@ struct RichMessageBubble: View {
ForEach(Array(blocks.enumerated()), id: \.offset) { _, block in ForEach(Array(blocks.enumerated()), id: \.offset) { _, block in
switch block { switch block {
case .text(let text): case .text(let text):
if let attributed = try? AttributedString(markdown: text, options: .init(interpretedSyntax: .inlineOnlyPreservingWhitespace)) { MarkdownContentView(content: text)
Text(attributed)
.textSelection(.enabled)
} else {
Text(text)
.textSelection(.enabled)
}
case .code(let code, let language): case .code(let code, let language):
CodeBlockView(code: code, language: language) CodeBlockView(code: code, language: language)
} }