Refine mobile pane animation and preserve native Back

This commit is contained in:
2026-11-06 21:50:37 +00:00
7 changed files with 62 additions and 39 deletions
@@ -127,6 +127,12 @@ void main() {
await tester.tap(find.text('Chat a').first);
await tester.pumpAndSettle();
expect(find.byTooltip('Back').hitTestable(), findsOneWidget);
expect(
tester
.widget<BackButton>(find.byType(BackButton).hitTestable())
.onPressed,
isNull,
);
final stateA = tester.state(_thread('a'));
await tester.enterText(_input('a'), 'Phone draft A');
await tester.pumpAndSettle();
@@ -92,6 +92,17 @@ void main() {
final intermediate = tester.getSize(_rect(first)).height;
expect(intermediate, greaterThan(oldHeight));
expect(intermediate, lessThan((800 - 6) * .8));
// Content follows the animated viewport, rather than jumping to the
// target height and leaving a blank area during the transition.
expect(
tester.getSize(find.byKey(const ValueKey('a'))).height,
closeTo(intermediate, 1),
);
final shrinkingHeight = tester.getSize(_rect(second)).height;
expect(
tester.getSize(find.byKey(const ValueKey('b'))).height,
closeTo(shrinkingHeight < 300 ? 300 : shrinkingHeight, 1),
);
await tester.pumpAndSettle();
expect(controller.activePane?.sessionId, 'a');
expect(tester.getSize(_rect(first)).height, closeTo((800 - 6) * .8, 1));