Settle bottom-anchored restores, flush open timings in the probe, record numbers

This commit is contained in:
2026-11-02 00:55:03 +00:00
parent a5f0eb3811
commit c74065dc48
5 changed files with 123 additions and 33 deletions
@@ -5,6 +5,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:pipelines_app/application/app_route.dart';
import 'package:pipelines_app/application/app_router.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/chat/conversation/chat_transcript_scroll_view.dart';
import 'package:pipelines_app/features/chat/screen.dart';
import 'package:pipelines_app/shell/adaptive_shell.dart';
import 'package:pipelines_app/shell/destination.dart';
@@ -130,17 +131,16 @@ void main() {
reason: 'Use the stock Navigator Back action without a chat override',
);
final transcript = find.byKey(const ValueKey('chat-thread-s'));
final scroll = tester.widget<ListView>(transcript).controller!;
await tester.drag(
transcript,
Offset(0, scroll.position.maxScrollExtent + 500),
);
final scroll = tester
.widget<ChatTranscriptScrollView>(transcript)
.controller;
// A long transcript is bottom-anchored: older rows sit above offset 0.
final span =
scroll.position.maxScrollExtent - scroll.position.minScrollExtent;
await tester.drag(transcript, Offset(0, span + 500));
await tester.pumpAndSettle();
expect(scroll.offset, closeTo(scroll.position.minScrollExtent, 1));
await tester.drag(
transcript,
Offset(0, -scroll.position.maxScrollExtent - 500),
);
await tester.drag(transcript, Offset(0, -span - 500));
await tester.pumpAndSettle();
expect(scroll.offset, closeTo(scroll.position.maxScrollExtent, 1));
// A continuously animated processing control must not keep Back open.