Open the on-screen keyboard for terminals on phones

On Android and iOS a tap on a terminal (a chat command card or the terminal
panel) now opens the soft keyboard and typing goes to the process, with no
autocorrect. Desktop keeps raw key events. Desktop keyboard tests now run
as macOS, since tests default to Android.
This commit is contained in:
2026-11-10 00:19:46 +00:00
parent 750071abe1
commit b44938d028
4 changed files with 287 additions and 217 deletions
@@ -122,6 +122,29 @@ void main() {
expect(tester.widget<TextField>(field).controller!.text, isEmpty);
});
testWidgets(
'tapping the terminal on a phone opens the keyboard and typing reaches '
'the process',
(tester) async {
await openRunning(tester, output: 'Paste your token: ');
expect(tester.testTextInput.isVisible, isFalse);
await tester.tap(find.byType(TerminalView));
await tester.pump();
expect(tester.testTextInput.isVisible, isTrue);
expect(tester.testTextInput.hasAnyClients, isTrue);
gateway.calls.clear();
tester.testTextInput.enterText('tok');
await tester.pump();
await tester.testTextInput.receiveAction(TextInputAction.newline);
await tester.pump();
expect(typed(), startsWith('tok'));
// Close the keyboard connection before the tree goes away.
await tester.pumpWidget(const SizedBox.shrink());
await tester.pump(const Duration(seconds: 1));
},
variant: TargetPlatformVariant.only(TargetPlatform.android),
);
testWidgets('a running terminal is resized to its view; a finished one is '
'read-only', (tester) async {
await openRunning(tester, output: 'working\r\n');