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));