feat(app): render markdown in chat messages and artifact previews

This commit is contained in:
2026-10-22 00:26:36 +01:00
parent 0e323dde10
commit dc6b963170
8 changed files with 926 additions and 12 deletions
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import '../../../core/api_gateway.dart';
import '../domain/chat_transcript.dart';
import '../ui/sessions/chat_adaptive.dart';
import '../ui/transcript/chat_markdown_view.dart';
import '../ui/transcript/chat_message_view.dart';
import 'chat_composer_bar.dart';
import 'chat_composer_controller.dart';
@@ -16,6 +17,10 @@ import 'chat_thread_controller.dart';
/// One read-only conversation: the controller's transcript in the order the
/// server reports it, rendered by the existing [ChatMessageView].
///
/// Assistant text goes through [ChatMarkdownView]'s builder, so stored and live
/// prose share the supported markdown subset. User text keeps the server's exact
/// characters, and reasoning/tool disclosures stay plain text.
///
/// History and live-subscription failures are separate notices: readable stored
/// history must never hide a refused live watch. The shell owns the navigation
/// bar, so this view adds only its own Back control and content.
@@ -237,7 +242,10 @@ class _ChatThreadViewState extends State<ChatThreadView> {
Padding(
key: ValueKey<String>(keys[index]),
padding: const EdgeInsets.symmetric(horizontal: 16),
child: ChatMessageView(row: rows[index]),
child: ChatMessageView(
row: rows[index],
textBuilder: chatMarkdownText,
),
),
if (_controller.running)
Padding(