diff --git a/app/lib/features/chat/conversation/chat_composer_bar.dart b/app/lib/features/chat/conversation/chat_composer_bar.dart index 6e10357e..e755844b 100644 --- a/app/lib/features/chat/conversation/chat_composer_bar.dart +++ b/app/lib/features/chat/conversation/chat_composer_bar.dart @@ -831,8 +831,7 @@ class _ChatComposerBarState extends State { // inside the glass with the field, as one floating composer; only the // command palette, a separate menu, floats above it. final extras = [ - if (chatDraftIsShell(composer.draft)) - ChatShellModeIndicator(cupertino: false), + if (chatDraftIsShell(composer.draft)) ChatShellModeIndicator(), if (!_attachments.isEmpty) _attachmentStrip(context), if (_uploading) _notice( diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index 35abf0e4..034787b6 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -1475,12 +1475,7 @@ class _ChatThreadViewState extends State { ); void _runShellFromMenu() => unawaited( - runChatShellFromMenu( - context, - _shellRuns, - cupertino: false, - showNotice: _showCommandNotice, - ), + runChatShellFromMenu(context, _shellRuns, showNotice: _showCommandNotice), ); void _dismissFinishedShellRuns() => unawaited( @@ -1488,7 +1483,6 @@ class _ChatThreadViewState extends State { context, _shellRuns, _shellRuns.finishedIds, - cupertino: false, onRefused: (refusal) => _showCommandNotice( "Couldn't dismiss the commands: $refusal", failed: true, diff --git a/app/lib/features/chat/shell/chat_shell_card_actions.dart b/app/lib/features/chat/shell/chat_shell_card_actions.dart index 4d62e5c3..934bf8ed 100644 --- a/app/lib/features/chat/shell/chat_shell_card_actions.dart +++ b/app/lib/features/chat/shell/chat_shell_card_actions.dart @@ -22,13 +22,11 @@ class ChatShellCardActions extends StatefulWidget { super.key, required this.run, required this.controller, - required this.cupertino, required this.onFullScreen, }); final ChatShellRun run; final ChatShellRunsController controller; - final bool cupertino; final VoidCallback onFullScreen; @override diff --git a/app/lib/features/chat/shell/chat_shell_dismiss.dart b/app/lib/features/chat/shell/chat_shell_dismiss.dart index f4dbf219..082f4377 100644 --- a/app/lib/features/chat/shell/chat_shell_dismiss.dart +++ b/app/lib/features/chat/shell/chat_shell_dismiss.dart @@ -10,13 +10,8 @@ const String chatShellDismissAllLabel = 'Dismiss all finished commands'; /// The card's Dismiss button, offered once the command has finished. class ChatShellDismissButton extends StatelessWidget { - const ChatShellDismissButton({ - super.key, - required this.cupertino, - required this.onPressed, - }); + const ChatShellDismissButton({super.key, required this.onPressed}); - final bool cupertino; final VoidCallback onPressed; @override @@ -48,7 +43,6 @@ Future dismissChatShellRuns( BuildContext context, ChatShellRunsController controller, List ids, { - required bool cupertino, void Function(String refusal)? onRefused, }) async { if (ids.isEmpty) return; diff --git a/app/lib/features/chat/shell/chat_shell_history_chip.dart b/app/lib/features/chat/shell/chat_shell_history_chip.dart index ea279b42..430cc9eb 100644 --- a/app/lib/features/chat/shell/chat_shell_history_chip.dart +++ b/app/lib/features/chat/shell/chat_shell_history_chip.dart @@ -36,7 +36,7 @@ class ChatShellHistoryChip extends StatelessWidget { ); } - Future _open(BuildContext context, bool cupertino) { + Future _open(BuildContext context, bool _) { // A dialog in the tiled app on a wide layout. A phone keeps the // full-screen page, and a floating window opens it as a page of that // window, so what it opens next (a diff, a command's output) stays in diff --git a/app/lib/features/chat/shell/chat_shell_history_output_page.dart b/app/lib/features/chat/shell/chat_shell_history_output_page.dart index 451c18d1..37ae53fe 100644 --- a/app/lib/features/chat/shell/chat_shell_history_output_page.dart +++ b/app/lib/features/chat/shell/chat_shell_history_output_page.dart @@ -17,13 +17,9 @@ Future openChatShellHistoryOutput( BuildContext context, { required ChatShellRunsController controller, required String runId, - required bool cupertino, }) { - Widget page(BuildContext _) => ChatShellHistoryOutputPage( - controller: controller, - runId: runId, - cupertino: cupertino, - ); + Widget page(BuildContext _) => + ChatShellHistoryOutputPage(controller: controller, runId: runId); return Navigator.push(context, MaterialPageRoute(builder: page)); } @@ -35,12 +31,10 @@ class ChatShellHistoryOutputPage extends StatefulWidget { super.key, required this.controller, required this.runId, - required this.cupertino, }); final ChatShellRunsController controller; final String runId; - final bool cupertino; @override State createState() => @@ -138,7 +132,7 @@ class _ChatShellHistoryOutputPageState runSpacing: 4, crossAxisAlignment: WrapCrossAlignment.center, children: [ - ChatShellStatus(run: full, cupertino: false), + ChatShellStatus(run: full), if (full.directory.isNotEmpty) Text( full.directory, @@ -154,11 +148,7 @@ class _ChatShellHistoryOutputPageState key: const Key('chat-shell-output-empty'), style: chatCardSecondaryStyle(context, false), ) - : ChatShellTerminalView( - session: session, - cupertino: false, - fill: true, - ), + : ChatShellTerminalView(session: session, fill: true), ), const SizedBox(height: 8), ListenableBuilder( diff --git a/app/lib/features/chat/shell/chat_shell_history_view.dart b/app/lib/features/chat/shell/chat_shell_history_view.dart index 544f3119..eaccb238 100644 --- a/app/lib/features/chat/shell/chat_shell_history_view.dart +++ b/app/lib/features/chat/shell/chat_shell_history_view.dart @@ -118,7 +118,7 @@ class _ChatShellHistoryViewState extends State { runSpacing: 4, crossAxisAlignment: WrapCrossAlignment.center, children: [ - ChatShellStatus(run: run, cupertino: false), + ChatShellStatus(run: run), Text(chatShellRunTime(context, run.startedAt), style: secondary), if (run.purged) Text(chatShellOutputNotKept, style: secondary), if (refusal != null) @@ -151,7 +151,6 @@ class _ChatShellHistoryViewState extends State { context, controller: widget.controller, runId: run.id, - cupertino: false, ), ), ); diff --git a/app/lib/features/chat/shell/chat_shell_mode_indicator.dart b/app/lib/features/chat/shell/chat_shell_mode_indicator.dart index 5560fd41..bed86ad3 100644 --- a/app/lib/features/chat/shell/chat_shell_mode_indicator.dart +++ b/app/lib/features/chat/shell/chat_shell_mode_indicator.dart @@ -6,9 +6,7 @@ import 'chat_shell_command.dart'; /// Shown inside the composer while its draft starts with `!`: the draft is a /// shell command for this chat's folder, not a message to the agent. class ChatShellModeIndicator extends StatelessWidget { - const ChatShellModeIndicator({super.key, required this.cupertino}); - - final bool cupertino; + const ChatShellModeIndicator({super.key}); @override Widget build(BuildContext context) { diff --git a/app/lib/features/chat/shell/chat_shell_output_view.dart b/app/lib/features/chat/shell/chat_shell_output_view.dart index ccc44e50..97925d1b 100644 --- a/app/lib/features/chat/shell/chat_shell_output_view.dart +++ b/app/lib/features/chat/shell/chat_shell_output_view.dart @@ -14,14 +14,12 @@ class ChatShellOutputView extends StatelessWidget { super.key, required this.run, required this.controller, - required this.cupertino, required this.viewKey, required this.fullScreen, }); final ChatShellRun run; final ChatShellRunsController controller; - final bool cupertino; /// Replaced when the full-screen view closes, so the card's view sizes the /// terminal to itself again. @@ -47,7 +45,6 @@ class ChatShellOutputView extends StatelessWidget { ChatShellTerminalView( key: viewKey, session: session, - cupertino: false, autoResize: !fullScreen, ), if (session.live && !fullScreen) @@ -55,7 +52,6 @@ class ChatShellOutputView extends StatelessWidget { padding: const EdgeInsets.only(top: 8), child: ChatShellTerminalKeys( session: session, - cupertino: false, field: chatShellTouchFirst(), ), ), diff --git a/app/lib/features/chat/shell/chat_shell_run_card.dart b/app/lib/features/chat/shell/chat_shell_run_card.dart index 4bc16a94..7b1d1702 100644 --- a/app/lib/features/chat/shell/chat_shell_run_card.dart +++ b/app/lib/features/chat/shell/chat_shell_run_card.dart @@ -46,7 +46,6 @@ class _ChatShellRunCardState extends State { context, controller: widget.controller, runId: widget.runId, - cupertino: false, ); if (!mounted) return; setState(() { @@ -113,15 +112,12 @@ class _ChatShellRunCardState extends State { ), ), const SizedBox(width: 8), - ChatShellStatus(run: run, cupertino: false), + ChatShellStatus(run: run), if (!run.running) ChatShellDismissButton( - cupertino: false, onPressed: () => unawaited( // A refusal brings the card back with the server's reason. - dismissChatShellRuns(context, controller, [ - run.id, - ], cupertino: false), + dismissChatShellRuns(context, controller, [run.id]), ), ), ], @@ -130,7 +126,6 @@ class _ChatShellRunCardState extends State { ChatShellOutputView( run: run, controller: controller, - cupertino: false, viewKey: ValueKey(_viewGeneration), fullScreen: _fullScreen, ), @@ -146,7 +141,6 @@ class _ChatShellRunCardState extends State { ChatShellCardActions( run: run, controller: controller, - cupertino: false, onFullScreen: () => _openFullScreen(), ), if (error != null) diff --git a/app/lib/features/chat/shell/chat_shell_run_dialog.dart b/app/lib/features/chat/shell/chat_shell_run_dialog.dart index d07ce11e..d1ee752f 100644 --- a/app/lib/features/chat/shell/chat_shell_run_dialog.dart +++ b/app/lib/features/chat/shell/chat_shell_run_dialog.dart @@ -5,18 +5,14 @@ import 'chat_shell_command.dart'; /// The chat actions menu's "Run command…": a small host dialog with one /// command field. Returns the trimmed command, or null when cancelled. -Future showChatShellRunDialog( - BuildContext context, { - required bool cupertino, -}) => showDialog( - context: context, - builder: (_) => const ChatShellRunDialog(cupertino: false), -); +Future showChatShellRunDialog(BuildContext context) => + showDialog( + context: context, + builder: (_) => const ChatShellRunDialog(), + ); class ChatShellRunDialog extends StatefulWidget { - const ChatShellRunDialog({super.key, required this.cupertino}); - - final bool cupertino; + const ChatShellRunDialog({super.key}); @override State createState() => _ChatShellRunDialogState(); diff --git a/app/lib/features/chat/shell/chat_shell_status.dart b/app/lib/features/chat/shell/chat_shell_status.dart index 6f99ab5e..3f35b420 100644 --- a/app/lib/features/chat/shell/chat_shell_status.dart +++ b/app/lib/features/chat/shell/chat_shell_status.dart @@ -8,14 +8,9 @@ import 'chat_shell_run.dart'; /// while it runs, then a status chip (exit code, stopped, interrupted) with /// how long it ran. The words carry the state; colour only repeats it. class ChatShellStatus extends StatelessWidget { - const ChatShellStatus({ - super.key, - required this.run, - required this.cupertino, - }); + const ChatShellStatus({super.key, required this.run}); final ChatShellRun run; - final bool cupertino; @override Widget build(BuildContext context) { diff --git a/app/lib/features/chat/shell/chat_shell_terminal_keys.dart b/app/lib/features/chat/shell/chat_shell_terminal_keys.dart index 191402c2..fdd3e9fa 100644 --- a/app/lib/features/chat/shell/chat_shell_terminal_keys.dart +++ b/app/lib/features/chat/shell/chat_shell_terminal_keys.dart @@ -71,12 +71,10 @@ class ChatShellTerminalKeys extends StatefulWidget { const ChatShellTerminalKeys({ super.key, required this.session, - required this.cupertino, required this.field, }); final ChatShellTerminalSession session; - final bool cupertino; final bool field; @override diff --git a/app/lib/features/chat/shell/chat_shell_terminal_page.dart b/app/lib/features/chat/shell/chat_shell_terminal_page.dart index 8814741f..1f1a9023 100644 --- a/app/lib/features/chat/shell/chat_shell_terminal_page.dart +++ b/app/lib/features/chat/shell/chat_shell_terminal_page.dart @@ -12,13 +12,9 @@ Future openChatShellTerminalPage( BuildContext context, { required ChatShellRunsController controller, required String runId, - required bool cupertino, }) { - Widget page(BuildContext _) => ChatShellTerminalPage( - controller: controller, - runId: runId, - cupertino: cupertino, - ); + Widget page(BuildContext _) => + ChatShellTerminalPage(controller: controller, runId: runId); return Navigator.push(context, MaterialPageRoute(builder: page)); } @@ -27,12 +23,10 @@ class ChatShellTerminalPage extends StatelessWidget { super.key, required this.controller, required this.runId, - required this.cupertino, }); final ChatShellRunsController controller; final String runId; - final bool cupertino; @override Widget build(BuildContext context) { @@ -58,7 +52,6 @@ class ChatShellTerminalPage extends StatelessWidget { Expanded( child: ChatShellTerminalView( session: session, - cupertino: false, fill: true, autofocus: true, ), @@ -68,7 +61,6 @@ class ChatShellTerminalPage extends StatelessWidget { padding: const EdgeInsets.only(top: 8), child: ChatShellTerminalKeys( session: session, - cupertino: false, field: chatShellTouchFirst(), ), ), diff --git a/app/lib/features/chat/shell/chat_shell_terminal_theme.dart b/app/lib/features/chat/shell/chat_shell_terminal_theme.dart index bb356a21..936096ed 100644 --- a/app/lib/features/chat/shell/chat_shell_terminal_theme.dart +++ b/app/lib/features/chat/shell/chat_shell_terminal_theme.dart @@ -10,7 +10,7 @@ import '../conversation/chat_card_styles.dart'; /// background, the body text colour as foreground, the accent as cursor and /// selection. The sixteen ANSI colours are the emulator's standard palette, /// darkened on a light surface so coloured output stays readable. -TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) { +TerminalTheme chatShellTerminalTheme(BuildContext context) { final dark = Theme.of(context).brightness == Brightness.dark; final background = chatCardFillColor(context, false); final foreground = Theme.of(context).colorScheme.onSurface; @@ -54,7 +54,7 @@ TerminalTheme chatShellTerminalTheme(BuildContext context, bool cupertino) { } /// The terminal's text: the host's monospace family at the card body size. -TerminalStyle chatShellTerminalStyle(BuildContext context, bool cupertino) { +TerminalStyle chatShellTerminalStyle(BuildContext context) { final body = chatCardBodyStyle(context, false) ?? const TextStyle(); return TerminalStyle( fontFamily: appMonospaceFamily, diff --git a/app/lib/features/chat/shell/chat_shell_terminal_view.dart b/app/lib/features/chat/shell/chat_shell_terminal_view.dart index 5b0cd7b7..5497d57b 100644 --- a/app/lib/features/chat/shell/chat_shell_terminal_view.dart +++ b/app/lib/features/chat/shell/chat_shell_terminal_view.dart @@ -74,14 +74,12 @@ class ChatShellTerminalView extends StatefulWidget { const ChatShellTerminalView({ super.key, required this.session, - required this.cupertino, this.fill = false, this.autofocus = false, this.autoResize = true, }); final ChatShellTerminalSession session; - final bool cupertino; final bool fill; final bool autofocus; @@ -155,7 +153,7 @@ class _ChatShellTerminalViewState extends State { Widget build(BuildContext context) { final session = widget.session; final live = session.live; - final style = chatShellTerminalStyle(context, false); + final style = chatShellTerminalStyle(context); const padding = EdgeInsets.all(8); Widget view = Semantics( identifier: 'chat-shell-terminal', @@ -168,7 +166,7 @@ class _ChatShellTerminalViewState extends State { focusNode: _focus, autofocus: widget.autofocus && live, autoResize: widget.autoResize, - theme: chatShellTerminalTheme(context, false), + theme: chatShellTerminalTheme(context), textStyle: style, padding: padding, readOnly: !live, diff --git a/app/lib/features/chat/shell/chat_shell_thread_support.dart b/app/lib/features/chat/shell/chat_shell_thread_support.dart index f9348053..6171a7c9 100644 --- a/app/lib/features/chat/shell/chat_shell_thread_support.dart +++ b/app/lib/features/chat/shell/chat_shell_thread_support.dart @@ -22,10 +22,9 @@ Widget chatShellRunMenuAction({required VoidCallback onPressed}) => Future runChatShellFromMenu( BuildContext context, ChatShellRunsController controller, { - required bool cupertino, required void Function(String text, {bool failed}) showNotice, }) async { - final command = await showChatShellRunDialog(context, cupertino: cupertino); + final command = await showChatShellRunDialog(context); if (command == null) return; final refusal = await controller.start(command); if (refusal != null) { diff --git a/app/lib/features/terminal/terminal_body.dart b/app/lib/features/terminal/terminal_body.dart index 6dbe0f7c..661e7af5 100644 --- a/app/lib/features/terminal/terminal_body.dart +++ b/app/lib/features/terminal/terminal_body.dart @@ -15,13 +15,11 @@ class TerminalBody extends StatelessWidget { const TerminalBody({ super.key, required this.hub, - required this.cupertino, this.keys = false, this.focus, }); final TerminalHub hub; - final bool cupertino; final bool keys; final FocusScopeNode? focus; @@ -52,7 +50,6 @@ class TerminalBody extends StatelessWidget { child: ChatShellTerminalView( key: ValueKey('terminal-view-${tab.key}'), session: tab.session, - cupertino: cupertino, fill: true, autofocus: true, ), @@ -68,7 +65,6 @@ class TerminalBody extends StatelessWidget { padding: const EdgeInsets.fromLTRB(8, 0, 8, 8), child: ChatShellTerminalKeys( session: tab.session, - cupertino: cupertino, field: chatShellTouchFirst(), ), ), @@ -77,10 +73,10 @@ class TerminalBody extends StatelessWidget { ); } - TextStyle? _noteStyle(BuildContext context) => - Theme.of(context).textTheme.bodySmall?.copyWith( - color: Theme.of(context).colorScheme.onSurfaceVariant, - ); + TextStyle? _noteStyle(BuildContext context) => Theme.of(context) + .textTheme + .bodySmall + ?.copyWith(color: Theme.of(context).colorScheme.onSurfaceVariant); Widget _closeEnded(TerminalTab tab) { void close() => unawaited(hub.close(tab)); diff --git a/app/lib/features/terminal/terminal_menu.dart b/app/lib/features/terminal/terminal_menu.dart index 1a914f63..550b453a 100644 --- a/app/lib/features/terminal/terminal_menu.dart +++ b/app/lib/features/terminal/terminal_menu.dart @@ -15,19 +15,15 @@ class TerminalChoice { class TerminalMenuButton extends StatelessWidget { const TerminalMenuButton({ super.key, - required this.cupertino, required this.label, required this.icon, - required this.cupertinoIcon, required this.choices, required this.onSelected, this.info, }); - final bool cupertino; final String label; final IconData icon; - final IconData cupertinoIcon; final List> choices; final ValueChanged onSelected; diff --git a/app/lib/features/terminal/terminal_page.dart b/app/lib/features/terminal/terminal_page.dart index 56ac5485..0391daa8 100644 --- a/app/lib/features/terminal/terminal_page.dart +++ b/app/lib/features/terminal/terminal_page.dart @@ -12,10 +12,8 @@ import 'terminal_tab_strip.dart'; PageRoute terminalPageRoute({ required TerminalHub hub, required TerminalLayout layout, - required bool cupertino, }) { - Widget page(BuildContext _) => - TerminalPage(hub: hub, layout: layout, cupertino: cupertino); + Widget page(BuildContext _) => TerminalPage(hub: hub, layout: layout); return MaterialPageRoute(builder: page); } @@ -32,14 +30,9 @@ class TerminalPageToggle { BuildContext context, { required TerminalHub hub, required TerminalLayout layout, - required bool cupertino, }) async { if (_route != null) return; - final route = _route = terminalPageRoute( - hub: hub, - layout: layout, - cupertino: cupertino, - ); + final route = _route = terminalPageRoute(hub: hub, layout: layout); try { await Navigator.of(context).push(route); } finally { @@ -59,16 +52,10 @@ class TerminalPageToggle { } class TerminalPage extends StatelessWidget { - const TerminalPage({ - super.key, - required this.hub, - required this.layout, - required this.cupertino, - }); + const TerminalPage({super.key, required this.hub, required this.layout}); final TerminalHub hub; final TerminalLayout layout; - final bool cupertino; @override Widget build(BuildContext context) { @@ -78,15 +65,8 @@ class TerminalPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - TerminalTabStrip( - hub: hub, - layout: layout, - cupertino: cupertino, - showModes: false, - ), - Expanded( - child: TerminalBody(hub: hub, cupertino: cupertino, keys: true), - ), + TerminalTabStrip(hub: hub, layout: layout, showModes: false), + Expanded(child: TerminalBody(hub: hub, keys: true)), ], ), ), diff --git a/app/lib/features/terminal/terminal_panel.dart b/app/lib/features/terminal/terminal_panel.dart index 2021463c..9e46eadf 100644 --- a/app/lib/features/terminal/terminal_panel.dart +++ b/app/lib/features/terminal/terminal_panel.dart @@ -34,14 +34,12 @@ class TerminalPanel extends StatefulWidget { super.key, required this.hub, required this.layout, - required this.cupertino, required this.available, this.focus, }); final TerminalHub hub; final TerminalLayout layout; - final bool cupertino; /// The height of the window the panel shares with the app. final double available; @@ -138,17 +136,9 @@ class _TerminalPanelState extends State { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ handle, - TerminalTabStrip( - hub: widget.hub, - layout: widget.layout, - cupertino: widget.cupertino, - ), + TerminalTabStrip(hub: widget.hub, layout: widget.layout), Expanded( - child: TerminalBody( - hub: widget.hub, - cupertino: widget.cupertino, - focus: widget.focus, - ), + child: TerminalBody(hub: widget.hub, focus: widget.focus), ), ], ), diff --git a/app/lib/features/terminal/terminal_shortcut_bubble.dart b/app/lib/features/terminal/terminal_shortcut_bubble.dart index d408302c..4a885239 100644 --- a/app/lib/features/terminal/terminal_shortcut_bubble.dart +++ b/app/lib/features/terminal/terminal_shortcut_bubble.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import '../../ui/adaptive/segmented_bar_pieces.dart'; - /// On a phone, a small floating button below the top bar's right end that /// opens the full-screen terminal. It shows how many shells are running when /// there is more than one. @@ -9,21 +7,16 @@ class TerminalShortcutBubble extends StatelessWidget { const TerminalShortcutBubble({ super.key, required this.running, - required this.cupertino, required this.onOpen, }); final int running; - final bool cupertino; final VoidCallback onOpen; /// The top edge: below the safe area and the top bar (its 8 px top inset /// and its pieces), with an 8 px gap. - static double topOf(BuildContext context, {required bool cupertino}) => - MediaQuery.paddingOf(context).top + - 8 + - segmentedPieceHeight(cupertino) + - 8; + static double topOf(BuildContext context) => + MediaQuery.paddingOf(context).top + 8 + kMinInteractiveDimension + 8; @override Widget build(BuildContext context) { diff --git a/app/lib/features/terminal/terminal_stage.dart b/app/lib/features/terminal/terminal_stage.dart index e3063d01..e76b71ea 100644 --- a/app/lib/features/terminal/terminal_stage.dart +++ b/app/lib/features/terminal/terminal_stage.dart @@ -14,7 +14,6 @@ class TerminalStage extends StatelessWidget { super.key, required this.hub, required this.layout, - required this.cupertino, required this.present, required this.reveal, required this.focus, @@ -24,7 +23,6 @@ class TerminalStage extends StatelessWidget { final TerminalHub hub; final TerminalLayout layout; - final bool cupertino; final bool present; final Animation reveal; final FocusScopeNode focus; @@ -76,7 +74,6 @@ class TerminalStage extends StatelessWidget { key: const ValueKey('terminal-panel'), hub: hub, layout: layout, - cupertino: cupertino, available: constraints.maxHeight, focus: focus, ), diff --git a/app/lib/features/terminal/terminal_surface.dart b/app/lib/features/terminal/terminal_surface.dart index b6296f23..6a070b19 100644 --- a/app/lib/features/terminal/terminal_surface.dart +++ b/app/lib/features/terminal/terminal_surface.dart @@ -31,7 +31,7 @@ class TerminalSurface extends StatefulWidget { super.key, required this.hub, required this.layout, - required this.cupertino, + this.cupertino, required this.child, this.shortcutHere = true, this.windows, @@ -40,7 +40,9 @@ class TerminalSurface extends StatefulWidget { final TerminalHub hub; final TerminalLayout layout; - final bool cupertino; + + /// Kept for callers migrating from the former alternate host; ignored. + final bool? cupertino; final Widget child; /// Whether the current page offers the phone shortcut to reopen the @@ -189,12 +191,7 @@ class _TerminalSurfaceState extends State Future _openPage() async { unawaited(openTerminalIfNone(widget.hub)); setState(() {}); - await _page.show( - context, - hub: widget.hub, - layout: widget.layout, - cupertino: widget.cupertino, - ); + await _page.show(context, hub: widget.hub, layout: widget.layout); if (mounted) setState(() {}); } @@ -212,13 +209,9 @@ class _TerminalSurfaceState extends State if (show) PositionedDirectional( end: 12, - top: TerminalShortcutBubble.topOf( - context, - cupertino: widget.cupertino, - ), + top: TerminalShortcutBubble.topOf(context), child: TerminalShortcutBubble( running: running, - cupertino: widget.cupertino, onOpen: () => unawaited(_openPage()), ), ), @@ -234,7 +227,6 @@ class _TerminalSurfaceState extends State builder: (context, child) => TerminalStage( hub: widget.hub, layout: widget.layout, - cupertino: widget.cupertino, // Kept while the hide motion runs. present: !_narrow && (widget.layout.visible || !_reveal.isDismissed), reveal: _curve, diff --git a/app/lib/features/terminal/terminal_tab_strip.dart b/app/lib/features/terminal/terminal_tab_strip.dart index 364920b5..fce1c28f 100644 --- a/app/lib/features/terminal/terminal_tab_strip.dart +++ b/app/lib/features/terminal/terminal_tab_strip.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'terminal_hub.dart'; @@ -18,14 +17,12 @@ class TerminalTabStrip extends StatelessWidget { super.key, required this.hub, required this.layout, - required this.cupertino, this.trailing = const [], this.showModes = true, }); final TerminalHub hub; final TerminalLayout layout; - final bool cupertino; final List trailing; /// False on the narrow page, which has no panel or window to choose. @@ -57,11 +54,9 @@ class TerminalTabStrip extends StatelessWidget { _newTerminal(), if (showModes) TerminalMenuButton<_Option>( - cupertino: cupertino, label: 'Terminal options', info: TerminalShortcutLabels.current().summary, icon: Icons.more_vert, - cupertinoIcon: CupertinoIcons.ellipsis, choices: [ for (final mode in TerminalMode.values) TerminalChoice( @@ -113,10 +108,8 @@ class TerminalTabStrip extends StatelessWidget { final machines = hub.connected; if (machines.length > 1) { return TerminalMenuButton( - cupertino: cupertino, label: 'New terminal', icon: Icons.add, - cupertinoIcon: CupertinoIcons.add, choices: [ for (final machine in machines) TerminalChoice( diff --git a/app/lib/features/terminal/terminal_toggle_button.dart b/app/lib/features/terminal/terminal_toggle_button.dart index 9fb3b320..6adbd880 100644 --- a/app/lib/features/terminal/terminal_toggle_button.dart +++ b/app/lib/features/terminal/terminal_toggle_button.dart @@ -7,14 +7,12 @@ import 'terminal_shortcuts.dart'; /// The shell bar's Terminal button: shows or hides the terminal (also /// Alt+T, Ctrl+T, Cmd+T and Ctrl+`, where the platform delivers them). class TerminalToggleButton extends StatelessWidget { - const TerminalToggleButton({ - super.key, - required this.layout, - required this.cupertino, - }); + const TerminalToggleButton({super.key, required this.layout, this.cupertino}); final TerminalLayout layout; - final bool cupertino; + + /// Kept for callers migrating from the former alternate host; ignored. + final bool? cupertino; /// The tooltip, naming the platform's most convenient shortcut. static String get label => TerminalShortcutLabels.current().button; diff --git a/app/lib/features/terminal/terminal_window.dart b/app/lib/features/terminal/terminal_window.dart index 6787d2cf..1f47033f 100644 --- a/app/lib/features/terminal/terminal_window.dart +++ b/app/lib/features/terminal/terminal_window.dart @@ -149,8 +149,8 @@ class TerminalWindowKind extends WindowKind { builder: (context, _) => Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - TerminalTabStrip(hub: hub, layout: layout, cupertino: false), - Expanded(child: TerminalBody(hub: hub, cupertino: false)), + TerminalTabStrip(hub: hub, layout: layout), + Expanded(child: TerminalBody(hub: hub)), ], ), ); diff --git a/app/notes/material-cleanup-terminal-chat-shell.md b/app/notes/material-cleanup-terminal-chat-shell.md new file mode 100644 index 00000000..a9e2a0cc --- /dev/null +++ b/app/notes/material-cleanup-terminal-chat-shell.md @@ -0,0 +1,14 @@ +# Material-only terminal and chat shell cleanup + +- Removed Cupertino icon imports, alternate icon metadata, and ignored host + flags from terminal and chat-shell widgets while retaining the existing + Material controls and terminal keyboard/focus/resize behavior. +- `TerminalSurface.cupertino` and `TerminalToggleButton.cupertino` remain + optional ignored compatibility parameters for the application lane's + existing `app_terminals.dart` callers; they have no rendering effect and are + ready for removal after those callers migrate. +- Focused check: `tool/memwatch/full.sh` with the nine terminal/chat-shell test + paths, 52 passed, 0 failed, 0 skipped. +- Analysis: `tool/analyze.sh` clean. +- No visual redesign or capture was performed; the changed widgets continue to + use the same Material palette, controls, layout, and semantics. diff --git a/app/test/features/terminal/terminal_app.dart b/app/test/features/terminal/terminal_app.dart index cbfe0189..cd6e0124 100644 --- a/app/test/features/terminal/terminal_app.dart +++ b/app/test/features/terminal/terminal_app.dart @@ -84,7 +84,6 @@ class TerminalTestAppState extends State { Widget build(BuildContext context) => TerminalSurface( hub: widget.hub, layout: widget.layout, - cupertino: false, shortcutHere: widget.shortcutHere, floating: floating, windows: WindowHost(manager: manager), @@ -92,7 +91,7 @@ class TerminalTestAppState extends State { appBar: AppBar( title: const Text('App'), actions: [ - TerminalToggleButton(layout: widget.layout, cupertino: false), + TerminalToggleButton(layout: widget.layout), ], ), body: const TextField(key: appField), diff --git a/app/test/features/terminal/terminal_chat_tab_test.dart b/app/test/features/terminal/terminal_chat_tab_test.dart index 0b348551..2cdc4043 100644 --- a/app/test/features/terminal/terminal_chat_tab_test.dart +++ b/app/test/features/terminal/terminal_chat_tab_test.dart @@ -62,7 +62,6 @@ void main() { home: TerminalSurface( hub: hub, layout: layout, - cupertino: false, child: AdaptiveShell( destination: AppDestination.chat, destinationBodies: {