Fix web transcript cross-message selection

This commit is contained in:
2026-11-05 16:34:58 +00:00
parent 3a9ba55277
commit 9e7140449f
10 changed files with 929 additions and 117 deletions
@@ -5,11 +5,12 @@ import 'package:flutter/material.dart';
import 'chat_link_launcher.dart';
import 'chat_link_spans.dart';
import 'chat_links.dart';
import 'chat_transcript_selection.dart';
/// Plain selectable text with its bare links made tappable: the operator's
/// own message keeps every character exactly as typed (no markdown), and only
/// `http(s)://`/`www.` runs outside `` `code` `` become links. Text without a
/// link stays a plain [SelectableText].
/// link stays a plain [SelectableText] outside a shared transcript document.
class ChatLinkText extends StatefulWidget {
const ChatLinkText(this.text, {super.key});
@@ -40,7 +41,11 @@ class _ChatLinkTextState extends State<ChatLinkText> {
@override
Widget build(BuildContext context) {
final text = widget.text;
if (_found.isEmpty) return SelectableText(text);
if (_found.isEmpty) {
return ChatTranscriptSelectionScope.maybeOf(context) == null
? SelectableText(text)
: Text(text);
}
final spans = <InlineSpan>[];
var at = 0;
for (final link in _found) {