Merge branch 'worktree-agent-ad9ee94c5e17e5b87'
This commit is contained in:
@@ -96,6 +96,43 @@ class _ChatTranscriptSelectionAreaState
|
||||
);
|
||||
}
|
||||
|
||||
/// One transcript row's text, grouped into a single selectable of the
|
||||
/// transcript document.
|
||||
///
|
||||
/// The transcript's scroll view keeps its selectables in screen order, and
|
||||
/// re-merges them by comparing global transforms whenever rows scroll in.
|
||||
/// Without this group every text run of every mounted row is one of those
|
||||
/// selectables; with it the scroll view orders rows and each row orders only
|
||||
/// its own runs, once, when it mounts. Selection still spans rows, and copy
|
||||
/// concatenates rows in the same order as before.
|
||||
class ChatTranscriptRowSelection extends StatefulWidget {
|
||||
const ChatTranscriptRowSelection({super.key, required this.child});
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
State<ChatTranscriptRowSelection> createState() =>
|
||||
_ChatTranscriptRowSelectionState();
|
||||
}
|
||||
|
||||
class _ChatTranscriptRowSelectionState
|
||||
extends State<ChatTranscriptRowSelection> {
|
||||
final _delegate = StaticSelectionContainerDelegate();
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_delegate.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (ChatTranscriptSelectionScope.maybeOf(context) == null) {
|
||||
return widget.child;
|
||||
}
|
||||
return SelectionContainer(delegate: _delegate, child: widget.child);
|
||||
}
|
||||
}
|
||||
|
||||
/// Horizontal code/table viewports remain part of the transcript document.
|
||||
/// Flutter's nested scrollable treats an outside point as before its content
|
||||
/// if either coordinate is negative, and after it if either exceeds its size.
|
||||
|
||||
Reference in New Issue
Block a user