Rebuild only the live chat turn while replies stream

Reuse unchanged transcript rows, the composer bar and the header across
streamed deltas, and share parsed markdown by text so rows scrolled back
into view are not parsed again. Adds a rebuild/parse harness and a
release-web frame-timing probe with a long-transcript fixture.
This commit is contained in:
2026-11-01 23:41:34 +00:00
parent bdf70af7e8
commit 20bf6202b3
10 changed files with 722 additions and 63 deletions
@@ -6,6 +6,7 @@ import 'package:flutter/semantics.dart';
import '../../../../ui/adaptive/host.dart';
import '../sessions/chat_adaptive.dart';
import 'chat_markdown.dart';
import 'chat_markdown_cache.dart';
import 'chat_message_bubble.dart';
/// Renders one assistant text part with native text widgets and the host's own
@@ -68,7 +69,7 @@ class _ChatMarkdownViewState extends State<ChatMarkdownView> {
final cupertino =
chatControlsStyleOf(context) == ChatControlsStyle.cupertino;
final gap = chatParagraphGap(context);
final blocks = parseMarkdown(widget.text);
final blocks = chatMarkdownCache.blocksFor(widget.text);
return _rendered = _selectable(
context,
Column(