Keep enlarged chat header controls reachable in short viewports

This commit is contained in:
2026-11-07 20:50:30 +00:00
parent 4bbbe01633
commit cb0942b5ee
2 changed files with 60 additions and 16 deletions
@@ -38,6 +38,47 @@ void _useNarrowText(WidgetTester tester) {
}
void main() {
testWidgets('short large-text header scrolls controls without overflow', (
tester,
) async {
_useNarrowText(tester);
await tester.pumpWidget(
_host(
Align(
alignment: Alignment.topLeft,
child: SizedBox(
width: 320,
height: 100,
child: ChatThreadHeader(
title: _title,
folder: 'demo',
onInfo: () {},
showBack: true,
onBack: () {},
controls: [
TextButton(
onPressed: () {},
child: const Text('Current model'),
),
TextButton(
onPressed: () {},
child: const Text('Ask for permission'),
),
],
),
),
),
cupertino: false,
),
);
await tester.pumpAndSettle();
expect(tester.takeException(), isNull);
await tester.ensureVisible(find.text('Ask for permission'));
await tester.pumpAndSettle();
expect(find.text('Ask for permission').hitTestable(), findsOneWidget);
expect(tester.takeException(), isNull);
});
for (final cupertino in [false, true]) {
final host = cupertino ? 'Cupertino' : 'Material';