# Conflicts:
#	app/lib/features/chat/ui/transcript/chat_markdown_view.dart
This commit is contained in:
2026-11-21 17:11:45 +00:00
23 changed files with 1267 additions and 43 deletions
@@ -12,14 +12,18 @@ import 'chat_markdown.dart';
import 'chat_markdown_cache.dart';
import 'chat_markdown_speech.dart';
import 'chat_message_bubble.dart';
<<<<<<< HEAD
import '../../speech/speech.dart';
=======
import 'chat_table_column_width.dart';
>>>>>>> 059eb1bb0d6978e2caf9feb3545d40ee8242022e
/// Renders one assistant text part with native text widgets and the host's own
/// theme roles. Links (`http`, `https`, `mailto` and `www.` hosts only) open
/// through [onOpenLink] when given, else the [ChatLinkScope] launcher, which by
/// default opens them outside the app. No font family, size, colour or component
/// dimension is overridden; code keeps its exact whitespace and scrolls
/// sideways instead of widening the transcript.
/// sideways instead of widening the transcript, while table cells wrap.
class ChatMarkdownView extends StatefulWidget {
const ChatMarkdownView({
super.key,
@@ -227,24 +231,22 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
),
);
case MarkdownTable(header: final header, rows: final rows):
return ChatTranscriptHorizontalScrollView(
label: 'table',
child: Table(
defaultColumnWidth: const IntrinsicColumnWidth(),
border: TableBorder.all(color: _dividerColor(context)),
children: [
// Cells wrap to the transcript width; the table never scrolls sideways.
return Table(
defaultColumnWidth: ChatTableColumnWidth(header.length),
border: TableBorder.all(color: _dividerColor(context)),
children: [
TableRow(
decoration: BoxDecoration(color: _headerFill(context)),
children: [
for (final cell in header) _cell(context, cell, header: true),
],
),
for (final row in rows)
TableRow(
decoration: BoxDecoration(color: _headerFill(context)),
children: [
for (final cell in header) _cell(context, cell, header: true),
],
children: [for (final cell in row) _cell(context, cell)],
),
for (final row in rows)
TableRow(
children: [for (final cell in row) _cell(context, cell)],
),
],
),
],
);
case MarkdownCode(language: final language, code: final code):
_skipCodeBlock(code);