Merge branch 'worktree-agent-ad9ee94c5e17e5b87'

This commit is contained in:
2026-11-22 18:24:30 +00:00
3 changed files with 83 additions and 17 deletions
@@ -1,6 +1,7 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/chat/conversation/chat_thread_view.dart';
@@ -76,6 +77,32 @@ void main() {
tester.getTopLeft(find.text('Second question')).dy,
lessThan(tester.getTopLeft(find.text('Last answer.')).dy),
);
// Each row is one selectable of the scroll view's document: its text
// registers with the row's container, so scrolling re-sorts rows
// rather than every text run of the transcript.
SelectionRegistrar? registrar(String text) =>
SelectionContainer.maybeOf(tester.element(find.text(text).first));
SelectionContainerDelegate? rowDelegate(String text) => tester
.widget<SelectionContainer>(
find
.descendant(
of: find.ancestor(
of: find.text(text).first,
matching: find.byType(ChatTranscriptRowSelection),
),
matching: find.byType(SelectionContainer),
)
.first,
)
.delegate;
for (final text in ['Second question', 'Last answer.']) {
expect(registrar(text), isNotNull);
expect(registrar(text), same(rowDelegate(text)));
}
expect(
registrar('Second question'),
isNot(same(registrar('Last answer.'))),
);
final composer = find.descendant(
of: find.byKey(const ValueKey('chat-composer-s')),
matching: find.byType(EditableText),