Remove Cupertino chat transcript branches

Keep the existing Material transcript path while preserving public Cupertino parameters for callers. Narrow transcript tests to the Material-only behavior and remove Cupertino-only fixtures.
This commit is contained in:
2026-11-11 11:46:13 +00:00
parent 1c2bb8733a
commit fbe1928f59
52 changed files with 1524 additions and 2947 deletions
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
@@ -70,9 +69,8 @@ Future<void> _pump(WidgetTester tester) async {
Future<void> _host(
WidgetTester tester,
_Gateway gateway,
MemoryChatDraftStore drafts, {
bool cupertino = false,
}) async {
MemoryChatDraftStore drafts,
) async {
final thread = ChatThreadView(
gateway: gateway,
sessionId: 's',
@@ -80,42 +78,31 @@ Future<void> _host(
drafts: drafts,
newOperationId: () => 'op-new',
);
await tester.pumpWidget(
cupertino
? CupertinoApp(home: CupertinoPageScaffold(child: thread))
: MaterialApp(home: Scaffold(body: thread)),
);
await tester.pumpWidget(MaterialApp(home: Scaffold(body: thread)));
await _pump(tester);
}
Finder _state(String name) => find.byKey(Key('chat-delivery-$name'));
void main() {
for (final cupertino in [false, true]) {
testWidgets('a reload draws the server-queued prompts as Queued '
'($cupertino)', (tester) async {
final gateway = _Gateway()
..queue = [_prompt('op-1', 'First queued'), _prompt('op-2', 'Second')];
addTearDown(gateway.close);
await _host(
tester,
gateway,
MemoryChatDraftStore(),
cupertino: cupertino,
);
expect(find.text('First queued'), findsOneWidget);
expect(find.text('Second'), findsOneWidget);
expect(_state('queued'), findsNWidgets(2));
expect(find.byKey(const Key('chat-delivery-remove')), findsNWidgets(2));
// They follow the transcript: nothing queued has reached the harness.
expect(
tester.getTopLeft(find.text('First queued')).dy,
greaterThan(tester.getTopLeft(find.text('Working on it')).dy),
);
});
}
testWidgets('a reload draws the server-queued prompts as Queued', (
tester,
) async {
final gateway = _Gateway()
..queue = [_prompt('op-1', 'First queued'), _prompt('op-2', 'Second')];
addTearDown(gateway.close);
await _host(tester, gateway, MemoryChatDraftStore());
expect(find.text('First queued'), findsOneWidget);
expect(find.text('Second'), findsOneWidget);
expect(_state('queued'), findsNWidgets(2));
expect(find.byKey(const Key('chat-delivery-remove')), findsNWidgets(2));
// They follow the transcript: nothing queued has reached the harness.
expect(
tester.getTopLeft(find.text('First queued')).dy,
greaterThan(tester.getTopLeft(find.text('Working on it')).dy),
);
});
testWidgets('a delivered queued prompt enters the transcript as Sent', (
tester,
) async {