feat(app): chat sections are clear collapsible dividers; closed chats start collapsed

This commit is contained in:
2026-10-24 00:22:18 +01:00
parent d0b1c8e524
commit 1e55b8d2b3
16 changed files with 293 additions and 161 deletions
@@ -35,9 +35,7 @@ JsonMap tallPage() => chatPage([
]);
ScrollController transcriptScroll(WidgetTester tester) =>
tester
.widget<ListView>(find.byKey(const Key('chat-thread-s')))
.controller!;
tester.widget<ListView>(find.byKey(const Key('chat-thread-s'))).controller!;
void main() {
testWidgets('a streaming transcript stays pinned to its newest end', (
@@ -62,7 +60,9 @@ void main() {
// A new message and further deltas grow the turn; every frame keeps the
// newest end visible without an animation the operator has to chase.
gateway.emitEvent(chatTextFrame('One streamed paragraph. ', messageId: 'live'));
gateway.emitEvent(
chatTextFrame('One streamed paragraph. ', messageId: 'live'),
);
await tester.pump();
await tester.pump();
gateway.emitEvent(chatTextFrame('And another delta. ', messageId: 'live'));
@@ -115,19 +115,15 @@ void main() {
// The operator's position is not moved by an arrival; only the
// control's count changes.
expect(scroll.position.pixels, closeTo(releasedAt, 0.5));
expect(
find.text('Jump to latest · 1 new message'),
findsOneWidget,
);
expect(find.text('Jump to latest · 1 new message'), findsOneWidget);
gateway.emitEvent(chatTextFrame('A second answer. ', messageId: 'live-2'));
gateway.emitEvent(
chatTextFrame('A second answer. ', messageId: 'live-2'),
);
await tester.pump();
await tester.pump();
expect(scroll.position.pixels, closeTo(releasedAt, 0.5));
expect(
find.text('Jump to latest · 2 new messages'),
findsOneWidget,
);
expect(find.text('Jump to latest · 2 new messages'), findsOneWidget);
if (cupertino) {
// The affordance is a standard Cupertino control; no Material