Files
pipelines/app/lib/features/chat/shell/chat_shell_output_view.dart
T
alan c5af000453 Terminal: text input for IMEs, Capture browser keys, touch key row
- Desktop and web terminals use the text-input path too, so IMEs, dead
  keys, the emoji picker and dictation work; the key handler still
  encodes special keys and chords first (handled keys are never typed
  again), composing text is drawn at the cursor and sent on commit, the
  platform editable sits at the cursor, and a closed input reopens on
  the next key. The editable terminal is a semantics text field so web
  typing also works with semantics on.
- Web: "Capture browser keys" (terminal menu and right-click menu) goes
  full screen and calls navigator.keyboard.lock(); hold Esc to leave.
  No-op where unsupported; cheatsheet and menu note give alternatives.
- Touch: scrollable key row with sticky Ctrl/Alt (tap once, double-tap
  lock), Esc, Tab, arrows, Home/End, PgUp/PgDn and symbols through the
  hardware encoder; soft keyboard types per key (delete detection,
  Return as Enter); the line field moves behind the row's Line button.
- Capture kit: compose=, --semantics false, --user-agent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:43:57 +00:00

62 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import '../conversation/chat_card_styles.dart';
import 'chat_shell_run.dart';
import 'chat_shell_runs_controller.dart';
import 'chat_shell_terminal_keys.dart';
import 'chat_shell_terminal_view.dart';
/// The output area of one command card: the run's terminal emulator, which
/// takes typing while the command runs (with the key toolbar below it), or
/// its retained output read-only once it ended.
class ChatShellOutputView extends StatelessWidget {
const ChatShellOutputView({
super.key,
required this.run,
required this.controller,
required this.viewKey,
required this.fullScreen,
});
final ChatShellRun run;
final ChatShellRunsController controller;
/// Replaced when the full-screen view closes, so the card's view sizes the
/// terminal to itself again.
final Key viewKey;
/// True while the full-screen view sizes the terminal.
final bool fullScreen;
@override
Widget build(BuildContext context) {
if (!run.running && run.output.isEmpty) {
return Text(
'No output.',
key: const Key('chat-shell-output-empty'),
style: chatCardSecondaryStyle(context),
);
}
final session = controller.terminals.session(run);
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
ChatShellTerminalView(
key: viewKey,
session: session,
autoResize: !fullScreen,
),
if (session.live && !fullScreen)
Padding(
padding: const EdgeInsets.only(top: 8),
child: ChatShellTerminalKeys(
session: session,
touch: chatShellTouchFirst(),
),
),
],
);
}
}