Remove Cupertino chat cleanup leftovers

Keep chat and folder-picker UI on the Material path by removing obsolete Cupertino imports, icon metadata, flags, and alternate control handling while preserving existing behavior and focused test coverage.
This commit is contained in:
2026-11-11 20:06:37 +00:00
parent 3f05421e8b
commit 04ba81e0ea
18 changed files with 33 additions and 123 deletions
@@ -63,7 +63,6 @@ mixin _ChatScreenFloat on State<ChatScreen>, _ChatScreenWorkspace {
label: 'Float (${chatFloatShortcutLabel()})', label: 'Float (${chatFloatShortcutLabel()})',
onPressed: () => _floatPane(pane.id), onPressed: () => _floatPane(pane.id),
materialIcon: Icons.picture_in_picture_alt_outlined, materialIcon: Icons.picture_in_picture_alt_outlined,
cupertinoIcon: CupertinoIcons.rectangle_on_rectangle,
), ),
]; ];
} }
@@ -39,9 +39,7 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
ChatCompactSidebar( ChatCompactSidebar(
navigation: navigation?.registry.canNavigate == true navigation: navigation?.registry.canNavigate == true
? ShellDestinationMenu( ? ShellDestinationMenu(
cupertino: cupertino: false,
chatControlsStyleOf(context) ==
ChatControlsStyle.cupertino,
current: AppDestination.chat, current: AppDestination.chat,
onSelected: navigation!.registry.navigateTo, onSelected: navigation!.registry.navigateTo,
) )
@@ -23,19 +23,3 @@ ButtonStyle chatBarTextButtonStyle(
/// Horizontal padding inside the bar's text buttons (model, mode). /// Horizontal padding inside the bar's text buttons (model, mode).
const EdgeInsets chatBarButtonPadding = EdgeInsets.symmetric(horizontal: 12); 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,
),
);
}
@@ -3,10 +3,6 @@ import 'package:flutter/material.dart';
import '../domain/chat_task_metadata.dart'; import '../domain/chat_task_metadata.dart';
import '../../../ui/text/monospace.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) => Color taskSecondary(BuildContext context) =>
Theme.of(context).colorScheme.onSurfaceVariant; Theme.of(context).colorScheme.onSurfaceVariant;
@@ -2,7 +2,6 @@ import '../../../shell/windows/window_scope.dart';
import '../../terminal/terminal_open_action.dart'; import '../../terminal/terminal_open_action.dart';
import 'dart:async'; import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
@@ -1408,9 +1407,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
identifier: 'chat-files-toggle', identifier: 'chat-files-toggle',
onPressed: _toggleFiles, onPressed: _toggleFiles,
materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined, materialIcon: _filesVisible ? Icons.folder : Icons.folder_outlined,
cupertinoIcon: _filesVisible
? CupertinoIcons.folder_fill
: CupertinoIcons.folder,
), ),
], ],
moreActions: [ moreActions: [
@@ -1422,7 +1418,6 @@ class _ChatThreadViewState extends State<ChatThreadView> {
label: 'Chat details', label: 'Chat details',
onPressed: _openInfo, onPressed: _openInfo,
materialIcon: Icons.info_outline, materialIcon: Icons.info_outline,
cupertinoIcon: CupertinoIcons.info,
), ),
...widget.paneControls, ...widget.paneControls,
chatShellRunMenuAction(onPressed: _runShellFromMenu), chatShellRunMenuAction(onPressed: _runShellFromMenu),
-6
View File
@@ -13,7 +13,6 @@ import 'dart:async';
import '../../ui/motion/motion.dart'; import '../../ui/motion/motion.dart';
import '../../ui/motion/container_transform_source.dart'; import '../../ui/motion/container_transform_source.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart' show setEquals; import 'package:flutter/foundation.dart' show setEquals;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart'; import 'package:flutter/scheduler.dart';
@@ -407,14 +406,12 @@ class _ChatScreenState extends State<ChatScreen>
label: 'Add chat pane', label: 'Add chat pane',
onPressed: () => _addPane(paneContext), onPressed: () => _addPane(paneContext),
materialIcon: Icons.add_box_outlined, materialIcon: Icons.add_box_outlined,
cupertinoIcon: CupertinoIcons.plus_square,
), ),
if (_workspace.paneCount > 1) if (_workspace.paneCount > 1)
ChatBarAction( ChatBarAction(
label: 'Open chats (${_workspace.paneCount})', label: 'Open chats (${_workspace.paneCount})',
onPressed: () => _pickPane(paneContext), onPressed: () => _pickPane(paneContext),
materialIcon: Icons.view_quilt_outlined, materialIcon: Icons.view_quilt_outlined,
cupertinoIcon: CupertinoIcons.square_split_2x2,
), ),
if (_workspace.paneCount > 1 && showsListBesideDetail(context)) if (_workspace.paneCount > 1 && showsListBesideDetail(context))
chatCenterStageAction(ChatCenterStageController.instance), chatCenterStageAction(ChatCenterStageController.instance),
@@ -428,7 +425,6 @@ class _ChatScreenState extends State<ChatScreen>
label: 'Close pane', label: 'Close pane',
onPressed: () => _closePane(pane.id), onPressed: () => _closePane(pane.id),
materialIcon: Icons.close, materialIcon: Icons.close,
cupertinoIcon: CupertinoIcons.xmark,
), ),
], ],
), ),
@@ -507,8 +503,6 @@ class _ChatScreenState extends State<ChatScreen>
), ),
ChatWorkspaceEntrance( ChatWorkspaceEntrance(
visible: selected != null, visible: selected != null,
cupertino:
chatControlsStyleOf(context) == ChatControlsStyle.cupertino,
child: ExcludeFocus( child: ExcludeFocus(
excluding: selected == null, excluding: selected == null,
child: MediaQuery( child: MediaQuery(
@@ -7,39 +7,33 @@ import 'folder_picker_status.dart';
/// The body: loading, the inline error, or recent folders (home level only) /// The body: loading, the inline error, or recent folders (home level only)
/// followed by the current folder's folders and its dimmed, unselectable files. /// followed by the current folder's folders and its dimmed, unselectable files.
class FolderPickerList extends StatelessWidget { class FolderPickerList extends StatelessWidget {
const FolderPickerList({ const FolderPickerList({super.key, required this.controller});
super.key,
required this.cupertino,
required this.controller,
});
final bool cupertino;
final FolderPickerController controller; final FolderPickerController controller;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final listing = controller.listing; final listing = controller.listing;
if (controller.error != null) { if (controller.error != null) {
return FolderPickerError(cupertino: cupertino, controller: controller); return FolderPickerError(controller: controller);
} }
if (listing == null) { if (listing == null) {
return FolderPickerLoading(cupertino: cupertino); return FolderPickerLoading();
} }
final entries = controller.entries; final entries = controller.entries;
final recents = controller.filter.trim().isEmpty final recents = controller.filter.trim().isEmpty
? controller.recents ? controller.recents
: const <String>[]; : const <String>[];
final rows = <Widget>[ final rows = <Widget>[
if (controller.loading) FolderPickerLoadingBar(cupertino: cupertino), if (controller.loading) const FolderPickerLoadingBar(),
if (recents.isNotEmpty) ...[ if (recents.isNotEmpty) ...[
FolderSectionHeader(cupertino: cupertino, text: 'Recent folders'), const FolderSectionHeader(text: 'Recent folders'),
for (final path in recents) for (final path in recents)
_RecentRow( _RecentRow(
label: homeRelativeLabel(listing.home, path), label: homeRelativeLabel(listing.home, path),
onTap: () => controller.open(path), onTap: () => controller.open(path),
), ),
FolderSectionHeader( FolderSectionHeader(
cupertino: cupertino,
text: 'In ${homeRelativeLabel(listing.home, listing.path)}', text: 'In ${homeRelativeLabel(listing.home, listing.path)}',
), ),
], ],
@@ -52,7 +46,6 @@ class FolderPickerList extends StatelessWidget {
), ),
if (entries.isEmpty) if (entries.isEmpty)
FolderPickerNote( FolderPickerNote(
cupertino: cupertino,
text: controller.filter.trim().isNotEmpty text: controller.filter.trim().isNotEmpty
? 'Nothing here matches “${controller.filter.trim()}”.' ? 'Nothing here matches “${controller.filter.trim()}”.'
: controller.hiddenCount > 0 : controller.hiddenCount > 0
@@ -61,7 +54,6 @@ class FolderPickerList extends StatelessWidget {
), ),
if (listing.truncated) if (listing.truncated)
FolderPickerNote( FolderPickerNote(
cupertino: cupertino,
text: text:
'This folder is large; only the first entries are shown. ' 'This folder is large; only the first entries are shown. '
'Use the filter or type the path instead.', 'Use the filter or type the path instead.',
@@ -107,7 +99,7 @@ class _EntryRow extends StatelessWidget {
? Row( ? Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
if (entry.isGitRepo) const FolderGitBadge(cupertino: false), if (entry.isGitRepo) const FolderGitBadge(),
const SizedBox(width: 4), const SizedBox(width: 4),
const Icon(Icons.chevron_right), const Icon(Icons.chevron_right),
], ],
@@ -129,9 +121,7 @@ class _EntryRow extends StatelessWidget {
/// The small "git" mark on a repository folder. /// The small "git" mark on a repository folder.
class FolderGitBadge extends StatelessWidget { class FolderGitBadge extends StatelessWidget {
const FolderGitBadge({super.key, required this.cupertino}); const FolderGitBadge({super.key});
final bool cupertino;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -80,17 +80,10 @@ class _FolderPickerPageState extends State<FolderPickerPage> {
final body = Column( final body = Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
FolderBreadcrumbs(cupertino: false, controller: _controller), FolderBreadcrumbs(controller: _controller),
FolderPickerToolbar( FolderPickerToolbar(controller: _controller, filter: _filter),
cupertino: false, Expanded(child: FolderPickerList(controller: _controller)),
controller: _controller,
filter: _filter,
),
Expanded(
child: FolderPickerList(cupertino: false, controller: _controller),
),
FolderStartBar( FolderStartBar(
cupertino: false,
path: _controller.selectable, path: _controller.selectable,
home: _controller.home, home: _controller.home,
onStart: _start, onStart: _start,
@@ -7,13 +7,8 @@ import 'folder_picker_purpose.dart';
/// The path from `~` to the current folder; every crumb but the last opens /// The path from `~` to the current folder; every crumb but the last opens
/// that folder. It scrolls so the current folder stays visible. /// that folder. It scrolls so the current folder stays visible.
class FolderBreadcrumbs extends StatelessWidget { class FolderBreadcrumbs extends StatelessWidget {
const FolderBreadcrumbs({ const FolderBreadcrumbs({super.key, required this.controller});
super.key,
required this.cupertino,
required this.controller,
});
final bool cupertino;
final FolderPickerController controller; final FolderPickerController controller;
@override @override
@@ -88,12 +83,10 @@ class FolderBreadcrumbs extends StatelessWidget {
class FolderPickerToolbar extends StatelessWidget { class FolderPickerToolbar extends StatelessWidget {
const FolderPickerToolbar({ const FolderPickerToolbar({
super.key, super.key,
required this.cupertino,
required this.controller, required this.controller,
required this.filter, required this.filter,
}); });
final bool cupertino;
final FolderPickerController controller; final FolderPickerController controller;
final TextEditingController filter; final TextEditingController filter;
@@ -153,14 +146,12 @@ class FolderPickerToolbar extends StatelessWidget {
class FolderStartBar extends StatelessWidget { class FolderStartBar extends StatelessWidget {
const FolderStartBar({ const FolderStartBar({
super.key, super.key,
required this.cupertino,
required this.path, required this.path,
required this.home, required this.home,
required this.onStart, required this.onStart,
this.purpose = FolderPickerPurpose.startChat, this.purpose = FolderPickerPurpose.startChat,
}); });
final bool cupertino;
final String? path; final String? path;
final String? home; final String? home;
final VoidCallback onStart; final VoidCallback onStart;
@@ -5,9 +5,7 @@ import 'folder_picker_controller.dart';
/// First load: a centred native activity indicator. /// First load: a centred native activity indicator.
class FolderPickerLoading extends StatelessWidget { class FolderPickerLoading extends StatelessWidget {
const FolderPickerLoading({super.key, required this.cupertino}); const FolderPickerLoading({super.key});
final bool cupertino;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -22,9 +20,7 @@ class FolderPickerLoading extends StatelessWidget {
/// A later load keeps the previous listing on screen under a thin indicator. /// A later load keeps the previous listing on screen under a thin indicator.
class FolderPickerLoadingBar extends StatelessWidget { class FolderPickerLoadingBar extends StatelessWidget {
const FolderPickerLoadingBar({super.key, required this.cupertino}); const FolderPickerLoadingBar({super.key});
final bool cupertino;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -38,13 +34,8 @@ class FolderPickerLoadingBar extends StatelessWidget {
/// The server's refusal shown in place (outside home, permission denied, /// The server's refusal shown in place (outside home, permission denied,
/// missing folder), with Retry, Back to the last good folder, and Home. /// missing folder), with Retry, Back to the last good folder, and Home.
class FolderPickerError extends StatelessWidget { class FolderPickerError extends StatelessWidget {
const FolderPickerError({ const FolderPickerError({super.key, required this.controller});
super.key,
required this.cupertino,
required this.controller,
});
final bool cupertino;
final FolderPickerController controller; final FolderPickerController controller;
@override @override
@@ -97,13 +88,8 @@ class FolderPickerError extends StatelessWidget {
/// A section label above recent folders and the folder's own entries. /// A section label above recent folders and the folder's own entries.
class FolderSectionHeader extends StatelessWidget { class FolderSectionHeader extends StatelessWidget {
const FolderSectionHeader({ const FolderSectionHeader({super.key, required this.text});
super.key,
required this.cupertino,
required this.text,
});
final bool cupertino;
final String text; final String text;
@override @override
@@ -120,13 +106,8 @@ class FolderSectionHeader extends StatelessWidget {
/// A quiet explanatory line (empty folder, no matches, truncated listing). /// A quiet explanatory line (empty folder, no matches, truncated listing).
class FolderPickerNote extends StatelessWidget { class FolderPickerNote extends StatelessWidget {
const FolderPickerNote({ const FolderPickerNote({super.key, required this.text});
super.key,
required this.cupertino,
required this.text,
});
final bool cupertino;
final String text; final String text;
@override @override
@@ -1,21 +1,12 @@
import '../../../../ui/adaptive/segmented_bar_overflow.dart'; import '../../../../ui/adaptive/segmented_bar_overflow.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
/// Which standard control family this screen renders.
enum ChatControlsStyle { material, cupertino }
/// Always Material: the app is Material-only, so no screen ever asks for the
/// Cupertino family. The parameter stays for callers.
ChatControlsStyle chatControlsStyleOf(BuildContext context) =>
ChatControlsStyle.material;
class ChatBarAction extends StatelessWidget implements SegmentedOverflowable { class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
const ChatBarAction({ const ChatBarAction({
super.key, super.key,
required this.label, required this.label,
required this.onPressed, required this.onPressed,
required this.materialIcon, required this.materialIcon,
required this.cupertinoIcon,
this.identifier, this.identifier,
}); });
@@ -23,8 +14,6 @@ class ChatBarAction extends StatelessWidget implements SegmentedOverflowable {
final VoidCallback onPressed; final VoidCallback onPressed;
final IconData materialIcon; final IconData materialIcon;
/// Kept for callers; the Material toolbar always draws [materialIcon].
final IconData cupertinoIcon;
final String? identifier; final String? identifier;
/// A narrow bar moves it into its More menu, under the bar's host's icon. /// A narrow bar moves it into its More menu, under the bar's host's icon.
@@ -4,7 +4,6 @@ import 'chat_machine_picker.dart';
import '../../../../ui/adaptive/segmented_bar.dart'; import '../../../../ui/adaptive/segmented_bar.dart';
import 'dart:async'; import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../ui/layout/content_width.dart'; import '../../../../ui/layout/content_width.dart';
@@ -437,14 +436,12 @@ class _ChatSessionsScreenState extends State<ChatSessionsScreen> {
label: 'New chat', label: 'New chat',
onPressed: _newChat, onPressed: _newChat,
materialIcon: Icons.add, materialIcon: Icons.add,
cupertinoIcon: CupertinoIcons.add,
), ),
ChatBarAction( ChatBarAction(
key: const Key('chat-refresh'), key: const Key('chat-refresh'),
label: 'Refresh', label: 'Refresh',
onPressed: _controller.refresh, onPressed: _controller.refresh,
materialIcon: Icons.refresh, materialIcon: Icons.refresh,
cupertinoIcon: CupertinoIcons.refresh,
), ),
]; ];
} }
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../ui/sessions/chat_adaptive.dart'; import '../ui/sessions/chat_adaptive.dart';
@@ -16,8 +15,5 @@ ChatBarAction chatCenterStageAction(ChatCenterStageController controller) {
materialIcon: controller.value materialIcon: controller.value
? Icons.view_quilt_outlined ? Icons.view_quilt_outlined
: Icons.center_focus_strong_outlined, : Icons.center_focus_strong_outlined,
cupertinoIcon: controller.value
? CupertinoIcons.square_split_2x2
: CupertinoIcons.viewfinder,
); );
} }
@@ -9,12 +9,10 @@ class ChatWorkspaceEntrance extends StatefulWidget {
const ChatWorkspaceEntrance({ const ChatWorkspaceEntrance({
super.key, super.key,
required this.visible, required this.visible,
required this.cupertino,
required this.child, required this.child,
}); });
final bool visible; final bool visible;
final bool cupertino;
final Widget child; final Widget child;
@override @override
+16
View File
@@ -0,0 +1,16 @@
# Material chat cleanup evidence
- Removed live Cupertino imports, icon metadata, the obsolete `ChatControlsStyle`
branch, and unused always-false presentation helpers from the assigned chat
lanes.
- Removed local Cupertino compatibility flags from workspace entrance and folder
picker widgets; shared `SegmentedBar`/`SegmentedBackButton` compatibility
arguments remain because those APIs are outside this lane.
- Preserved Material icons, native back behavior, pane focus, workspace
transitions, folder navigation, and session behavior.
- Focused watchdog: 50 passed, 0 failed across sessions, folder picker,
workspace entrance/workspace, floating pane, focus, toolbar tint, and header
tests.
- `tool/analyze.sh`: clean.
- No rendered capture was performed; these changes remove alternate metadata and
branches without changing Material layout or visual behavior.
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
@@ -38,7 +37,6 @@ Widget _header({
label: 'Files', label: 'Files',
onPressed: () {}, onPressed: () {},
materialIcon: Icons.folder_outlined, materialIcon: Icons.folder_outlined,
cupertinoIcon: CupertinoIcons.folder,
), ),
], ],
); );
@@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/chat/conversation/chat_bar_control_style.dart'; import 'package:pipelines_app/features/chat/conversation/chat_bar_control_style.dart';
@@ -56,7 +55,6 @@ void main() {
label: 'More action', label: 'More action',
onPressed: () {}, onPressed: () {},
materialIcon: Icons.more_horiz, materialIcon: Icons.more_horiz,
cupertinoIcon: CupertinoIcons.ellipsis,
), ),
], ],
), ),
@@ -206,14 +204,12 @@ void main() {
label: 'Sidebar action', label: 'Sidebar action',
onPressed: () => sidebar++, onPressed: () => sidebar++,
materialIcon: Icons.menu, materialIcon: Icons.menu,
cupertinoIcon: CupertinoIcons.sidebar_left,
), ),
paneControls: [ paneControls: [
ChatBarAction( ChatBarAction(
label: 'Pane action', label: 'Pane action',
onPressed: () => pane++, onPressed: () => pane++,
materialIcon: Icons.add_box, materialIcon: Icons.add_box,
cupertinoIcon: CupertinoIcons.plus_square,
), ),
], ],
), ),
@@ -15,7 +15,6 @@ void main() {
child: SizedBox.expand( child: SizedBox.expand(
child: ChatWorkspaceEntrance( child: ChatWorkspaceEntrance(
visible: visible, visible: visible,
cupertino: false,
child: Material(child: child), child: Material(child: child),
), ),
), ),