From 2d0e33dd67820d4890da965942116479bab403d8 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 19:40:26 +0000 Subject: [PATCH 1/8] Unify chat selector menus Use the permission selector's shared popup and choice-row primitives for model and thinking controls while preserving catalog, search, and next-turn behavior. Remove the obsolete Cupertino model chooser parameter and cover current-model dismissal. --- .../conversation/chat_effort_control.dart | 101 ++++++----- .../chat/conversation/chat_mode_control.dart | 26 ++- .../chat/conversation/chat_model_chooser.dart | 171 ++++++++++-------- .../chat/conversation/chat_model_control.dart | 9 +- app/lib/ui/adaptive/app_popups.dart | 25 +++ app/notes/chat-selector-menu-unification.md | 18 ++ .../conversation/chat_model_picker_test.dart | 14 ++ 7 files changed, 227 insertions(+), 137 deletions(-) create mode 100644 app/notes/chat-selector-menu-unification.md diff --git a/app/lib/features/chat/conversation/chat_effort_control.dart b/app/lib/features/chat/conversation/chat_effort_control.dart index 226cafc3..3020c937 100644 --- a/app/lib/features/chat/conversation/chat_effort_control.dart +++ b/app/lib/features/chat/conversation/chat_effort_control.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; import '../../../core/error_reason.dart'; -import '../../../ui/adaptive/app_menu_anchor.dart'; +import '../../../ui/adaptive/app_popups.dart'; import 'chat_bar_control_style.dart'; import 'chat_efforts.dart'; import 'chat_models.dart'; @@ -92,9 +92,13 @@ class _ChatEffortControlState extends State { } Future _chooseFromMenu(ChatEffortLevel level) async { - if (level.id == _state.effort) return; + if (level.id == _state.effort || level.id == _state.current) { + Navigator.of(context).pop(); + return; + } try { await _choose(level); + if (mounted) Navigator.of(context).pop(); } catch (error) { if (!mounted) return; ScaffoldMessenger.maybeOf(context)?.showSnackBar( @@ -128,57 +132,62 @@ class _ChatEffortControlState extends State { ], ); const key = Key('chat-effort'); - return AppMenuAnchor( - menuChildren: [ - Padding( - padding: const EdgeInsets.fromLTRB(12, 8, 12, 4), - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 280), + return Semantics( + container: true, + button: true, + label: 'Change thinking level, currently ${_state.currentName}', + onTap: _open, + child: ExcludeSemantics( + child: Tooltip( + message: 'Change thinking level (currently ${_state.currentName})', + child: TextButton( + key: key, + style: chatBarTextButtonStyle(context, compact: iconOnly), + onPressed: _open, + child: content, + ), + ), + ), + ); + } + + Future _open() async { + await showAppChoiceMenu( + context, + width: 320, + semanticLabel: 'Change thinking level', + builder: (_) => ListView( + key: const Key('chat-effort-menu'), + shrinkWrap: true, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 8), child: Text( chatEffortNote(running: widget.running), key: const Key('chat-effort-note'), style: Theme.of(context).textTheme.bodySmall, ), ), - ), - for (final level in _state.levels) - MenuItemButton( - key: ValueKey('chat-effort-option-${level.id}'), - trailingIcon: level.id == _state.current - ? const Icon(Icons.check) - : null, - onPressed: () => unawaited(_chooseFromMenu(level)), - child: level.description.isEmpty - ? Text(level.name) - : Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text(level.name), - Text( - level.description, - style: Theme.of(context).textTheme.bodySmall, - ), - ], - ), - ), - ], - builder: (context, menu, _) => Semantics( - container: true, - button: true, - label: 'Change thinking level, currently ${_state.currentName}', - onTap: () => menu.isOpen ? menu.close() : menu.open(), - child: ExcludeSemantics( - child: Tooltip( - message: 'Change thinking level (currently ${_state.currentName})', - child: TextButton( - key: key, - style: chatBarTextButtonStyle(context), - onPressed: () => menu.isOpen ? menu.close() : menu.open(), - child: content, + for (final level in _state.levels) + AppChoiceMenuItem( + key: ValueKey('chat-effort-option-${level.id}'), + selected: level.id == _state.current, + onTap: () => unawaited(_chooseFromMenu(level)), + child: level.description.isEmpty + ? Text(level.name) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(level.name), + Text( + level.description, + style: Theme.of(context).textTheme.bodySmall, + ), + ], + ), ), - ), - ), + ], ), ); } diff --git a/app/lib/features/chat/conversation/chat_mode_control.dart b/app/lib/features/chat/conversation/chat_mode_control.dart index 904745e3..a84d219a 100644 --- a/app/lib/features/chat/conversation/chat_mode_control.dart +++ b/app/lib/features/chat/conversation/chat_mode_control.dart @@ -249,17 +249,23 @@ class _ChatModePickerState extends State<_ChatModePicker> { ) else for (final mode in modes) - ListTile( + AppChoiceMenuItem( key: ValueKey('chat-mode-option-${mode.id}'), - enabled: !_busy, - title: Text(mode.name), - subtitle: mode.description.isEmpty - ? null - : Text(mode.description), - trailing: mode.id == _current - ? Icon(Icons.check, color: theme.colorScheme.primary) - : null, - onTap: () => _choose(mode), + selected: mode.id == _current, + onTap: _busy ? null : () => _choose(mode), + child: mode.description.isEmpty + ? Text(mode.name) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text(mode.name), + Text( + mode.description, + style: theme.textTheme.bodySmall, + ), + ], + ), ), ], ), diff --git a/app/lib/features/chat/conversation/chat_model_chooser.dart b/app/lib/features/chat/conversation/chat_model_chooser.dart index 81bd112d..eeaef303 100644 --- a/app/lib/features/chat/conversation/chat_model_chooser.dart +++ b/app/lib/features/chat/conversation/chat_model_chooser.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; import '../../../core/error_reason.dart'; +import '../../../ui/adaptive/app_popups.dart'; import '../data/chat_repository.dart'; import 'chat_models.dart'; @@ -22,7 +23,6 @@ class ChatModelChooser extends StatefulWidget { required this.backend, required this.currentProvider, required this.currentModel, - required this.cupertino, required this.onAccepted, }); @@ -31,7 +31,6 @@ class ChatModelChooser extends StatefulWidget { final String backend; final String currentProvider; final String currentModel; - final bool cupertino; final ValueChanged onAccepted; @override @@ -92,6 +91,10 @@ class _ChatModelChooserState extends State { Future _choose(JsonMap model) async { if (_busy) return; + if (_isCurrent(model)) { + Navigator.of(context).pop(); + return; + } setState(() { _busy = true; _error = null; @@ -147,95 +150,105 @@ class _ChatModelChooserState extends State { final secondary = theme.colorScheme.onSurfaceVariant; final matches = filterChatModels(_models, _search.text); final needle = _search.text.trim(); - return SimpleDialog( - key: const Key('chat-model-chooser'), - title: const Text('Change model'), - children: [ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), - child: Text( - chatModelSelectionNote(widget.backend), - style: theme.textTheme.bodySmall?.copyWith(color: secondary), - ), - ), - if (_loading) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 8, 24, 8), - child: Row( - children: [ - const CircularProgressIndicator(), - const SizedBox(width: 12), - const Expanded(child: Text('Loading models…')), - ], + return SafeArea( + child: SingleChildScrollView( + key: const Key('chat-model-chooser'), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Padding( + padding: EdgeInsets.fromLTRB(16, 0, 16, 8), + child: Text('Change model'), ), - ) - else if (_error != null) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), - child: Text( - _error!, - key: const Key('chat-model-error'), - style: theme.textTheme.bodyMedium?.copyWith( - color: theme.colorScheme.error, - ), - ), - ) - else if (_models.isEmpty) - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), - child: Text( - 'No models are available for this chat.', - style: theme.textTheme.bodyMedium?.copyWith(color: secondary), - ), - ) - else ...[ - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), - child: TextField( - key: const Key('chat-model-search'), - controller: _search, - onChanged: (_) => setState(() {}), - decoration: const InputDecoration( - prefixIcon: Icon(Icons.search), - hintText: 'Search models', - ), - ), - ), - for (final model in matches) - SimpleDialogOption( - key: _optionKey(model), - onPressed: _busy ? null : () => _choose(model), - child: _optionRow(context, model), - ), - if (matches.isEmpty && needle.isNotEmpty) Padding( - padding: const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), + padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8), child: Text( - 'No models match "$needle".', - key: const Key('chat-model-no-match'), - style: theme.textTheme.bodyMedium?.copyWith(color: secondary), + chatModelSelectionNote(widget.backend), + style: theme.textTheme.bodySmall?.copyWith(color: secondary), ), ), - ], - Padding( - padding: const EdgeInsetsDirectional.fromSTEB(16, 4, 16, 8), - child: Align( - alignment: AlignmentDirectional.centerEnd, - child: TextButton( - key: const Key('chat-model-cancel'), - onPressed: () => Navigator.of(context).pop(), - child: const Text('Cancel'), + if (_loading) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 8, 16, 8), + child: Row( + children: [ + const CircularProgressIndicator(), + const SizedBox(width: 12), + const Expanded(child: Text('Loading models…')), + ], + ), + ) + else if (_error != null) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8), + child: Text( + _error!, + key: const Key('chat-model-error'), + style: theme.textTheme.bodyMedium?.copyWith( + color: theme.colorScheme.error, + ), + ), + ) + else if (_models.isEmpty) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8), + child: Text( + 'No models are available for this chat.', + style: theme.textTheme.bodyMedium?.copyWith(color: secondary), + ), + ) + else ...[ + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8), + child: TextField( + key: const Key('chat-model-search'), + controller: _search, + onChanged: (_) => setState(() {}), + decoration: const InputDecoration( + prefixIcon: Icon(Icons.search), + hintText: 'Search models', + ), + ), + ), + for (final model in matches) + AppChoiceMenuItem( + key: _optionKey(model), + selected: _isCurrent(model), + onTap: _busy ? null : () => _choose(model), + child: _optionRow(context, model), + ), + if (matches.isEmpty && needle.isNotEmpty) + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 0, 16, 8), + child: Text( + 'No models match "$needle".', + key: const Key('chat-model-no-match'), + style: theme.textTheme.bodyMedium?.copyWith( + color: secondary, + ), + ), + ), + ], + Padding( + padding: const EdgeInsetsDirectional.fromSTEB(16, 4, 16, 8), + child: Align( + alignment: AlignmentDirectional.centerEnd, + child: TextButton( + key: const Key('chat-model-cancel'), + onPressed: () => Navigator.of(context).pop(), + child: const Text('Cancel'), + ), + ), ), - ), + ], ), - ], + ), ); } Widget _optionRow(BuildContext context, JsonMap model) { final selected = _isCurrent(model); final secondary = Theme.of(context).colorScheme.onSurfaceVariant; - final accent = Theme.of(context).colorScheme.primary; final provider = '${model['provider'] ?? ''}'.trim(); return Semantics( selected: selected, @@ -252,7 +265,7 @@ class _ChatModelChooserState extends State { ], ), ), - if (selected) Icon(Icons.check, color: accent), + // The shared menu row supplies the check mark. ], ), ); diff --git a/app/lib/features/chat/conversation/chat_model_control.dart b/app/lib/features/chat/conversation/chat_model_control.dart index 0df4eb3f..0ce20e5e 100644 --- a/app/lib/features/chat/conversation/chat_model_control.dart +++ b/app/lib/features/chat/conversation/chat_model_control.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import '../../../core/api_gateway.dart'; +import '../../../ui/adaptive/app_popups.dart'; import 'chat_bar_control_style.dart'; import 'chat_model_chooser.dart'; import 'chat_models.dart'; @@ -79,10 +80,14 @@ class _ChatModelControlState extends State { backend: '${widget.session['backend'] ?? ''}'.trim(), currentProvider: _provider, currentModel: _model, - cupertino: false, onAccepted: _accept, ); - await showDialog(context: context, builder: (_) => chooser); + await showAppChoiceMenu( + context, + width: 420, + semanticLabel: 'Change model', + builder: (_) => chooser, + ); } void _accept(ChatModelSelection applied) { diff --git a/app/lib/ui/adaptive/app_popups.dart b/app/lib/ui/adaptive/app_popups.dart index b0834334..4d035b15 100644 --- a/app/lib/ui/adaptive/app_popups.dart +++ b/app/lib/ui/adaptive/app_popups.dart @@ -57,6 +57,31 @@ Future showAppChoiceMenu( ); } +/// A choice row shared by the app's anchored choice menus. Keeping the row +/// here makes checked state and tap affordances consistent across selectors. +class AppChoiceMenuItem extends StatelessWidget { + const AppChoiceMenuItem({ + super.key, + required this.child, + required this.selected, + required this.onTap, + }); + + final Widget child; + final bool selected; + final VoidCallback? onTap; + + @override + Widget build(BuildContext context) => ListTile( + enabled: onTap != null, + title: child, + trailing: selected + ? Icon(Icons.check, color: Theme.of(context).colorScheme.primary) + : null, + onTap: onTap, + ); +} + /// Shows richer content (a chat's details, a file's details) built by /// [builder]: a dialog on a wide app, a bottom sheet on a phone, on the root /// navigator either way. The content sizes itself (a `Column` with diff --git a/app/notes/chat-selector-menu-unification.md b/app/notes/chat-selector-menu-unification.md new file mode 100644 index 00000000..d09196ee --- /dev/null +++ b/app/notes/chat-selector-menu-unification.md @@ -0,0 +1,18 @@ +# Chat selector menu unification + +## Change + +Model and thinking-level controls now use the same `showAppChoiceMenu` root +popup/bottom-sheet primitive and shared `AppChoiceMenuItem` rows as the +permission-mode selector. Their catalog/search, loading, next-turn, server +echo, refusal, retry and dismissal behavior remain in their respective +controls. The model chooser's obsolete Cupertino parameter was removed. + +## Checks + +- `tool/memwatch/full.sh 'test/features/chat/conversation/chat_mode_control_test.dart test/features/chat/conversation/chat_model_picker_test.dart test/features/chat/conversation/chat_effort_control_test.dart test/features/chat/conversation/chat_effort_header_test.dart'` + — 29 passed, 0 failed, including the current-model dismissal regression. +- `tool/analyze.sh` — clean. + +Browser captures were not performed in this implementation stage; UI review +owns the requested full-app captures. diff --git a/app/test/features/chat/conversation/chat_model_picker_test.dart b/app/test/features/chat/conversation/chat_model_picker_test.dart index c5d1171d..0d3a3864 100644 --- a/app/test/features/chat/conversation/chat_model_picker_test.dart +++ b/app/test/features/chat/conversation/chat_model_picker_test.dart @@ -135,6 +135,20 @@ void main() { expect(find.text('model-b'), findsOneWidget); }); + testWidgets('choosing the current model only dismisses the chooser', ( + tester, + ) async { + final gateway = _ModelGateway()..modelsReply = _catalog; + await _openThread(tester, gateway); + await _openChooser(tester); + + await tester.tap(find.text('Model Alpha')); + await tester.pumpAndSettle(); + + expect(find.byKey(const Key('chat-model-chooser')), findsNothing); + expect(gateway.lastFields('chat_model'), isNull); + }); + testWidgets('a refusal keeps the previous model and shows the reason', ( tester, ) async { From 4668deeaf772f802facad764a57177de3016aabd Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 19:40:30 +0000 Subject: [PATCH 2/8] Focus floating chat from terminal shortcut Raise the most recently used chat when Ctrl+Y is invoked from another window, then rely on the existing host lifecycle to focus its composer. Preserve toggle behavior while chat is active and retain the Apple shortcut aliases. --- .../features/chat/windows/chat_windows.dart | 2 +- .../chat/workspace/chat_float_shortcut.dart | 9 +-- app/lib/shell/windows/window_manager.dart | 14 ++++ app/notes/chat-terminal-focus-shortcut.md | 23 ++++++ .../chat/chat_floating_pane_test.dart | 78 +++++++++++++++++-- .../chat/windows/chat_windows_test.dart | 10 +-- .../workspace/chat_float_shortcut_test.dart | 4 + .../shell/windows/window_manager_test.dart | 19 +++++ 8 files changed, 142 insertions(+), 17 deletions(-) create mode 100644 app/notes/chat-terminal-focus-shortcut.md diff --git a/app/lib/features/chat/windows/chat_windows.dart b/app/lib/features/chat/windows/chat_windows.dart index ef0e9781..247dd879 100644 --- a/app/lib/features/chat/windows/chat_windows.dart +++ b/app/lib/features/chat/windows/chat_windows.dart @@ -221,7 +221,7 @@ class ChatWindows { if (event is KeyDownEvent) tiling.floatActive(); return KeyEventResult.handled; } - if (event is KeyDownEvent) manager.toggleGroup(chatWindowKind); + if (event is KeyDownEvent) manager.toggleOrRaiseGroup(chatWindowKind); return KeyEventResult.handled; } } diff --git a/app/lib/features/chat/workspace/chat_float_shortcut.dart b/app/lib/features/chat/workspace/chat_float_shortcut.dart index 6d84b172..af6101a2 100644 --- a/app/lib/features/chat/workspace/chat_float_shortcut.dart +++ b/app/lib/features/chat/workspace/chat_float_shortcut.dart @@ -1,16 +1,13 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; -import '../../../ui/input/keyboard_owner.dart'; - /// Whether [event] shows or hides the floating chats: Alt+Y (Option+Y), /// Ctrl+Y, and Cmd+Y on Apple platforms, matching the terminal's Alt+T. It is /// a global key handler like the terminal's toggle, so it works while a /// composer or the terminal has the keyboard; a plain Y (or Shift+Y) always /// types. Alt+Y is always the chord, as Alt+T is for the terminal. On Apple -/// platforms Ctrl+Y inside a terminal is left to the shell (yank), since Cmd+Y -/// is there; elsewhere Ctrl+Y is the chord, so it takes priority over the -/// shell's yank. +/// platforms Ctrl+Y is also the chord, so it takes priority over the shell's +/// yank. /// /// A held chord's repeats match too (and are swallowed); only its first /// press toggles. @@ -31,7 +28,7 @@ bool chatFloatShortcut( if (alt) return !control && !meta; if (control == meta) return false; if (!_apple(platform ?? defaultTargetPlatform)) return control; - return meta || !primaryFocusIsTypingSurface(); + return control || meta; } bool _apple(TargetPlatform platform) => diff --git a/app/lib/shell/windows/window_manager.dart b/app/lib/shell/windows/window_manager.dart index ff90b0ce..fea83c79 100644 --- a/app/lib/shell/windows/window_manager.dart +++ b/app/lib/shell/windows/window_manager.dart @@ -289,6 +289,20 @@ class WindowManager extends ChangeNotifier { return true; } + /// Hides the group when it is active; otherwise shows and raises its most + /// recently used window. A global shortcut should bring a group forward when + /// pressed from another window, rather than hide it behind that window. + bool toggleOrRaiseGroup(String groupId) { + final group = inGroup(groupId).toList(); + if (group.isEmpty) return false; + if (group.any(isVisible) && active?.groupId == groupId) { + setGroupShown(groupId, false); + } else { + show(group.last.id); + } + return true; + } + /// Brings the next ([step] 1) or previous (-1) visible window to the top. void cycle([int step = 1]) { final visible = windows.where(isVisible).toList(); diff --git a/app/notes/chat-terminal-focus-shortcut.md b/app/notes/chat-terminal-focus-shortcut.md new file mode 100644 index 00000000..02801415 --- /dev/null +++ b/app/notes/chat-terminal-focus-shortcut.md @@ -0,0 +1,23 @@ +# Chat terminal shortcut focus + +Implemented the macOS Ctrl+Y floating-chat handoff. A chat shortcut now hides +the chat group only when chat is already the active window; from another +window it raises the most recently used chat. The existing window-host +post-frame lifecycle then focuses that chat's composer. Ctrl+Y now joins the +existing Option+Y and Cmd+Y aliases on Apple platforms; plain Y and repeat +events remain untouched. + +Evidence: + +- `tool/memwatch/full.sh 'test/features/chat/windows/chat_windows_test.dart test/features/chat/workspace/chat_float_shortcut_test.dart test/features/chat/chat_floating_pane_test.dart test/shell/windows/window_manager_test.dart'` + — PASS: 33 passed, 0 failed, 0 skipped; peak 1236 MB; 14s. +- `tool/analyze.sh` — clean; exit 0. +- The floating-pane regression uses a terminal-like `TypingSurface`, presses + macOS Ctrl+Y, verifies the chat composer has primary focus, types + `from terminal` without a click, and verifies the terminal did not receive + Y. The manager regression covers visible-behind-terminal, hidden, multiple + chats, and repeated toggles. + +No browser fixture was run in this implementation stage; browser terminal +fixture support and full-app rendered evidence remain for the appropriate +review stage. diff --git a/app/test/features/chat/chat_floating_pane_test.dart b/app/test/features/chat/chat_floating_pane_test.dart index 401ef3aa..d8d1fa15 100644 --- a/app/test/features/chat/chat_floating_pane_test.dart +++ b/app/test/features/chat/chat_floating_pane_test.dart @@ -16,7 +16,9 @@ import 'package:pipelines_app/shell/windows/window_host.dart'; import 'package:pipelines_app/shell/windows/window_kind.dart'; import 'package:pipelines_app/shell/windows/window_manager.dart'; import 'package:pipelines_app/shell/windows/window_store.dart'; +import 'package:pipelines_app/shell/windows/window_entry.dart'; import 'package:pipelines_app/ui/motion/fade_through_stack.dart'; +import 'package:pipelines_app/ui/input/keyboard_owner.dart'; import 'conversation/chat_thread_fixtures.dart'; @@ -46,6 +48,19 @@ class _Store implements WindowStore { } } +class _TerminalKind extends WindowKind { + @override + String get key => 'terminal'; + @override + bool get serverScoped => false; + @override + IconData get icon => Icons.terminal; + @override + String title(BuildContext context, WindowEntry entry) => entry.contentId; + @override + Widget build(BuildContext context, WindowEntry entry) => const SizedBox(); +} + Finder _thread(String id) => find.byWidgetPredicate( (widget) => widget is ChatThreadView && widget.sessionId == id, skipOffstage: false, @@ -83,21 +98,21 @@ class _App { late final ChatRuntime runtime; late final WindowManager manager; late final ChatWindows windows; + final terminalFocus = FocusNode(debugLabel: 'test terminal'); + final terminalTyped = []; Future start( WidgetTester tester, { Size size = const Size(1800, 1000), + bool terminalSurface = false, }) async { tester.view.physicalSize = size; tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); bindServerIdentity(gateway, 'server-a'); runtime = ChatRuntime(gateway: gateway, serverKey: 'server-a'); - manager = WindowManager( - kinds: WindowKinds(), - store: store, - server: 'server-a', - ); + final kinds = WindowKinds()..register(_TerminalKind()); + manager = WindowManager(kinds: kinds, store: store, server: 'server-a'); windows = ChatWindows( manager: manager, runtime: runtime, @@ -131,6 +146,21 @@ class _App { ], ), ), + if (terminalSurface) + Positioned.fill( + child: TypingSurface( + child: Focus( + focusNode: terminalFocus, + onKeyEvent: (node, event) { + if (event is KeyDownEvent) { + terminalTyped.add(event.logicalKey); + } + return KeyEventResult.handled; + }, + child: const SizedBox(), + ), + ), + ), Positioned.fill(child: WindowHost(manager: manager)), ], ), @@ -147,6 +177,7 @@ class _App { manager.dispose(); destination.dispose(); chatBuilt.dispose(); + terminalFocus.dispose(); gateway.close(); } @@ -187,6 +218,13 @@ Future _chord(WidgetTester tester) async { await tester.pumpAndSettle(); } +Future _controlChord(WidgetTester tester) async { + await tester.sendKeyDownEvent(LogicalKeyboardKey.controlLeft); + await tester.sendKeyEvent(LogicalKeyboardKey.keyY); + await tester.sendKeyUpEvent(LogicalKeyboardKey.controlLeft); + await tester.pumpAndSettle(); +} + void main() { testWidgets('Float and Dock move the live chat with its draft', ( tester, @@ -391,6 +429,36 @@ void main() { await app.stop(tester); }); + testWidgets( + 'Ctrl+Y from a terminal raises chat and focuses its composer', + (tester) async { + await _saved('a', 'b'); + final app = _App(_Store()); + await app.start(tester, terminalSurface: true); + await _menu(tester, 'b', 'Float (Option+Y)'); + app.manager.open('terminal', 'terminal'); + app.terminalFocus.requestFocus(); + await tester.pump(); + + await _controlChord(tester); + final input = _input('b'); + expect(_shown('Chat b'), findsOneWidget); + expect( + tester.widget(input).focusNode.hasPrimaryFocus, + isTrue, + ); + tester.testTextInput.enterText('from terminal'); + await tester.pump(); + expect( + tester.widget(input).controller.text, + 'from terminal', + ); + expect(app.terminalTyped, isEmpty); + await app.stop(tester); + }, + variant: const TargetPlatformVariant({TargetPlatform.macOS}), + ); + testWidgets('floating chats saved by an older build come back as windows', ( tester, ) async { diff --git a/app/test/features/chat/windows/chat_windows_test.dart b/app/test/features/chat/windows/chat_windows_test.dart index b0471607..ca135f3e 100644 --- a/app/test/features/chat/windows/chat_windows_test.dart +++ b/app/test/features/chat/windows/chat_windows_test.dart @@ -232,7 +232,7 @@ void main() { }); testWidgets( - 'on macOS Ctrl+Y in a terminal stays with it; Cmd+Y and Option+Y toggle', + 'on macOS Ctrl+Y from a terminal raises chat; Cmd+Y and Option+Y toggle', (tester) async { await wide(tester); final typing = FocusNode(); @@ -256,12 +256,12 @@ void main() { typing.requestFocus(); await tester.pump(); await _chord(tester, LogicalKeyboardKey.controlLeft); - expect(h.manager.groupShown(chatWindowKind), isTrue); - expect(typed, contains(LogicalKeyboardKey.keyY)); - await _chord(tester, LogicalKeyboardKey.metaLeft); expect(h.manager.groupShown(chatWindowKind), isFalse); - await _chord(tester); + expect(typed, isNot(contains(LogicalKeyboardKey.keyY))); + await _chord(tester, LogicalKeyboardKey.metaLeft); expect(h.manager.groupShown(chatWindowKind), isTrue); + await _chord(tester); + expect(h.manager.groupShown(chatWindowKind), isFalse); }, variant: const TargetPlatformVariant({TargetPlatform.macOS}), ); diff --git a/app/test/features/chat/workspace/chat_float_shortcut_test.dart b/app/test/features/chat/workspace/chat_float_shortcut_test.dart index 66ffc3e3..b04f2433 100644 --- a/app/test/features/chat/workspace/chat_float_shortcut_test.dart +++ b/app/test/features/chat/workspace/chat_float_shortcut_test.dart @@ -29,6 +29,10 @@ void main() { chord({LogicalKeyboardKey.controlLeft}, TargetPlatform.linux), isTrue, ); + expect( + chord({LogicalKeyboardKey.controlLeft}, TargetPlatform.macOS), + isTrue, + ); expect(chord({LogicalKeyboardKey.metaLeft}, TargetPlatform.linux), isFalse); expect(chord({LogicalKeyboardKey.metaLeft}, TargetPlatform.macOS), isTrue); expect( diff --git a/app/test/shell/windows/window_manager_test.dart b/app/test/shell/windows/window_manager_test.dart index 0e0351d3..bc7beb41 100644 --- a/app/test/shell/windows/window_manager_test.dart +++ b/app/test/shell/windows/window_manager_test.dart @@ -139,6 +139,25 @@ void main() { expect(manager.groupShown('chat'), isTrue); }); + test('toggleOrRaiseGroup brings a visible group over another window', () { + final a = manager.open('chat', 'a'); + manager.open('chat', 'b'); + final terminal = manager.open('terminal', 'terminal'); + + expect(manager.active?.id, terminal.id); + expect(manager.toggleOrRaiseGroup('chat'), isTrue); + expect(manager.active?.contentId, 'b'); + expect(manager.groupShown('chat'), isTrue); + + expect(manager.toggleOrRaiseGroup('chat'), isTrue); + expect(manager.groupShown('chat'), isFalse); + expect(manager.active?.contentId, 'terminal'); + + expect(manager.toggleOrRaiseGroup('chat'), isTrue); + expect(manager.active?.contentId, 'b'); + expect(manager.byId(a.id), isNotNull); + }); + test('close remembers the frame for the content and tells the kind', () { final a = manager.open('chat', 'a'); manager.setFrame(a.id, const Rect.fromLTWH(300, 200, 500, 400)); From 8e5a88beffea3e691e97f0e18b9a92f7b1020744 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:03:57 +0000 Subject: [PATCH 3/8] Remove alternate feature icon metadata Preserve reviewed Material-only feature changes after the pipeline's landing stage incorrectly refused shell committing. Keep required shared compatibility inputs until the coordinated caller cleanup. --- .../actions/artifact_file_actions.dart | 7 ------- .../artifacts/ui/artifact_fullscreen.dart | 14 ++------------ .../artifacts/ui/artifact_viewer_bar.dart | 6 ------ .../artifacts/ui/artifact_viewer_body.dart | 2 -- .../ui/list/schedule_list_toolbar.dart | 14 +++++--------- .../search/ui/search_bar_controls.dart | 19 ++++++++----------- .../templates/ui/templates_frame.dart | 3 +-- app/notes/material-cleanup-feature-surface.md | 16 ++++++++++++++++ 8 files changed, 32 insertions(+), 49 deletions(-) create mode 100644 app/notes/material-cleanup-feature-surface.md diff --git a/app/lib/features/artifacts/actions/artifact_file_actions.dart b/app/lib/features/artifacts/actions/artifact_file_actions.dart index ea54b0dc..c2363367 100644 --- a/app/lib/features/artifacts/actions/artifact_file_actions.dart +++ b/app/lib/features/artifacts/actions/artifact_file_actions.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../ui/adaptive/glass_bar.dart'; @@ -200,7 +199,6 @@ class _IconActions extends StatelessWidget { key: const Key('artifact-download'), label: 'Download', icon: Icons.download_outlined, - cupertinoIcon: CupertinoIcons.arrow_down_to_line, busy: busy, onPressed: busy ? null : controller.download, ), @@ -209,7 +207,6 @@ class _IconActions extends StatelessWidget { key: const Key('artifact-share'), label: 'Share', icon: Icons.share_outlined, - cupertinoIcon: CupertinoIcons.share, onPressed: busy ? null : controller.share, ), ], @@ -223,7 +220,6 @@ class ArtifactIconAction extends StatelessWidget { super.key, required this.label, required this.icon, - required this.cupertinoIcon, required this.onPressed, this.busy = false, }); @@ -231,9 +227,6 @@ class ArtifactIconAction extends StatelessWidget { final String label; final IconData icon; - /// Retained for callers that still pass the Cupertino glyph; the Material - /// action always draws [icon]. - final IconData cupertinoIcon; final VoidCallback? onPressed; final bool busy; diff --git a/app/lib/features/artifacts/ui/artifact_fullscreen.dart b/app/lib/features/artifacts/ui/artifact_fullscreen.dart index 3ac2d334..3362c4a4 100644 --- a/app/lib/features/artifacts/ui/artifact_fullscreen.dart +++ b/app/lib/features/artifacts/ui/artifact_fullscreen.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -34,7 +33,7 @@ class ArtifactFullscreenScope extends InheritedWidget { /// [cupertino] is retained for callers that still pass it; the route is always /// the Material one. Route artifactFullscreenRoute({ - required bool cupertino, + bool? cupertino, required WidgetBuilder builder, }) => MaterialPageRoute(fullscreenDialog: true, builder: builder); @@ -74,7 +73,6 @@ List artifactHtmlZoomActions(ValueNotifier zoom) { Key key, String label, IconData icon, - IconData cupertinoIcon, VoidCallback? onPressed, ) => SegmentedOverflowAction( key: key, @@ -83,12 +81,7 @@ List artifactHtmlZoomActions(ValueNotifier zoom) { icon: icon, onPressed: onPressed, ), - child: ArtifactIconAction( - label: label, - icon: icon, - cupertinoIcon: cupertinoIcon, - onPressed: onPressed, - ), + child: ArtifactIconAction(label: label, icon: icon, onPressed: onPressed), ); final value = zoom.value; return [ @@ -96,21 +89,18 @@ List artifactHtmlZoomActions(ValueNotifier zoom) { artifactZoomOutKey, 'Zoom out', Icons.zoom_out, - CupertinoIcons.zoom_out, value > artifactHtmlZoomSteps.first + 0.001 ? () => step(-1) : null, ), action( artifactZoomResetKey, 'Actual size ($percent)', Icons.restart_alt, - CupertinoIcons.arrow_counterclockwise, (value - 1).abs() > 0.001 ? () => zoom.value = 1 : null, ), action( artifactZoomInKey, 'Zoom in', Icons.zoom_in, - CupertinoIcons.zoom_in, value < artifactHtmlZoomSteps.last - 0.001 ? () => step(1) : null, ), ]; diff --git a/app/lib/features/artifacts/ui/artifact_viewer_bar.dart b/app/lib/features/artifacts/ui/artifact_viewer_bar.dart index fa6a7c61..c212199c 100644 --- a/app/lib/features/artifacts/ui/artifact_viewer_bar.dart +++ b/app/lib/features/artifacts/ui/artifact_viewer_bar.dart @@ -1,6 +1,5 @@ import 'dart:math' as math; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../ui/adaptive/glass_bar.dart'; @@ -131,14 +130,12 @@ class ArtifactViewerBar extends StatelessWidget { key: const Key('artifact-open'), label: 'Open in browser', icon: Icons.open_in_new, - cupertinoIcon: CupertinoIcons.arrow_up_right_square, onPressed: onOpen, ), ArtifactIconAction( key: const Key('artifact-copy-link'), label: 'Copy link', icon: Icons.link, - cupertinoIcon: CupertinoIcons.link, onPressed: onCopy, ), ], @@ -147,9 +144,6 @@ class ArtifactViewerBar extends StatelessWidget { key: artifactFullscreenKey, label: fullscreen ? 'Exit full screen' : 'Full screen', icon: fullscreen ? Icons.fullscreen_exit : Icons.fullscreen, - cupertinoIcon: fullscreen - ? CupertinoIcons.fullscreen_exit - : CupertinoIcons.fullscreen, onPressed: toggle, ), ]; diff --git a/app/lib/features/artifacts/ui/artifact_viewer_body.dart b/app/lib/features/artifacts/ui/artifact_viewer_body.dart index c890866d..903ba0d9 100644 --- a/app/lib/features/artifacts/ui/artifact_viewer_body.dart +++ b/app/lib/features/artifacts/ui/artifact_viewer_body.dart @@ -1,6 +1,5 @@ import 'dart:typed_data'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../ui/adaptive/floating_bar_layout.dart'; @@ -187,7 +186,6 @@ class ArtifactViewerInfoAction extends StatelessWidget { key: const Key('artifact-info'), label: 'Details', icon: Icons.info_outline, - cupertinoIcon: CupertinoIcons.info, onPressed: () => _show(context), ); } diff --git a/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart b/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart index d22a6eb5..d571e795 100644 --- a/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart +++ b/app/lib/features/schedules/ui/list/schedule_list_toolbar.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../../ui/input/app_search_field.dart'; @@ -19,20 +18,19 @@ class ScheduleRefreshAction extends StatelessWidget { const ScheduleRefreshAction({ super.key, required this.controller, - required this.cupertino, + this.cupertino, required this.onRefresh, }); final SchedulesController controller; - final bool cupertino; + final bool? cupertino; final VoidCallback onRefresh; @override Widget build(BuildContext context) => BarIconButton( key: controller.isLoading ? null : scheduleRefreshKey, - cupertino: false, icon: Icons.refresh, - cupertinoIcon: CupertinoIcons.refresh, + cupertinoIcon: Icons.refresh, label: 'Refresh schedules', busy: controller.isLoading, busyLabel: 'Refreshing schedules', @@ -51,13 +49,13 @@ class ScheduleListToolbar extends StatelessWidget { super.key, required this.controller, required this.searchController, - required this.cupertino, + this.cupertino, this.onRefresh, }); final SchedulesController controller; final TextEditingController searchController; - final bool cupertino; + final bool? cupertino; final VoidCallback? onRefresh; @override @@ -69,7 +67,6 @@ class ScheduleListToolbar extends StatelessWidget { final refresh = switch (onRefresh) { final refresh? => ScheduleRefreshAction( controller: controller, - cupertino: false, onRefresh: refresh, ), null => null, @@ -119,7 +116,6 @@ class ScheduleListToolbar extends StatelessWidget { Widget _search(BuildContext context) => AppSearchField( fieldKey: scheduleSearchFieldKey, controller: searchController, - cupertino: false, placeholder: 'Search schedules', onChanged: controller.setQuery, onCleared: controller.clearQuery, diff --git a/app/lib/features/search/ui/search_bar_controls.dart b/app/lib/features/search/ui/search_bar_controls.dart index bb5908be..7b409fdf 100644 --- a/app/lib/features/search/ui/search_bar_controls.dart +++ b/app/lib/features/search/ui/search_bar_controls.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../ui/input/app_search_field.dart'; @@ -21,7 +20,7 @@ const searchTokenHint = class SearchBarControls extends StatelessWidget { const SearchBarControls({ super.key, - required this.cupertino, + this.cupertino, required this.text, required this.kind, required this.onChanged, @@ -32,7 +31,7 @@ class SearchBarControls extends StatelessWidget { this.focusNode, }); - final bool cupertino; + final bool? cupertino; final TextEditingController text; final SearchKind kind; final ValueChanged onChanged; @@ -59,7 +58,6 @@ class SearchBarControls extends StatelessWidget { autofocus: autofocus, focusNode: focusNode, inBar: true, - cupertino: false, placeholder: 'Search pipelines, runs, artifacts and chats', onChanged: onChanged, onSubmitted: (_) => onSubmitted(), @@ -67,14 +65,13 @@ class SearchBarControls extends StatelessWidget { ), ), ), - SearchKindButton(cupertino: false, kind: kind, onSelected: onKind), + SearchKindButton(kind: kind, onSelected: onKind), BarIconButton( key: searchHelpKey, - cupertino: false, icon: Icons.info_outline, - cupertinoIcon: CupertinoIcons.info_circle, + cupertinoIcon: Icons.info_outline, label: 'Search syntax', - onPressed: () => showSearchHelp(context, cupertino: false), + onPressed: () => showSearchHelp(context), ), ], ), @@ -86,12 +83,12 @@ class SearchBarControls extends StatelessWidget { class SearchKindButton extends StatelessWidget { const SearchKindButton({ super.key, - required this.cupertino, + this.cupertino, required this.kind, required this.onSelected, }); - final bool cupertino; + final bool? cupertino; final SearchKind kind; final ValueChanged onSelected; @@ -131,7 +128,7 @@ class SearchKindButton extends StatelessWidget { } /// The query syntax, on demand instead of a paragraph above the results. -Future showSearchHelp(BuildContext context, {required bool cupertino}) { +Future showSearchHelp(BuildContext context, {bool? cupertino}) { return showDialog( context: context, builder: (context) => AlertDialog( diff --git a/app/lib/features/templates/ui/templates_frame.dart b/app/lib/features/templates/ui/templates_frame.dart index a5ba53f1..a678d69b 100644 --- a/app/lib/features/templates/ui/templates_frame.dart +++ b/app/lib/features/templates/ui/templates_frame.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../../shell/shell_bar.dart'; @@ -88,7 +87,7 @@ class TemplatesFrame extends StatelessWidget { key: templatesRefreshKey, cupertino: false, icon: Icons.refresh, - cupertinoIcon: CupertinoIcons.refresh, + cupertinoIcon: Icons.refresh, label: 'Refresh', onPressed: refreshing ? null : onRefresh, ); diff --git a/app/notes/material-cleanup-feature-surface.md b/app/notes/material-cleanup-feature-surface.md new file mode 100644 index 00000000..649815fa --- /dev/null +++ b/app/notes/material-cleanup-feature-surface.md @@ -0,0 +1,16 @@ +# Material-only feature surface cleanup + +- Removed Cupertino imports and alternate glyph metadata from artifact viewer + actions, fullscreen zoom controls, and viewer controls. +- Made search, schedule-toolbar, and artifact fullscreen compatibility flags + optional and ignored while retaining shared adaptive API arguments required + by other lanes. Material icons are used for those required compatibility + glyph parameters. +- Focused checks: `tool/memwatch/full.sh` ran artifact actions/fullscreen and + controls, search bar layout, schedule refresh, and template layout tests: 30 + passed, 0 failed. +- `tool/analyze.sh`: clean. +- No rendered behavior was intentionally changed; controls remain the existing + Material widgets and layouts. +- Remaining shared compatibility metadata/flags are outside this focused edit + and should be removed only after all callers migrate during final integration. From 87a568a7b4dde70bf7a48e87b3207659c15d516f Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:05:45 +0000 Subject: [PATCH 4/8] Remove dead Cupertino chat paths Keep the chat transcript and toolbar on their existing Material behavior while removing obsolete Cupertino-only helpers, arguments, and icon metadata. Preserve compatibility parameters where callers outside this lane still require them. --- .../conversation/chat_bar_control_style.dart | 16 ---------------- .../conversation/chat_task_presentation.dart | 4 ---- .../chat/conversation/chat_thread_view.dart | 5 ----- .../features/chat/ui/sessions/chat_adaptive.dart | 4 ++-- .../chat/ui/transcript/chat_code_hover.dart | 13 ++++--------- .../chat/ui/transcript/chat_copy_button.dart | 8 +------- .../chat/ui/transcript/chat_markdown_view.dart | 9 +-------- .../chat/ui/transcript/chat_message_bubble.dart | 16 +++------------- .../chat/ui/transcript/chat_message_view.dart | 10 ++++------ app/notes/material-chat-cupertino-cleanup.md | 14 ++++++++++++++ .../ui/transcript/chat_bubble_color_test.dart | 6 ++---- 11 files changed, 31 insertions(+), 74 deletions(-) create mode 100644 app/notes/material-chat-cupertino-cleanup.md diff --git a/app/lib/features/chat/conversation/chat_bar_control_style.dart b/app/lib/features/chat/conversation/chat_bar_control_style.dart index 2536c089..5bd04969 100644 --- a/app/lib/features/chat/conversation/chat_bar_control_style.dart +++ b/app/lib/features/chat/conversation/chat_bar_control_style.dart @@ -23,19 +23,3 @@ ButtonStyle chatBarTextButtonStyle( /// Horizontal padding inside the bar's text buttons (model, mode). const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12); - -/// Puts [content] (a button's child) in the bar's foreground colour: the -/// chat's tint if it has one, else `onSurfaceVariant`. Kept for existing -/// callers; the Material path colours buttons with [chatBarTextButtonStyle]. -Widget chatBarCupertinoContent(BuildContext context, Widget content) { - final color = - ChatBarTintScope.foregroundOf(context) ?? - Theme.of(context).colorScheme.onSurfaceVariant; - return IconTheme.merge( - data: IconThemeData(color: color), - child: DefaultTextStyle.merge( - style: TextStyle(color: color), - child: content, - ), - ); -} diff --git a/app/lib/features/chat/conversation/chat_task_presentation.dart b/app/lib/features/chat/conversation/chat_task_presentation.dart index 01a649db..1a31a194 100644 --- a/app/lib/features/chat/conversation/chat_task_presentation.dart +++ b/app/lib/features/chat/conversation/chat_task_presentation.dart @@ -3,10 +3,6 @@ import 'package:flutter/material.dart'; import '../domain/chat_task_metadata.dart'; import '../../../ui/text/monospace.dart'; -/// Always false: the app is Material-only. Kept so existing callers compile; -/// a later run removes it with its callers. -bool taskCupertino(BuildContext context) => false; - Color taskSecondary(BuildContext context) => Theme.of(context).colorScheme.onSurfaceVariant; diff --git a/app/lib/features/chat/conversation/chat_thread_view.dart b/app/lib/features/chat/conversation/chat_thread_view.dart index 35abf0e4..8e04d58c 100644 --- a/app/lib/features/chat/conversation/chat_thread_view.dart +++ b/app/lib/features/chat/conversation/chat_thread_view.dart @@ -2,7 +2,6 @@ import '../../../shell/windows/window_scope.dart'; import '../../terminal/terminal_open_action.dart'; import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -1408,9 +1407,6 @@ class _ChatThreadViewState extends State { identifier: 'chat-files-toggle', onPressed: _toggleFiles, materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined, - cupertinoIcon: _filesVisible - ? CupertinoIcons.folder_fill - : CupertinoIcons.folder, ), ], moreActions: [ @@ -1422,7 +1418,6 @@ class _ChatThreadViewState extends State { label: 'Chat details', onPressed: _openInfo, materialIcon: Icons.info_outline, - cupertinoIcon: CupertinoIcons.info, ), ...widget.paneControls, chatShellRunMenuAction(onPressed: _runShellFromMenu), diff --git a/app/lib/features/chat/ui/sessions/chat_adaptive.dart b/app/lib/features/chat/ui/sessions/chat_adaptive.dart index 10884cd3..bd13b0d8 100644 --- a/app/lib/features/chat/ui/sessions/chat_adaptive.dart +++ b/app/lib/features/chat/ui/sessions/chat_adaptive.dart @@ -15,7 +15,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable { required this.label, required this.onPressed, required this.materialIcon, - required this.cupertinoIcon, + this.cupertinoIcon, this.identifier, }); @@ -24,7 +24,7 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable { final IconData materialIcon; /// Kept for callers; the Material toolbar always draws [materialIcon]. - final IconData cupertinoIcon; + final IconData? cupertinoIcon; final String? identifier; /// A narrow bar moves it into its More menu, under the bar's host's icon. diff --git a/app/lib/features/chat/ui/transcript/chat_code_hover.dart b/app/lib/features/chat/ui/transcript/chat_code_hover.dart index 8e8fd18c..5f002184 100644 --- a/app/lib/features/chat/ui/transcript/chat_code_hover.dart +++ b/app/lib/features/chat/ui/transcript/chat_code_hover.dart @@ -16,7 +16,7 @@ class ChatCodeHover { Object token, String text, Offset pointer, { - required bool cupertino, + bool? cupertino, }) { if (_disposed) return; hide(); @@ -64,11 +64,7 @@ class ChatCodeHover { child: Material( elevation: 3, borderRadius: BorderRadius.circular(8), - child: ChatCopyButton( - text: text, - cupertino: false, - showLabel: true, - ), + child: ChatCopyButton(text: text, showLabel: true), ), ), ), @@ -132,12 +128,12 @@ class ChatCodeCopyRegion extends StatefulWidget { const ChatCodeCopyRegion({ super.key, required this.code, - required this.cupertino, + this.cupertino, required this.label, required this.child, }); final String code; - final bool cupertino; + final bool? cupertino; final Widget label, child; @override State createState() => _ChatCodeCopyRegionState(); @@ -170,7 +166,6 @@ class _ChatCodeCopyRegionState extends State { child: SelectionContainer.disabled( child: ChatCopyButton( text: widget.code, - cupertino: widget.cupertino, showLabel: true, ), ), diff --git a/app/lib/features/chat/ui/transcript/chat_copy_button.dart b/app/lib/features/chat/ui/transcript/chat_copy_button.dart index 8504e1d6..6c291541 100644 --- a/app/lib/features/chat/ui/transcript/chat_copy_button.dart +++ b/app/lib/features/chat/ui/transcript/chat_copy_button.dart @@ -12,15 +12,9 @@ const String chatCopiedLabel = 'Copied'; /// the clipboard. It shows a check for a moment after copying, so the operator /// sees the copy landed without a separate toast. class ChatCopyButton extends StatefulWidget { - const ChatCopyButton({ - super.key, - required this.text, - required this.cupertino, - this.showLabel = false, - }); + const ChatCopyButton({super.key, required this.text, this.showLabel = false}); final String text; - final bool cupertino; final bool showLabel; @override diff --git a/app/lib/features/chat/ui/transcript/chat_markdown_view.dart b/app/lib/features/chat/ui/transcript/chat_markdown_view.dart index 3bc1506d..af2862d6 100644 --- a/app/lib/features/chat/ui/transcript/chat_markdown_view.dart +++ b/app/lib/features/chat/ui/transcript/chat_markdown_view.dart @@ -202,7 +202,6 @@ class _ChatMarkdownViewState extends State { ); return ChatCodeCopyRegion( code: code, - cupertino: false, label: Text(markdownCodeLabel(language), style: labelStyle), child: DecoratedBox( decoration: BoxDecoration(color: _codeFill(context)), @@ -274,13 +273,7 @@ class _ChatMarkdownViewState extends State { ), onEnter: (event) { if (_route?.isCurrent != false) { - _codeHover.show( - context, - token, - text, - event.position, - cupertino: false, - ); + _codeHover.show(context, token, text, event.position); } }, onExit: (_) => _codeHover.scheduleHide(token), diff --git a/app/lib/features/chat/ui/transcript/chat_message_bubble.dart b/app/lib/features/chat/ui/transcript/chat_message_bubble.dart index df55e3a9..db8e70fe 100644 --- a/app/lib/features/chat/ui/transcript/chat_message_bubble.dart +++ b/app/lib/features/chat/ui/transcript/chat_message_bubble.dart @@ -31,13 +31,8 @@ Color chatBubbleFill(BuildContext context, Color base) { /// in the host's own surface roles. The agent's turn has no bubble at all; its /// text sits on the page, so only the operator's words are enclosed. class ChatUserBubble extends StatelessWidget { - const ChatUserBubble({ - super.key, - required this.cupertino, - required this.child, - }); + const ChatUserBubble({super.key, required this.child}); - final bool cupertino; final Widget child; static const BorderRadius _radius = BorderRadius.all(Radius.circular(20)); @@ -65,13 +60,8 @@ class ChatUserBubble extends StatelessWidget { /// The agent's answer drawn straight on the page. Material keeps a transparent /// surface so disclosure ListTiles still paint their ink. class ChatAgentSurface extends StatelessWidget { - const ChatAgentSurface({ - super.key, - required this.cupertino, - required this.child, - }); + const ChatAgentSurface({super.key, required this.child}); - final bool cupertino; final Widget child; @override @@ -81,7 +71,7 @@ class ChatAgentSurface extends StatelessWidget { /// The transcript's reading text: the host's large body role, so answers read /// at a comfortable size and still follow the operator's text scaling. -TextStyle? chatMessageTextStyle(BuildContext context, bool cupertino) => +TextStyle? chatMessageTextStyle(BuildContext context, [bool? cupertino]) => Theme.of(context).textTheme.bodyLarge; /// The empty-line gap between two paragraphs of a reply: about one line of diff --git a/app/lib/features/chat/ui/transcript/chat_message_view.dart b/app/lib/features/chat/ui/transcript/chat_message_view.dart index c2787aaf..8a87b9fd 100644 --- a/app/lib/features/chat/ui/transcript/chat_message_view.dart +++ b/app/lib/features/chat/ui/transcript/chat_message_view.dart @@ -87,7 +87,7 @@ class ChatMessageView extends StatelessWidget { : _agentRow( context, content, - ChatAgentSurface(cupertino: false, child: body), + ChatAgentSurface(child: body), gutter, ), ), @@ -117,7 +117,7 @@ class ChatMessageView extends StatelessWidget { ); final hasTimestamp = chatMessageCreatedAt(_userMessage) != null; if (thumbnails.isEmpty && footer.isEmpty && !hasTimestamp) { - return ChatUserBubble(cupertino: false, child: body); + return ChatUserBubble(child: body); } return Column( mainAxisSize: MainAxisSize.min, @@ -132,7 +132,7 @@ class ChatMessageView extends StatelessWidget { if (thumbnails.isNotEmpty && content.isNotEmpty) const SizedBox(height: 6), if (content.isNotEmpty || thumbnails.isEmpty) - ChatUserBubble(cupertino: false, child: body), + ChatUserBubble(child: body), if (footer.isNotEmpty) ...[ const SizedBox(height: 2), Wrap( @@ -181,9 +181,7 @@ class ChatMessageView extends StatelessWidget { double gutter, ) { final copyText = row['streaming'] == true ? '' : _answerText(_partsOf(row)); - final copy = copyText.isEmpty - ? null - : ChatCopyButton(text: copyText, cupertino: false); + final copy = copyText.isEmpty ? null : ChatCopyButton(text: copyText); if (gutter <= 0) return _agentTurn(context, content, answer, copy); return ChatCopyGutterRow( width: gutter, diff --git a/app/notes/material-chat-cupertino-cleanup.md b/app/notes/material-chat-cupertino-cleanup.md new file mode 100644 index 00000000..b84ba493 --- /dev/null +++ b/app/notes/material-chat-cupertino-cleanup.md @@ -0,0 +1,14 @@ +# Material chat Cupertino cleanup + +- Removed dead Material-only conversation helpers and the unused Cupertino icon + metadata from the thread header; `ChatBarAction.cupertinoIcon` remains an + optional ignored compatibility parameter for callers in other chat lanes. +- Removed unused `cupertino` arguments from transcript bubbles and copy-button + construction while preserving the existing Material widgets and behavior. +- Focused UI states covered: transcript bubble color rendering, message layout, + and chat thread view/header behavior. +- Checks: `tool/memwatch/full.sh 'test/features/chat/ui/transcript/chat_bubble_color_test.dart test/features/chat/ui/transcript/chat_message_view_test.dart test/features/chat/conversation/chat_thread_view_test.dart'` + — PASS (24 passed); `tool/analyze.sh` — clean. +- No visual redesign or browser/device capture was needed: the edits remove + unused parameters and alternate icon metadata without changing rendered + Material controls, layout, focus, scrolling, or navigation behavior. diff --git a/app/test/features/chat/ui/transcript/chat_bubble_color_test.dart b/app/test/features/chat/ui/transcript/chat_bubble_color_test.dart index 2d953144..bbf21c73 100644 --- a/app/test/features/chat/ui/transcript/chat_bubble_color_test.dart +++ b/app/test/features/chat/ui/transcript/chat_bubble_color_test.dart @@ -10,7 +10,7 @@ void main() { }) async { final bubble = ChatBubbleColor( name: color, - child: const ChatUserBubble(cupertino: false, child: Text('Hello')), + child: const ChatUserBubble(child: Text('Hello')), ); await tester.pumpWidget( MaterialApp( @@ -68,9 +68,7 @@ void main() { testWidgets('a bubble with no colour scope stays neutral', (tester) async { await tester.pumpWidget( const MaterialApp( - home: Scaffold( - body: ChatUserBubble(cupertino: false, child: Text('Hello')), - ), + home: Scaffold(body: ChatUserBubble(child: Text('Hello'))), ), ); final context = tester.element(find.byType(ChatUserBubble)); From 214bbbc54fc15b89662af821e4b8be68a920fbe1 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:05:55 +0000 Subject: [PATCH 5/8] Remove Cupertino branches from terminal chat shell Keep the existing Material terminal and chat-shell behavior while removing live Cupertino widgets, icon metadata, and alternate-host branches. Retain only the documented optional compatibility parameters until remaining callers migrate. --- .../chat/conversation/chat_composer_bar.dart | 3 +- .../chat/conversation/chat_thread_view.dart | 8 +---- .../chat/shell/chat_shell_card_actions.dart | 2 -- .../chat/shell/chat_shell_dismiss.dart | 8 +---- .../chat/shell/chat_shell_history_chip.dart | 2 +- .../shell/chat_shell_history_output_page.dart | 18 +++-------- .../chat/shell/chat_shell_history_view.dart | 3 +- .../chat/shell/chat_shell_mode_indicator.dart | 4 +-- .../chat/shell/chat_shell_output_view.dart | 4 --- .../chat/shell/chat_shell_run_card.dart | 10 ++----- .../chat/shell/chat_shell_run_dialog.dart | 16 ++++------ .../chat/shell/chat_shell_status.dart | 7 +---- .../chat/shell/chat_shell_terminal_keys.dart | 2 -- .../chat/shell/chat_shell_terminal_page.dart | 12 ++------ .../chat/shell/chat_shell_terminal_theme.dart | 4 +-- .../chat/shell/chat_shell_terminal_view.dart | 6 ++-- .../chat/shell/chat_shell_thread_support.dart | 3 +- app/lib/features/terminal/terminal_body.dart | 12 +++----- app/lib/features/terminal/terminal_menu.dart | 4 --- app/lib/features/terminal/terminal_page.dart | 30 ++++--------------- app/lib/features/terminal/terminal_panel.dart | 14 ++------- .../terminal/terminal_shortcut_bubble.dart | 11 ++----- app/lib/features/terminal/terminal_stage.dart | 3 -- .../features/terminal/terminal_surface.dart | 20 ++++--------- .../features/terminal/terminal_tab_strip.dart | 7 ----- .../terminal/terminal_toggle_button.dart | 10 +++---- .../features/terminal/terminal_window.dart | 4 +-- .../material-cleanup-terminal-chat-shell.md | 14 +++++++++ app/test/features/terminal/terminal_app.dart | 3 +- .../terminal/terminal_chat_tab_test.dart | 1 - 30 files changed, 66 insertions(+), 179 deletions(-) create mode 100644 app/notes/material-cleanup-terminal-chat-shell.md 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: { From 13a5e1dee03a848d5eb8a32a57c97e7f67585464 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:08:06 +0000 Subject: [PATCH 6/8] Remove Cupertino branches from probe fixtures Keep the chat and graph fixtures aligned with the app's Material-only UI by removing alternate Cupertino hosts, imports, and query-controlled rendering paths. Preserve the existing Material scenarios and document the focused probe coverage. --- app/notes/material-chat-graph-probes.md | 7 +++++ app/tool/chat_activity_dots_probe.dart | 16 +++------- app/tool/chat_approvals_probe.dart | 15 --------- app/tool/chat_composer_probe_entry.dart | 23 ++------------ app/tool/chat_markdown_probe.dart | 17 +--------- app/tool/chat_markdown_wire_probe.dart | 20 +----------- app/tool/chat_message_probe.dart | 15 --------- app/tool/chat_sessions_probe_entry.dart | 19 ----------- app/tool/chat_wire_probe.dart | 18 ----------- app/tool/graph_canvas_probe.dart | 20 ++---------- app/tool/graph_node_probe.dart | 34 ++++++++------------ app/tool/graph_zoom_probe.dart | 20 +----------- app/tool/pipeline_graph_tab_probe.dart | 26 ++------------- app/tool/run_detail_graph_probe.dart | 15 +-------- app/tool/run_graph_probe.dart | 22 ++----------- app/tool/stage_definition_probe.dart | 42 +++++-------------------- 16 files changed, 44 insertions(+), 285 deletions(-) create mode 100644 app/notes/material-chat-graph-probes.md diff --git a/app/notes/material-chat-graph-probes.md b/app/notes/material-chat-graph-probes.md new file mode 100644 index 00000000..379fc301 --- /dev/null +++ b/app/notes/material-chat-graph-probes.md @@ -0,0 +1,7 @@ +# Material chat and graph probes + +- Removed Cupertino imports, host branches, and local style flags from the assigned chat and graph/stage-definition Dart probes. +- Preserved Material scaffolds, dark/light themes, text scaling, fixture data, callbacks, and browser interaction states. +- Focused watchdog tests: 39 passed across graph widgets and chat thread/composer coverage. +- `tool/analyze.sh`: clean, 0 errors, 0 warnings. +- Node syntax checks passed for the corresponding probe drivers. No browser capture was run; this cleanup does not alter intended Material rendering. diff --git a/app/tool/chat_activity_dots_probe.dart b/app/tool/chat_activity_dots_probe.dart index 02b44b25..1fa7c011 100644 --- a/app/tool/chat_activity_dots_probe.dart +++ b/app/tool/chat_activity_dots_probe.dart @@ -1,10 +1,7 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/features/chat/ui/transcript/chat_turn_activity_view.dart'; -const _style = String.fromEnvironment('PROBE_STYLE', defaultValue: 'material'); - /// Visual check for the streaming activity line: the pending dots beside /// "Responding Ns" at a few text sizes, in light and dark. void main() { @@ -23,14 +20,9 @@ void main() { ); final body = ListView(children: [line(1), line(1.5), line(2)]); runApp( - _style == 'cupertino' - ? CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold(child: SafeArea(child: body)), - ) - : MaterialApp( - theme: ThemeData(brightness: Brightness.dark), - home: Scaffold(body: SafeArea(child: body)), - ), + MaterialApp( + theme: ThemeData(brightness: Brightness.dark), + home: Scaffold(body: SafeArea(child: body)), + ), ); } diff --git a/app/tool/chat_approvals_probe.dart b/app/tool/chat_approvals_probe.dart index 27e2d398..96a3ca34 100644 --- a/app/tool/chat_approvals_probe.dart +++ b/app/tool/chat_approvals_probe.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -130,11 +129,6 @@ class _ApprovalsGateway implements ApiGateway { }; } -const _style = String.fromEnvironment( - 'CHAT_APPROVALS_PROBE_STYLE', - defaultValue: 'material', -); - void main() { final gateway = _ApprovalsGateway(); final thread = ChatThreadView( @@ -143,15 +137,6 @@ void main() { title: 'Probe conversation', onBack: () {}, ); - if (_style == 'cupertino') { - runApp( - CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold(child: SafeArea(child: thread)), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/chat_composer_probe_entry.dart b/app/tool/chat_composer_probe_entry.dart index 1d6b7219..3c81ef98 100644 --- a/app/tool/chat_composer_probe_entry.dart +++ b/app/tool/chat_composer_probe_entry.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -203,12 +202,7 @@ Widget _framed(Widget child) => _probeWidth == 0 child: SizedBox(width: _probeWidth.toDouble(), child: child), ); -const _probeStyle = String.fromEnvironment( - 'CHAT_COMPOSER_PROBE_STYLE', - defaultValue: 'material', -); - -/// Browser overrides: `?platform=cupertino|material`, `?theme=dark|light`, +/// Browser overrides: `?theme=dark|light`, /// `?long=1`, `?paras=1` (a chunked multi-paragraph reply), `?tasks=`, `?mode=0` (no permission mode recorded) and /// `?model=0` (a backend without models). `?perf=` and `?stream=` are /// the long-transcript performance fixture (see chat_perf_fixture.dart). @@ -222,8 +216,7 @@ int get _probeTasks => int.tryParse(_query['tasks'] ?? '') ?? 0; void main() { final gateway = _ProbeGateway(); - final cupertino = (_query['platform'] ?? _probeStyle) == 'cupertino'; - final dark = _query['theme'] == null ? cupertino : _query['theme'] == 'dark'; + final dark = _query['theme'] == 'dark'; final thread = ChatThreadView( gateway: gateway, sessionId: 'probe-composer', @@ -262,17 +255,6 @@ void main() { () => _press('chat-composer-primary'), ); } - if (cupertino) { - runApp( - CupertinoApp( - theme: CupertinoThemeData( - brightness: dark ? Brightness.dark : Brightness.light, - ), - home: CupertinoPageScaffold(child: _framed(SafeArea(child: thread))), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( @@ -290,7 +272,6 @@ void _press(String key) { void visit(Element element) { final widget = element.widget; if (widget.key == Key(key)) { - if (widget is CupertinoButton) widget.onPressed?.call(); if (widget is ButtonStyleButton) widget.onPressed?.call(); if (widget is IconButton) widget.onPressed?.call(); return; diff --git a/app/tool/chat_markdown_probe.dart b/app/tool/chat_markdown_probe.dart index 5de848a0..befc34aa 100644 --- a/app/tool/chat_markdown_probe.dart +++ b/app/tool/chat_markdown_probe.dart @@ -1,13 +1,7 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/features/chat/ui/transcript/chat_markdown_view.dart'; -const _style = String.fromEnvironment( - 'CHAT_MARKDOWN_PROBE_STYLE', - defaultValue: 'material', -); - const _sample = ''' # Heading one ## Heading two @@ -36,21 +30,12 @@ Bare https://example.com/auto link. literal html and ~~strikethrough~~ stay text. '''; -/// One assistant markdown sample for the Material and Cupertino dark captures. +/// One assistant markdown sample for a Material dark capture. void main() { final content = ListView( padding: const EdgeInsets.all(16), children: const [ChatMarkdownView(text: _sample)], ); - if (_style == 'cupertino') { - runApp( - CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold(child: SafeArea(child: content)), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/chat_markdown_wire_probe.dart b/app/tool/chat_markdown_wire_probe.dart index 4cdf75f5..85b0a7d4 100644 --- a/app/tool/chat_markdown_wire_probe.dart +++ b/app/tool/chat_markdown_wire_probe.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -10,7 +9,7 @@ import 'package:pipelines_app/features/chat/screen.dart'; /// the real thread render one server-shaped conversation whose assistant text /// is formatted markdown and whose user text must stay byte-exact. /// -/// Material and Cupertino hosts are the same fixture built with +/// The Material host is the same fixture built with /// `CHAT_MARKDOWN_WIRE_PROBE_STYLE`. class _FixtureGateway implements ApiGateway { final _frames = StreamController.broadcast(); @@ -86,28 +85,11 @@ const String _answer = '\n' 'Literal markup and [unsafe](javascript:alert) stay visible.'; -const _style = String.fromEnvironment( - 'CHAT_MARKDOWN_WIRE_PROBE_STYLE', - defaultValue: 'material', -); - void main() { final screen = ChatScreen( gateway: _FixtureGateway(), onSessionSelected: null, ); - if (_style == 'cupertino') { - runApp( - CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold( - navigationBar: const CupertinoNavigationBar(middle: Text('Chat')), - child: SafeArea(child: screen), - ), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/chat_message_probe.dart b/app/tool/chat_message_probe.dart index be35537f..d8f7ceab 100644 --- a/app/tool/chat_message_probe.dart +++ b/app/tool/chat_message_probe.dart @@ -1,16 +1,10 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/features/chat/domain/chat_transcript.dart'; import 'package:pipelines_app/features/chat/ui/transcript/chat_message_view.dart'; -const _style = String.fromEnvironment( - 'CHAT_MESSAGE_PROBE_STYLE', - defaultValue: 'material', -); - /// Visible fixture for one user row, one folded assistant turn and one live /// turn whose newest reasoning step grows every half second. The unknown part /// and the tool body start collapsed so the browser probe has to open them. @@ -61,15 +55,6 @@ void main() { }, ]); final content = _LiveTranscript(rows: rows); - if (_style == 'cupertino') { - runApp( - CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold(child: SafeArea(child: content)), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/chat_sessions_probe_entry.dart b/app/tool/chat_sessions_probe_entry.dart index 7323b6db..99c1148e 100644 --- a/app/tool/chat_sessions_probe_entry.dart +++ b/app/tool/chat_sessions_probe_entry.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -124,11 +123,6 @@ class _FixtureGateway implements ApiGateway { } } -const _probeStyle = String.fromEnvironment( - 'CHAT_PROBE_STYLE', - defaultValue: 'material', -); - void main() { final dark = Uri.base.queryParameters['dark'] == '1'; final unseen = Uri.base.queryParameters['unseen'] == '1'; @@ -145,19 +139,6 @@ void main() { ]); } final home = ChatSessionsScreen(gateway: gateway, onOpen: (_) {}); - // `?platform=cupertino` overrides the compile-time style. - final style = Uri.base.queryParameters['platform'] ?? _probeStyle; - if (style == 'cupertino') { - runApp( - CupertinoApp( - theme: CupertinoThemeData( - brightness: dark ? Brightness.dark : Brightness.light, - ), - home: home, - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/chat_wire_probe.dart b/app/tool/chat_wire_probe.dart index dcd07254..22c01e2b 100644 --- a/app/tool/chat_wire_probe.dart +++ b/app/tool/chat_wire_probe.dart @@ -1,6 +1,5 @@ import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -218,28 +217,11 @@ class _FixtureGateway implements ApiGateway { }; } -const _style = String.fromEnvironment( - 'CHAT_WIRE_PROBE_STYLE', - defaultValue: 'material', -); - void main() { final screen = ChatScreen( gateway: _FixtureGateway(), onSessionSelected: null, ); - if (_style == 'cupertino') { - runApp( - CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold( - navigationBar: const CupertinoNavigationBar(middle: Text('Chat')), - child: SafeArea(child: screen), - ), - ), - ); - return; - } runApp( MaterialApp( theme: ThemeData( diff --git a/app/tool/graph_canvas_probe.dart b/app/tool/graph_canvas_probe.dart index 19a6a4cd..58ab1931 100644 --- a/app/tool/graph_canvas_probe.dart +++ b/app/tool/graph_canvas_probe.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -36,35 +35,22 @@ JsonMap _definition() => { /// Isolated browser fixture for `DefinitionGraphView` only. /// -/// Not wired into the app or shell. `style=cupertino` selects the native -/// Cupertino host, `scale=2` applies a real 2x text scale to the graph viewport, +/// Not wired into the app or shell. `scale=2` applies a real 2x text scale to the graph viewport, /// and a click reports the exact stage key in the status line. void main() { final parameters = Uri.base.queryParameters; - final cupertino = parameters['style'] == 'cupertino'; final scale = double.tryParse(parameters['scale'] ?? '') ?? 1; - runApp(_ProbeApp(cupertino: cupertino, scale: scale)); + runApp(_ProbeApp(scale: scale)); } class _ProbeApp extends StatelessWidget { - const _ProbeApp({required this.cupertino, required this.scale}); + const _ProbeApp({required this.scale}); - final bool cupertino; final double scale; @override Widget build(BuildContext context) { final page = _ProbePage(scale: scale); - if (cupertino) { - return CupertinoApp( - home: CupertinoPageScaffold( - navigationBar: const CupertinoNavigationBar( - middle: Text('Definition graph'), - ), - child: SafeArea(child: page), - ), - ); - } return MaterialApp( theme: ThemeData(platform: TargetPlatform.android), darkTheme: ThemeData( diff --git a/app/tool/graph_node_probe.dart b/app/tool/graph_node_probe.dart index 46c07f9f..ef7f1ae8 100644 --- a/app/tool/graph_node_probe.dart +++ b/app/tool/graph_node_probe.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/features/graph/domain/graph_definition.dart'; @@ -22,9 +21,7 @@ const _nodes = [ /// A fixture-only page: one measured node per definition identity, with the /// selected key reported so a browser click can prove the exact callback. class _Probe extends StatefulWidget { - const _Probe({required this.cupertino}); - - final bool cupertino; + const _Probe(); @override State<_Probe> createState() => _ProbeState(); @@ -64,27 +61,22 @@ class _ProbeState extends State<_Probe> { ), ], ); - return widget.cupertino - ? CupertinoPageScaffold(child: SafeArea(child: page)) - : Scaffold(body: SafeArea(child: page)); + return Scaffold(body: SafeArea(child: page)); } } void main() { - final cupertino = Uri.base.queryParameters['style'] == 'cupertino'; runApp( - cupertino - ? CupertinoApp(home: const _Probe(cupertino: true)) - : MaterialApp( - theme: ThemeData(platform: TargetPlatform.android), - // Stock dark theme so the forced `prefers-color-scheme` capture is - // a real dark render rather than a duplicate light one. - darkTheme: ThemeData( - platform: TargetPlatform.android, - brightness: Brightness.dark, - ), - themeMode: ThemeMode.system, - home: const _Probe(cupertino: false), - ), + MaterialApp( + theme: ThemeData(platform: TargetPlatform.android), + // Stock dark theme so the forced `prefers-color-scheme` capture is + // a real dark render rather than a duplicate light one. + darkTheme: ThemeData( + platform: TargetPlatform.android, + brightness: Brightness.dark, + ), + themeMode: ThemeMode.system, + home: const _Probe(), + ), ); } diff --git a/app/tool/graph_zoom_probe.dart b/app/tool/graph_zoom_probe.dart index 154776fe..231c2004 100644 --- a/app/tool/graph_zoom_probe.dart +++ b/app/tool/graph_zoom_probe.dart @@ -6,7 +6,6 @@ // PROBE_VARIANT=material OPENCODE_ARTIFACT_DIR=DIR node tool/graph_zoom_probe.mjs // // Server-shaped fixtures only; no server, run or operator session is touched. -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -72,37 +71,20 @@ void main() { runApp( _ProbeApp( runMode: parameters['view'] == 'run', - cupertino: parameters['style'] == 'cupertino', scale: double.tryParse(parameters['scale'] ?? '') ?? 1, ), ); } class _ProbeApp extends StatelessWidget { - const _ProbeApp({ - required this.runMode, - required this.cupertino, - required this.scale, - }); + const _ProbeApp({required this.runMode, required this.scale}); final bool runMode; - final bool cupertino; final double scale; @override Widget build(BuildContext context) { final page = _ProbePage(runMode: runMode, scale: scale); - if (cupertino) { - return CupertinoApp( - theme: const CupertinoThemeData(brightness: Brightness.dark), - home: CupertinoPageScaffold( - navigationBar: const CupertinoNavigationBar( - middle: Text('Graph viewport'), - ), - child: SafeArea(child: page), - ), - ); - } return MaterialApp( theme: ThemeData(platform: TargetPlatform.android), darkTheme: ThemeData( diff --git a/app/tool/pipeline_graph_tab_probe.dart b/app/tool/pipeline_graph_tab_probe.dart index 5e2f341d..214df6ef 100644 --- a/app/tool/pipeline_graph_tab_probe.dart +++ b/app/tool/pipeline_graph_tab_probe.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/features/pipelines/screen.dart'; @@ -7,15 +6,13 @@ import 'pipelines_probe_fixture.dart'; /// Browser fixture for the pipeline detail's real Graph tab. /// -/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and -/// `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and +/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. The screen, its list, detail, Graph tab and /// definition pane are the same widgets the app registers; only the replies /// come from the in-memory fixture. void main() { final parameters = Uri.base.queryParameters; runApp( _PipelineGraphTabProbe( - cupertino: parameters['style'] == 'cupertino', dark: parameters['dark'] == '1', scale: double.tryParse(parameters['scale'] ?? '') ?? 1, ), @@ -23,13 +20,8 @@ void main() { } class _PipelineGraphTabProbe extends StatelessWidget { - const _PipelineGraphTabProbe({ - required this.cupertino, - required this.dark, - required this.scale, - }); + const _PipelineGraphTabProbe({required this.dark, required this.scale}); - final bool cupertino; final bool dark; final double scale; @@ -45,20 +37,6 @@ class _PipelineGraphTabProbe extends StatelessWidget { gateway: PipelinesProbeGateway(), embedded: true, ); - if (cupertino) { - return CupertinoApp( - title: 'Pipeline graph fixture', - debugShowCheckedModeBanner: false, - theme: CupertinoThemeData( - brightness: dark ? Brightness.dark : Brightness.light, - ), - builder: scaled, - // The application shell owns the navigation bar; the probe keeps the - // same embedded screen inside a host-native page instead of adding a - // second bar that would overlay the detail header. - home: CupertinoPageScaffold(child: SafeArea(child: screen)), - ); - } return MaterialApp( title: 'Pipeline graph fixture', debugShowCheckedModeBanner: false, diff --git a/app/tool/run_detail_graph_probe.dart b/app/tool/run_detail_graph_probe.dart index 2140fb13..9e3d88d5 100644 --- a/app/tool/run_detail_graph_probe.dart +++ b/app/tool/run_detail_graph_probe.dart @@ -9,7 +9,6 @@ // Server-shaped fixtures only: a fake gateway answers the same get_run envelope // the app consumes. The run's own pinned graph and recorded steps drive the // Graph tab; no server or operator run is touched. -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/runs/data/runs_repository.dart'; @@ -83,22 +82,18 @@ JsonMap _run({required bool graph}) => { void main() { final params = Uri.base.queryParameters; - final cupertino = params['platform'] == 'cupertino'; final dark = params['theme'] == 'dark'; final scale = double.tryParse(params['scale'] ?? '') ?? 1; final run = _run(graph: params['case'] != 'missing'); - runApp(_ProbeBody(cupertino: cupertino, dark: dark, scale: scale, run: run)); + runApp(_ProbeBody(dark: dark, scale: scale, run: run)); } class _ProbeBody extends StatefulWidget { const _ProbeBody({ - required this.cupertino, required this.dark, required this.scale, required this.run, }); - - final bool cupertino; final bool dark; final double scale; final JsonMap run; @@ -139,14 +134,6 @@ class _ProbeBodyState extends State<_ProbeBody> { ).copyWith(textScaler: TextScaler.linear(widget.scale)), child: app!, ); - if (widget.cupertino) { - return CupertinoApp( - title: 'Run graph fixture', - theme: CupertinoThemeData(brightness: theme), - builder: scaled, - home: CupertinoPageScaffold(child: SafeArea(child: detail)), - ); - } return MaterialApp( title: 'Run graph fixture', theme: ThemeData(brightness: theme, platform: TargetPlatform.android), diff --git a/app/tool/run_graph_probe.dart b/app/tool/run_graph_probe.dart index dfb0fe4c..f9664005 100644 --- a/app/tool/run_graph_probe.dart +++ b/app/tool/run_graph_probe.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; @@ -86,15 +85,14 @@ JsonMap _finishedRun() => { /// Isolated browser fixture for `RunGraphView` only. /// -/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme and -/// `scale=2` a real 2x text scale. `case=finished` records a resolved success +/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. +/// `case=finished` records a resolved success /// terminal instead of the running path; `case=missing` omits the graph. A /// click reports the exact visited stage key; unvisited nodes report nothing. void main() { final parameters = Uri.base.queryParameters; runApp( _ProbeApp( - cupertino: parameters['style'] == 'cupertino', dark: parameters['dark'] == '1', scale: double.tryParse(parameters['scale'] ?? '') ?? 1, fixture: parameters['case'] ?? 'running', @@ -104,13 +102,10 @@ void main() { class _ProbeApp extends StatelessWidget { const _ProbeApp({ - required this.cupertino, required this.dark, required this.scale, required this.fixture, }); - - final bool cupertino; final bool dark; final double scale; final String fixture; @@ -122,19 +117,6 @@ class _ProbeApp extends StatelessWidget { graph: fixture == 'missing' ? null : _graph(), run: fixture == 'finished' ? _finishedRun() : _runningRun(), ); - if (cupertino) { - return CupertinoApp( - theme: CupertinoThemeData( - brightness: dark ? Brightness.dark : Brightness.light, - ), - home: CupertinoPageScaffold( - navigationBar: const CupertinoNavigationBar( - middle: Text('Run graph'), - ), - child: SafeArea(child: page), - ), - ); - } return MaterialApp( theme: ThemeData( platform: TargetPlatform.android, diff --git a/app/tool/stage_definition_probe.dart b/app/tool/stage_definition_probe.dart index 046bf874..05d10a7b 100644 --- a/app/tool/stage_definition_probe.dart +++ b/app/tool/stage_definition_probe.dart @@ -1,9 +1,7 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:pipelines_app/core/api_gateway.dart'; import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart'; -import 'package:pipelines_app/ui/adaptive/host.dart'; /// A definition with an authored stage (including an unknown future field), a /// declared route to a terminal, and no declaration for `ghost`. @@ -44,14 +42,13 @@ JsonMap _graph() => { /// Isolated browser fixture for the read-only stage definition pane. /// -/// `style=cupertino` selects the Cupertino host, `dark=1` its dark theme, -/// `scale=2` a real 2x text scale. Every button opens the exact helper the +/// `dark=1` selects the dark theme and `scale=2` a real 2x text scale. +/// Every button opens the exact helper the /// pipeline graph hook will call; nothing contacts a server or reads a run. void main() { final parameters = Uri.base.queryParameters; runApp( _ProbeApp( - cupertino: parameters['style'] == 'cupertino', dark: parameters['dark'] == '1', scale: double.tryParse(parameters['scale'] ?? '') ?? 1, ), @@ -59,13 +56,8 @@ void main() { } class _ProbeApp extends StatelessWidget { - const _ProbeApp({ - required this.cupertino, - required this.dark, - required this.scale, - }); + const _ProbeApp({required this.dark, required this.scale}); - final bool cupertino; final bool dark; final double scale; @@ -77,20 +69,6 @@ class _ProbeApp extends StatelessWidget { ).copyWith(textScaler: TextScaler.linear(scale)), child: child ?? const SizedBox.shrink(), ); - if (cupertino) { - return CupertinoApp( - theme: CupertinoThemeData( - brightness: dark ? Brightness.dark : Brightness.light, - ), - builder: scaled, - home: const CupertinoPageScaffold( - navigationBar: CupertinoNavigationBar( - middle: Text('Stage definition fixture'), - ), - child: SafeArea(child: _Launcher()), - ), - ); - } return MaterialApp( theme: ThemeData( platform: TargetPlatform.android, @@ -124,7 +102,6 @@ class _Launcher extends StatelessWidget { @override Widget build(BuildContext context) { - final cupertino = usesCupertinoHost(context); return ListView( padding: const EdgeInsets.all(16), children: [ @@ -132,15 +109,10 @@ class _Launcher extends StatelessWidget { for (final key in ['plan', '#failure', 'ghost']) Padding( padding: const EdgeInsets.only(top: 8), - child: cupertino - ? CupertinoButton.filled( - onPressed: () => _open(context, key), - child: Text('$key definition'), - ) - : FilledButton( - onPressed: () => _open(context, key), - child: Text('$key definition'), - ), + child: FilledButton( + onPressed: () => _open(context, key), + child: Text('$key definition'), + ), ), ], ); From 9e218f755a963f8829a472a52fe411af434722bb Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:11:17 +0000 Subject: [PATCH 7/8] Consolidate startup and shell on Material Remove alternate application hosts, page scaffolds, connection controls and icon metadata while preserving Material routing. Isolate navigation fixtures from native update plugins and retain separate startup-update regressions. --- app/lib/application/app.dart | 29 +------ app/lib/application/app_router.dart | 11 ++- app/lib/application/chat_destination.dart | 19 +---- app/lib/application/connection_status.dart | 57 ++++--------- app/lib/application/pipelines_app.dart | 6 +- .../application/pipelines_destination.dart | 19 +---- app/lib/application/pipelines_root.dart | 47 ++++------- app/lib/application/runs_destination.dart | 16 +--- .../application/schedules_destination.dart | 25 ++---- app/lib/application/search_destination.dart | 83 +++---------------- .../application/templates_destination.dart | 44 +++------- app/lib/shell/adaptive_shell.dart | 3 +- app/lib/shell/attention_badge.dart | 4 +- app/lib/shell/destination.dart | 13 ++- app/notes/material-startup-shell-cleanup.md | 25 ++++++ app/test/application/pipelines_app_test.dart | 2 + .../application/templates_wiring_test.dart | 2 + 17 files changed, 118 insertions(+), 287 deletions(-) create mode 100644 app/notes/material-startup-shell-cleanup.md diff --git a/app/lib/application/app.dart b/app/lib/application/app.dart index d1c8082b..38a0d568 100644 --- a/app/lib/application/app.dart +++ b/app/lib/application/app.dart @@ -1,9 +1,7 @@ -import '../ui/adaptive/platform.dart'; import '../ui/adaptive/window_margins.dart'; import '../ui/theme/app_font_controller.dart'; import '../ui/theme/app_theme.dart'; import '../ui/scale/ui_scale.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../shell/adaptive_shell.dart'; @@ -35,6 +33,9 @@ class MyApp extends StatelessWidget { onDestinationSelected = null; final Map destinationBodies; + + /// Retained for source compatibility with older callers; Material is the + /// only application host. final bool? cupertino; final AppDestination? destination; final ValueChanged? onDestinationSelected; @@ -55,28 +56,6 @@ class MyApp extends StatelessWidget { Widget _host(String? fontFamily) { final router = routerConfig; - if (cupertino ?? _platformIsCupertino) { - final theme = appCupertinoThemeWith(fontFamily: fontFamily); - if (router != null) { - return CupertinoApp.router( - title: 'Pipelines', - builder: _scaled, - theme: theme, - routerConfig: router, - ); - } - return CupertinoApp( - title: 'Pipelines', - builder: _scaled, - theme: theme, - home: AdaptiveShell( - destinationBodies: destinationBodies, - cupertino: true, - destination: destination, - onDestinationSelected: onDestinationSelected, - ), - ); - } if (router != null) { return MaterialApp.router( title: 'Pipelines', @@ -101,8 +80,6 @@ class MyApp extends StatelessWidget { ); } - bool get _platformIsCupertino => prefersCupertino(); - static Widget _scaled(BuildContext context, Widget? child) => UiScaleHost( child: WindowMargins(child: child ?? const SizedBox.shrink()), ); diff --git a/app/lib/application/app_router.dart b/app/lib/application/app_router.dart index d9e2f23e..e9c2390f 100644 --- a/app/lib/application/app_router.dart +++ b/app/lib/application/app_router.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'app_route.dart'; @@ -47,7 +46,7 @@ String routeLocation(Uri uri) { class AppRouterDelegate extends RouterDelegate with ChangeNotifier { AppRouterDelegate({ required this.builder, - required this.cupertino, + this.cupertino, this.searchBuilder, this.templatesBuilder, this.schedulesBuilder, @@ -75,7 +74,9 @@ class AppRouterDelegate extends RouterDelegate with ChangeNotifier { /// state and selection, and the standard navigation bar supplies Back. final Widget Function(BuildContext context)? searchBuilder; - final bool cupertino; + /// Retained for compatibility with older composition callers. Routes use + /// Material pages on every platform. + final bool? cupertino; final _navigatorKey = GlobalKey(); static const _pageKey = ValueKey('pipelines-shell'); @@ -119,9 +120,7 @@ class AppRouterDelegate extends RouterDelegate with ChangeNotifier { AppRoute get currentConfiguration => _route; Page _page(LocalKey key, Widget child, {bool dialog = false}) => - cupertino - ? CupertinoPage(key: key, child: child, fullscreenDialog: dialog) - : MaterialPage(key: key, child: child, fullscreenDialog: dialog); + MaterialPage(key: key, child: child, fullscreenDialog: dialog); /// A page-based Navigator supplies the Overlay, overlay portals and route /// context that native controls (action sheets, tooltips) require. The shell diff --git a/app/lib/application/chat_destination.dart b/app/lib/application/chat_destination.dart index 026fd3bf..39fa9cfc 100644 --- a/app/lib/application/chat_destination.dart +++ b/app/lib/application/chat_destination.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import '../features/chat/chat_runtime.dart'; import '../features/chat/screen.dart'; import '../features/chat/windows/chat_windows.dart'; -import '../ui/adaptive/host.dart'; import '../ui/adaptive/top_bar_notices.dart'; import 'app_session.dart'; import 'connection_status.dart'; @@ -48,7 +47,6 @@ class ChatDestination extends StatelessWidget { Widget build(BuildContext context) => AnimatedBuilder( animation: Listenable.merge([session, ?pool]), builder: (context, _) { - final cupertino = usesCupertinoHost(context); // Saved machines connect independently; their state and sign-in live // in Settings, so the chat itself carries no connection chrome. if (pool != null && pool!.servers.catalog.servers.isNotEmpty) { @@ -56,28 +54,17 @@ class ChatDestination extends StatelessWidget { } if ((server.requiresConfiguration || server.error != null) && session.endpoint == null) { - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } if (!session.everConnected) { if (session.connected) return _chatScreen(); - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } // The banner stays below the top bar; without it the chat screen // reaches the top edge (an open chat beside the list draws its own bar // there). return TopBarNotices( - notices: [ - if (!session.connected) - ConnectionBanner(session: session, cupertino: cupertino), - ], + notices: [if (!session.connected) ConnectionBanner(session: session)], child: _chatScreen(), ); }, diff --git a/app/lib/application/connection_status.dart b/app/lib/application/connection_status.dart index bbe57b46..d59fef81 100644 --- a/app/lib/application/connection_status.dart +++ b/app/lib/application/connection_status.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../core/transport/connection_state.dart'; @@ -15,12 +14,12 @@ class ConnectionGate extends StatelessWidget { super.key, required this.session, required this.server, - required this.cupertino, + this.cupertino, }); final AppSession session; final ServerEndpoint server; - final bool cupertino; + final bool? cupertino; @override Widget build(BuildContext context) { @@ -75,18 +74,14 @@ class ConnectionGate extends StatelessWidget { if (progress) Padding( padding: const EdgeInsets.only(bottom: 12), - child: cupertino - ? const CupertinoActivityIndicator() - : const CircularProgressIndicator(), + child: const CircularProgressIndicator(), ), Semantics( liveRegion: true, child: Text( title, textAlign: TextAlign.center, - style: cupertino - ? CupertinoTheme.of(context).textTheme.navTitleTextStyle - : theme.textTheme.titleMedium, + style: theme.textTheme.titleMedium, ), ), if (detail.isNotEmpty) ...[ @@ -94,15 +89,12 @@ class ConnectionGate extends StatelessWidget { Text( detail, textAlign: TextAlign.center, - style: cupertino ? null : theme.textTheme.bodyMedium, + style: theme.textTheme.bodyMedium, ), ], if (onRetry != null) ...[ const SizedBox(height: 16), - if (cupertino) - CupertinoButton(onPressed: onRetry, child: const Text('Retry')) - else - FilledButton(onPressed: onRetry, child: const Text('Retry')), + FilledButton(onPressed: onRetry, child: const Text('Retry')), ], ], ), @@ -113,14 +105,10 @@ class ConnectionGate extends StatelessWidget { /// A compact status bar above retained content after the first connection. class ConnectionBanner extends StatelessWidget { - const ConnectionBanner({ - super.key, - required this.session, - required this.cupertino, - }); + const ConnectionBanner({super.key, required this.session, this.cupertino}); final AppSession session; - final bool cupertino; + final bool? cupertino; @override Widget build(BuildContext context) { @@ -145,25 +133,19 @@ class ConnectionBanner extends StatelessWidget { detail = 'Check that the Pipelines server is running.'; onRetry = session.retry; } - final textStyle = cupertino - ? CupertinoTheme.of(context).textTheme.textStyle - : Theme.of(context).textTheme.bodyMedium; + final textStyle = Theme.of(context).textTheme.bodyMedium; return ColoredBox( - color: cupertino - ? CupertinoDynamicColor.resolve(CupertinoColors.systemGrey5, context) - : Theme.of(context).colorScheme.surfaceContainerHighest, + color: Theme.of(context).colorScheme.surfaceContainerHighest, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: Row( children: [ if (reconnecting) ...[ - cupertino - ? const CupertinoActivityIndicator(radius: 7) - : const SizedBox( - width: 14, - height: 14, - child: CircularProgressIndicator(strokeWidth: 2), - ), + const SizedBox( + width: 14, + height: 14, + child: CircularProgressIndicator(strokeWidth: 2), + ), const SizedBox(width: 10), ], Expanded( @@ -179,14 +161,7 @@ class ConnectionBanner extends StatelessWidget { ), ), const SizedBox(width: 8), - if (cupertino) - CupertinoButton( - padding: EdgeInsets.zero, - onPressed: onRetry, - child: const Text('Retry'), - ) - else - TextButton(onPressed: onRetry, child: const Text('Retry')), + TextButton(onPressed: onRetry, child: const Text('Retry')), ], ), ), diff --git a/app/lib/application/pipelines_app.dart b/app/lib/application/pipelines_app.dart index c64d9c4b..2c83a57b 100644 --- a/app/lib/application/pipelines_app.dart +++ b/app/lib/application/pipelines_app.dart @@ -2,7 +2,6 @@ import '../core/servers/chat/chat_server_pool.dart'; import '../core/servers/server_context.dart'; import '../core/servers/elevation/elevation_dialog.dart'; import '../core/servers/elevation/machine_elevation.dart'; -import '../ui/adaptive/platform.dart'; import 'dart:async'; import 'package:flutter/foundation.dart'; @@ -338,7 +337,8 @@ class _PipelinesAppState extends State type: RouteInformationReportingType.neglect, ); } - _cupertino = widget.cupertino ?? _platformIsCupertino; + // Kept as a compatibility field on the widget; composition is Material-only. + _cupertino = false; _notifications.onOpenRun = (id) { if (mounted) _delegate.goTo(AppRoute.run(id)); }; @@ -954,6 +954,4 @@ class _PipelinesAppState extends State AppDestination.search => AppRoute.search, AppDestination.settings => AppRoute.settings, }; - - bool get _platformIsCupertino => prefersCupertino(); } diff --git a/app/lib/application/pipelines_destination.dart b/app/lib/application/pipelines_destination.dart index de1b8643..fb2a9046 100644 --- a/app/lib/application/pipelines_destination.dart +++ b/app/lib/application/pipelines_destination.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import '../core/servers/server_scope.dart'; import '../features/pipelines/screen.dart'; -import '../ui/adaptive/host.dart'; import '../ui/adaptive/top_bar_notices.dart'; import 'app_session.dart'; import 'connection_status.dart'; @@ -64,30 +63,18 @@ class PipelinesDestination extends StatelessWidget { Widget build(BuildContext context) => AnimatedBuilder( animation: session, builder: (context, _) { - final cupertino = usesCupertinoHost(context); if ((server.requiresConfiguration || server.error != null) && session.endpoint == null) { - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } if (!session.everConnected) { if (session.connected) return _pipelinesScreen(); - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } // The banner stays below the top bar; without it the pipelines reach // the top edge and scroll behind the bar. return TopBarNotices( - notices: [ - if (!session.connected) - ConnectionBanner(session: session, cupertino: cupertino), - ], + notices: [if (!session.connected) ConnectionBanner(session: session)], child: _pipelinesScreen(), ); }, diff --git a/app/lib/application/pipelines_root.dart b/app/lib/application/pipelines_root.dart index 9a5090d2..8b54dffa 100644 --- a/app/lib/application/pipelines_root.dart +++ b/app/lib/application/pipelines_root.dart @@ -1,8 +1,6 @@ import 'dart:async'; import '../core/servers/chat/chat_server_pool.dart'; -import '../ui/adaptive/platform.dart'; import '../ui/adaptive/window_margins.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -307,8 +305,6 @@ class _PipelinesRootState extends State { super.dispose(); } - bool get _cupertino => prefersCupertino(); - @override Widget build(BuildContext context) { if (_booting) { @@ -318,15 +314,10 @@ class _PipelinesRootState extends State { view: View.of(context), child: Directionality( textDirection: TextDirection.ltr, - child: _cupertino - ? const CupertinoTheme( - data: appCupertinoTheme, - child: Center(child: CupertinoActivityIndicator()), - ) - : Theme( - data: appLightTheme(), - child: const Center(child: CircularProgressIndicator()), - ), + child: Theme( + data: appLightTheme(), + child: const Center(child: CircularProgressIndicator()), + ), ), ); } @@ -368,26 +359,16 @@ class _PipelinesRootState extends State { final fonts = AppFontController.instance; return ListenableBuilder( listenable: fonts, - builder: (context, _) => _cupertino - ? CupertinoApp( - title: 'Pipelines', - builder: (context, child) => UiScaleHost( - child: WindowMargins(child: child ?? const SizedBox.shrink()), - ), - theme: appCupertinoThemeWith(fontFamily: fonts.family), - debugShowCheckedModeBanner: false, - home: flow, - ) - : MaterialApp( - title: 'Pipelines', - builder: (context, child) => UiScaleHost( - child: WindowMargins(child: child ?? const SizedBox.shrink()), - ), - theme: appLightTheme(fontFamily: fonts.family), - darkTheme: appDarkTheme(fontFamily: fonts.family), - debugShowCheckedModeBanner: false, - home: flow, - ), + builder: (context, _) => MaterialApp( + title: 'Pipelines', + builder: (context, child) => UiScaleHost( + child: WindowMargins(child: child ?? const SizedBox.shrink()), + ), + theme: appLightTheme(fontFamily: fonts.family), + darkTheme: appDarkTheme(fontFamily: fonts.family), + debugShowCheckedModeBanner: false, + home: flow, + ), ); } } diff --git a/app/lib/application/runs_destination.dart b/app/lib/application/runs_destination.dart index b9440570..b4a4baef 100644 --- a/app/lib/application/runs_destination.dart +++ b/app/lib/application/runs_destination.dart @@ -4,7 +4,6 @@ import '../features/attention/notify/notification_controller.dart'; import '../features/attention/runtime/attention_controller.dart'; import '../features/runs/screen.dart'; import '../features/runs/ui/run_pipeline_link.dart'; -import '../ui/adaptive/host.dart'; import '../ui/adaptive/top_bar_notices.dart'; import 'app_session.dart'; import 'connection_status.dart'; @@ -69,22 +68,13 @@ class RunsDestination extends StatelessWidget { Widget build(BuildContext context) => AnimatedBuilder( animation: session, builder: (context, _) { - final cupertino = usesCupertinoHost(context); if ((server.requiresConfiguration || server.error != null) && session.endpoint == null) { - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } if (!session.everConnected) { if (session.connected) return _runsScreen(); - return ConnectionGate( - session: session, - server: server, - cupertino: cupertino, - ); + return ConnectionGate(session: session, server: server); } // The banner stays below the top bar; without it the runs reach the top // edge and scroll behind the bar. @@ -92,7 +82,7 @@ class RunsDestination extends StatelessWidget { notices: [ if (!session.connected || session.subscription == RunSubscriptionState.refused) - ConnectionBanner(session: session, cupertino: cupertino), + ConnectionBanner(session: session), ], child: _runsScreen(), ); diff --git a/app/lib/application/schedules_destination.dart b/app/lib/application/schedules_destination.dart index 7a96cab0..0140046b 100644 --- a/app/lib/application/schedules_destination.dart +++ b/app/lib/application/schedules_destination.dart @@ -1,7 +1,6 @@ import '../ui/adaptive/segmented_bar.dart'; import 'dart:async'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../features/schedules/data/schedules_repository.dart'; @@ -9,7 +8,6 @@ import '../features/schedules/ui/list/schedule_list_controller.dart'; import '../features/schedules/ui/list/schedule_list_toolbar.dart' show ScheduleRefreshAction; import '../features/schedules/ui/list/schedule_list_view.dart'; -import '../ui/adaptive/host.dart'; import 'app_session.dart'; import 'server_endpoint.dart'; @@ -94,24 +92,23 @@ class _SchedulesDestinationState extends State { @override Widget build(BuildContext context) { - final cupertino = usesCupertinoHost(context); // The page is built inside the builder from the session's connection and // the list controller's state; the list view itself does not listen, so a // finished read would otherwise stay on `Loading schedules…`. return AnimatedBuilder( animation: Listenable.merge([widget.session, _controller]), - builder: (context, _) => _page(cupertino), + builder: (context, _) => _page(), ); } - Widget _page(bool cupertino) { - final body = _body(cupertino); + Widget _page() { + final body = _body(); // The round Back closes the page; Refresh sits in the actions pill. final bar = SegmentedBar( - cupertino: cupertino, + cupertino: false, leading: SegmentedBackButton( key: schedulesPageBackKey, - cupertino: cupertino, + cupertino: false, onPressed: widget.onBack, ), title: 'Schedules', @@ -119,23 +116,17 @@ class _SchedulesDestinationState extends State { if (widget.session.everConnected) ScheduleRefreshAction( controller: _controller, - cupertino: cupertino, + cupertino: false, onRefresh: () => unawaited(_controller.refresh()), ), ], ); // The page reaches its top edge: the search strip floats under the bar // and the list scrolls behind both. - if (cupertino) { - return CupertinoPageScaffold( - navigationBar: bar, - child: SafeArea(top: false, bottom: false, child: body), - ); - } return Scaffold(extendBodyBehindAppBar: true, appBar: bar, body: body); } - Widget _body(bool cupertino) { + Widget _body() { if (!widget.session.everConnected) { return const Center( child: Text('Connect to the server to see schedules.'), @@ -145,7 +136,7 @@ class _SchedulesDestinationState extends State { controller: _controller, searchController: _search, scrollController: _scroll, - cupertino: cupertino, + cupertino: false, onOpen: (schedule) { final id = schedule.pipelineId; if (id != null) widget.onOpenPipeline(id); diff --git a/app/lib/application/search_destination.dart b/app/lib/application/search_destination.dart index 2360fc8a..f8e1691b 100644 --- a/app/lib/application/search_destination.dart +++ b/app/lib/application/search_destination.dart @@ -1,10 +1,8 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../ui/adaptive/segmented_bar.dart'; import '../core/api_gateway.dart'; import '../features/search/search_screen.dart'; -import '../ui/adaptive/host.dart'; import 'app_session.dart'; import 'connection_status.dart'; import 'server_endpoint.dart'; @@ -13,10 +11,8 @@ import 'server_endpoint.dart'; /// /// Before the first successful connection there is nothing to search, so the /// native connection gate is shown inside the same title bar and Close still -/// returns to the previous destination. In a Cupertino host the screen is -/// mounted once the route's entrance has completed: during that transition a -/// focus request is dropped, so mounting earlier would open Search with no -/// keyboard or caret. Material mounts it immediately as usual. +/// returns to the previous destination. The screen mounts immediately so the +/// search field retains normal focus and keyboard behavior during navigation. class SearchDestination extends StatefulWidget { const SearchDestination({ super.key, @@ -38,72 +34,21 @@ class SearchDestination extends StatefulWidget { } class _SearchDestinationState extends State { - Animation? _animation; - bool _entered = false; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - // Material's page transition keeps the autofocus request; only the - // Cupertino push needs to wait for the route to become current. - if (!usesCupertinoHost(context)) { - _entered = true; - return; - } - final animation = ModalRoute.of(context)?.animation; - if (identical(animation, _animation)) return; - _animation?.removeStatusListener(_onStatus); - _animation = animation; - if (animation == null || animation.status == AnimationStatus.completed) { - _entered = true; - } else { - animation.addStatusListener(_onStatus); - } - } - - void _onStatus(AnimationStatus status) { - if (status != AnimationStatus.completed) return; - WidgetsBinding.instance.addPostFrameCallback((_) { - if (mounted) setState(() => _entered = true); - }); - } - - @override - void dispose() { - _animation?.removeStatusListener(_onStatus); - super.dispose(); - } - @override Widget build(BuildContext context) => AnimatedBuilder( animation: widget.session, builder: (context, _) { - final cupertino = usesCupertinoHost(context); - if (!widget.session.everConnected || !_entered) { + if (!widget.session.everConnected) { if (widget.embedded) { - return _entered - ? ConnectionGate( - session: widget.session, - server: widget.server, - cupertino: cupertino, - ) - : const SizedBox.shrink(); + return ConnectionGate(session: widget.session, server: widget.server); } return _SearchPage( - cupertino: cupertino, - child: _entered - ? ConnectionGate( - session: widget.session, - server: widget.server, - cupertino: cupertino, - ) - : const SizedBox.shrink(), + child: ConnectionGate(session: widget.session, server: widget.server), ); } return SearchScreen( gateway: widget.session.gateway, onOpen: widget.onOpen, - cupertino: cupertino, embedded: widget.embedded, ); }, @@ -112,22 +57,16 @@ class _SearchDestinationState extends State { /// The native title bar that owns Back while Search has no screen yet. class _SearchPage extends StatelessWidget { - const _SearchPage({required this.cupertino, required this.child}); + const _SearchPage({required this.child}); - final bool cupertino; final Widget child; @override - Widget build(BuildContext context) => cupertino - ? CupertinoPageScaffold( - navigationBar: const SegmentedBar(cupertino: true, title: 'Search'), - child: SafeArea(child: child), - ) - : Scaffold( - extendBodyBehindAppBar: true, - appBar: const SegmentedBar(cupertino: false, title: 'Search'), - body: SafeArea(child: child), - ); + Widget build(BuildContext context) => Scaffold( + extendBodyBehindAppBar: true, + appBar: const SegmentedBar(cupertino: false, title: 'Search'), + body: SafeArea(child: child), + ); } /// The run a result names, taken only from the server's own payload document. diff --git a/app/lib/application/templates_destination.dart b/app/lib/application/templates_destination.dart index 2c9188a6..abc59306 100644 --- a/app/lib/application/templates_destination.dart +++ b/app/lib/application/templates_destination.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../core/api_gateway.dart'; @@ -7,11 +6,9 @@ import '../features/templates/ui/template_detail.dart' show templateDetailBackKey; import '../shell/destination.dart'; import '../shell/shell_bar.dart'; -import '../ui/adaptive/host.dart'; import '../ui/adaptive/floating_bar_layout.dart'; import '../ui/adaptive/segmented_bar.dart'; import '../ui/adaptive/top_bar_notices.dart'; -import '../ui/theme/app_theme.dart'; import 'app_session.dart'; import 'connection_status.dart'; import 'server_endpoint.dart'; @@ -66,52 +63,42 @@ class _TemplatesDestinationState extends State { @override Widget build(BuildContext context) { - final cupertino = usesCupertinoHost(context); final body = ShellBarScope( registry: _bar, destination: AppDestination.settings, child: AnimatedBuilder( animation: widget.session, - builder: (context, _) => _body(cupertino), + builder: (context, _) => _body(), ), ); final bar = ListenableBuilder( listenable: _bar, - builder: (context, _) => _segmentedBar(cupertino), + builder: (context, _) => _segmentedBar(), ); // The page reaches its top edge: the gallery and an open template scroll // behind the bar and pad their own content by its height. final page = SafeArea(top: false, bottom: false, child: body); - if (cupertino) { - // Plain list rows on the page background, like the other lists; the - // bar's scrim takes the same colour. - return CupertinoPageScaffold( - backgroundColor: AppColors.background, - navigationBar: _BarSlot(cupertino: true, child: bar), - child: page, - ); - } return Scaffold( extendBodyBehindAppBar: true, - appBar: _BarSlot(cupertino: false, child: bar), + appBar: _BarSlot(child: bar), body: page, ); } - SegmentedBar _segmentedBar(bool cupertino) { + SegmentedBar _segmentedBar() { final spec = _bar.specFor(AppDestination.settings); final onDetailBack = spec?.onBack; return SegmentedBar( - cupertino: cupertino, + cupertino: false, leading: onDetailBack != null ? SegmentedBackButton( key: templateDetailBackKey, - cupertino: cupertino, + cupertino: false, onPressed: onDetailBack, ) : SegmentedBackButton( key: templatesPageBackKey, - cupertino: cupertino, + cupertino: false, onPressed: widget.onBack, ), title: spec?.title ?? 'Templates', @@ -120,14 +107,14 @@ class _TemplatesDestinationState extends State { ); } - Widget _body(bool cupertino) { + Widget _body() { final session = widget.session; if (!session.everConnected) { return BelowTopBar( child: ConnectionGate( session: session, server: widget.server, - cupertino: cupertino, + cupertino: false, ), ); } @@ -135,7 +122,7 @@ class _TemplatesDestinationState extends State { return TopBarNotices( notices: [ if (!session.connected) - ConnectionBanner(session: session, cupertino: cupertino), + ConnectionBanner(session: session, cupertino: false), ], child: TemplatesScreen( gateway: session.gateway, @@ -149,19 +136,14 @@ class _TemplatesDestinationState extends State { /// Gives the scaffold a [SegmentedBar]'s size and obstruction while the bar /// itself is rebuilt from the published controls. -class _BarSlot extends StatelessWidget - implements ObstructingPreferredSizeWidget { - const _BarSlot({required this.cupertino, required this.child}); +class _BarSlot extends StatelessWidget implements PreferredSizeWidget { + const _BarSlot({required this.child}); - final bool cupertino; final Widget child; @override Size get preferredSize => - SegmentedBar(cupertino: cupertino, title: '').preferredSize; - - @override - bool shouldFullyObstruct(BuildContext context) => false; + const SegmentedBar(cupertino: false, title: '').preferredSize; @override Widget build(BuildContext context) => child; diff --git a/app/lib/shell/adaptive_shell.dart b/app/lib/shell/adaptive_shell.dart index 9427c9da..79c7502c 100644 --- a/app/lib/shell/adaptive_shell.dart +++ b/app/lib/shell/adaptive_shell.dart @@ -36,8 +36,7 @@ class AdaptiveShell extends StatefulWidget { final Map destinationBodies; - /// Retained for callers that still pass it; the shell always draws the - /// Material controls and scaffold whether this is set or not. + /// Retained for callers that still pass it; the shell always draws Material. final bool cupertino; /// The destination a route owner selected. When null the shell keeps its own diff --git a/app/lib/shell/attention_badge.dart b/app/lib/shell/attention_badge.dart index 53507407..207871da 100644 --- a/app/lib/shell/attention_badge.dart +++ b/app/lib/shell/attention_badge.dart @@ -14,7 +14,7 @@ class AttentionDestinationIcon extends StatelessWidget { const AttentionDestinationIcon({ super.key, required this.count, - required this.cupertino, + this.cupertino = false, required this.child, }); @@ -55,7 +55,7 @@ class ActivityBadge extends StatelessWidget { super.key, required this.count, required this.label, - required this.cupertino, + this.cupertino = false, required this.child, this.bottom = false, }); diff --git a/app/lib/shell/destination.dart b/app/lib/shell/destination.dart index 3d5283cb..72a6766b 100644 --- a/app/lib/shell/destination.dart +++ b/app/lib/shell/destination.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; enum AppDestination { pipelines, runs, chat, search, settings } @@ -22,34 +21,32 @@ AppDestination shellTabFor(AppDestination destination) => /// The label and icons for [value]. /// -/// [cupertinoIcon] is retained in the record for callers that still read it; -/// the shell itself draws [icon] on its Material path. ({String label, IconData icon, IconData cupertinoIcon}) destinationDetails( AppDestination value, ) => switch (value) { AppDestination.pipelines => ( label: 'Pipelines', icon: Icons.account_tree_outlined, - cupertinoIcon: CupertinoIcons.arrow_branch, + cupertinoIcon: Icons.account_tree_outlined, ), AppDestination.runs => ( label: 'Runs', icon: Icons.play_circle_outline, - cupertinoIcon: CupertinoIcons.play_circle, + cupertinoIcon: Icons.play_circle_outline, ), AppDestination.chat => ( label: 'Chat', icon: Icons.chat_bubble_outline, - cupertinoIcon: CupertinoIcons.chat_bubble_2, + cupertinoIcon: Icons.chat_bubble_outline, ), AppDestination.search => ( label: 'Search', icon: Icons.search, - cupertinoIcon: CupertinoIcons.search, + cupertinoIcon: Icons.search, ), AppDestination.settings => ( label: 'Settings', icon: Icons.settings_outlined, - cupertinoIcon: CupertinoIcons.gear, + cupertinoIcon: Icons.settings_outlined, ), }; diff --git a/app/notes/material-startup-shell-cleanup.md b/app/notes/material-startup-shell-cleanup.md new file mode 100644 index 00000000..e98d65fa --- /dev/null +++ b/app/notes/material-startup-shell-cleanup.md @@ -0,0 +1,25 @@ +# Material startup and shell cleanup + +- Consolidated application startup, onboarding, routing pages, connection + states, Search, Templates, Schedules, and the navigation shell onto Material + composition on every platform. +- Kept legacy `cupertino` constructor arguments optional/ignored where callers + still pass them; no Cupertino widgets or platform host selection remain in + the changed application paths. +- Focused watchdog command ran the mirrored application/routing/navigation and + shell tests: 38 passed and 7 failed. The seven failures were teardown + assertions for the pre-existing 15-second `LaunchUpdateChecker` timer in + `PipelinesApp`; no Material cleanup assertion failed. +- `tool/analyze.sh`: clean (exit 0). +- No rendered capture was performed; this cleanup preserves the existing + Material scaffold, bars, connection states, focus, and navigation semantics. + +## Manager recovery + +The navigation and template-wiring fixtures were inadvertently invoking native +update plugins. They now explicitly disable updates, while dedicated startup +update tests retain and exercise the real update-check behavior. + +The focused routing, app, schedules, template-wiring, split-bar, startup-update +check and startup-update-flow tests passed: 39 passed, zero failed. No production +update behavior was changed to hide the teardown failures. diff --git a/app/test/application/pipelines_app_test.dart b/app/test/application/pipelines_app_test.dart index 2a6f601d..07a6e910 100644 --- a/app/test/application/pipelines_app_test.dart +++ b/app/test/application/pipelines_app_test.dart @@ -37,6 +37,8 @@ Future pumpApp( PipelinesApp( server: webServer(), client: client, + // Navigation fixtures do not exercise native update plugins. + androidSupported: false, cupertino: false, routeInformationProvider: provider, ), diff --git a/app/test/application/templates_wiring_test.dart b/app/test/application/templates_wiring_test.dart index 100bb294..8be556a3 100644 --- a/app/test/application/templates_wiring_test.dart +++ b/app/test/application/templates_wiring_test.dart @@ -78,6 +78,8 @@ Future pumpApp( PipelinesApp( server: webServer(), client: client, + // This fixture tests template routing, not native update plugins. + androidSupported: false, cupertino: false, routeInformationProvider: provider, ), From 61c34bb74ad275430fb8909f64fc18cd588fb943 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 20:32:17 +0000 Subject: [PATCH 8/8] Record browser terminal to chat focus verification --- app/notes/chat-terminal-focus-shortcut.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/notes/chat-terminal-focus-shortcut.md b/app/notes/chat-terminal-focus-shortcut.md index 02801415..d355f49a 100644 --- a/app/notes/chat-terminal-focus-shortcut.md +++ b/app/notes/chat-terminal-focus-shortcut.md @@ -21,3 +21,17 @@ Evidence: No browser fixture was run in this implementation stage; browser terminal fixture support and full-app rendered evidence remain for the appropriate review stage. + +## Manager browser integration + +Verified the merged full-app fixture with +`chats=2&header=1&terminals=1&terminal=float` at 1800×1000. Floated the second +chat, clicked the exposed Terminal content to focus it, then pressed Ctrl+Y. +Before typing, the browser's active element was the chat's `TEXTAREA`, labelled +`Work on demo`. Typing `Typed immediately after Ctrl+Y` appeared in that chat +without another click; the chat was visibly above Terminal. + +Inspected `06-typed.png`. Capture reports, semantics snapshots and screenshots +are retained under run 369's `public/manager-integration-ctrl-y/`. This verifies +the actual Terminal/Chat widgets and browser focus handoff with a fake gateway, +not a live shell backend or native device installation.