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
@@ -7,39 +7,33 @@ import 'folder_picker_status.dart';
/// The body: loading, the inline error, or recent folders (home level only)
/// followed by the current folder's folders and its dimmed, unselectable files.
class FolderPickerList extends StatelessWidget {
const FolderPickerList({
super.key,
required this.cupertino,
required this.controller,
});
const FolderPickerList({super.key, required this.controller});
final bool cupertino;
final FolderPickerController controller;
@override
Widget build(BuildContext context) {
final listing = controller.listing;
if (controller.error != null) {
return FolderPickerError(cupertino: cupertino, controller: controller);
return FolderPickerError(controller: controller);
}
if (listing == null) {
return FolderPickerLoading(cupertino: cupertino);
return FolderPickerLoading();
}
final entries = controller.entries;
final recents = controller.filter.trim().isEmpty
? controller.recents
: const <String>[];
final rows = <Widget>[
if (controller.loading) FolderPickerLoadingBar(cupertino: cupertino),
if (controller.loading) const FolderPickerLoadingBar(),
if (recents.isNotEmpty) ...[
FolderSectionHeader(cupertino: cupertino, text: 'Recent folders'),
const FolderSectionHeader(text: 'Recent folders'),
for (final path in recents)
_RecentRow(
label: homeRelativeLabel(listing.home, path),
onTap: () => controller.open(path),
),
FolderSectionHeader(
cupertino: cupertino,
text: 'In ${homeRelativeLabel(listing.home, listing.path)}',
),
],
@@ -52,7 +46,6 @@ class FolderPickerList extends StatelessWidget {
),
if (entries.isEmpty)
FolderPickerNote(
cupertino: cupertino,
text: controller.filter.trim().isNotEmpty
? 'Nothing here matches “${controller.filter.trim()}”.'
: controller.hiddenCount > 0
@@ -61,7 +54,6 @@ class FolderPickerList extends StatelessWidget {
),
if (listing.truncated)
FolderPickerNote(
cupertino: cupertino,
text:
'This folder is large; only the first entries are shown. '
'Use the filter or type the path instead.',
@@ -107,7 +99,7 @@ class _EntryRow extends StatelessWidget {
? Row(
mainAxisSize: MainAxisSize.min,
children: [
if (entry.isGitRepo) const FolderGitBadge(cupertino: false),
if (entry.isGitRepo) const FolderGitBadge(),
const SizedBox(width: 4),
const Icon(Icons.chevron_right),
],
@@ -129,9 +121,7 @@ class _EntryRow extends StatelessWidget {
/// The small "git" mark on a repository folder.
class FolderGitBadge extends StatelessWidget {
const FolderGitBadge({super.key, required this.cupertino});
final bool cupertino;
const FolderGitBadge({super.key});
@override
Widget build(BuildContext context) {
@@ -80,17 +80,10 @@ class _FolderPickerPageState extends State<FolderPickerPage> {
final body = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
FolderBreadcrumbs(cupertino: false, controller: _controller),
FolderPickerToolbar(
cupertino: false,
controller: _controller,
filter: _filter,
),
Expanded(
child: FolderPickerList(cupertino: false, controller: _controller),
),
FolderBreadcrumbs(controller: _controller),
FolderPickerToolbar(controller: _controller, filter: _filter),
Expanded(child: FolderPickerList(controller: _controller)),
FolderStartBar(
cupertino: false,
path: _controller.selectable,
home: _controller.home,
onStart: _start,
@@ -7,13 +7,8 @@ import 'folder_picker_purpose.dart';
/// The path from `~` to the current folder; every crumb but the last opens
/// that folder. It scrolls so the current folder stays visible.
class FolderBreadcrumbs extends StatelessWidget {
const FolderBreadcrumbs({
super.key,
required this.cupertino,
required this.controller,
});
const FolderBreadcrumbs({super.key, required this.controller});
final bool cupertino;
final FolderPickerController controller;
@override
@@ -88,12 +83,10 @@ class FolderBreadcrumbs extends StatelessWidget {
class FolderPickerToolbar extends StatelessWidget {
const FolderPickerToolbar({
super.key,
required this.cupertino,
required this.controller,
required this.filter,
});
final bool cupertino;
final FolderPickerController controller;
final TextEditingController filter;
@@ -153,14 +146,12 @@ class FolderPickerToolbar extends StatelessWidget {
class FolderStartBar extends StatelessWidget {
const FolderStartBar({
super.key,
required this.cupertino,
required this.path,
required this.home,
required this.onStart,
this.purpose = FolderPickerPurpose.startChat,
});
final bool cupertino;
final String? path;
final String? home;
final VoidCallback onStart;
@@ -5,9 +5,7 @@ import 'folder_picker_controller.dart';
/// First load: a centred native activity indicator.
class FolderPickerLoading extends StatelessWidget {
const FolderPickerLoading({super.key, required this.cupertino});
final bool cupertino;
const FolderPickerLoading({super.key});
@override
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.
class FolderPickerLoadingBar extends StatelessWidget {
const FolderPickerLoadingBar({super.key, required this.cupertino});
final bool cupertino;
const FolderPickerLoadingBar({super.key});
@override
Widget build(BuildContext context) {
@@ -38,13 +34,8 @@ class FolderPickerLoadingBar extends StatelessWidget {
/// The server's refusal shown in place (outside home, permission denied,
/// missing folder), with Retry, Back to the last good folder, and Home.
class FolderPickerError extends StatelessWidget {
const FolderPickerError({
super.key,
required this.cupertino,
required this.controller,
});
const FolderPickerError({super.key, required this.controller});
final bool cupertino;
final FolderPickerController controller;
@override
@@ -97,13 +88,8 @@ class FolderPickerError extends StatelessWidget {
/// A section label above recent folders and the folder's own entries.
class FolderSectionHeader extends StatelessWidget {
const FolderSectionHeader({
super.key,
required this.cupertino,
required this.text,
});
const FolderSectionHeader({super.key, required this.text});
final bool cupertino;
final String text;
@override
@@ -120,13 +106,8 @@ class FolderSectionHeader extends StatelessWidget {
/// A quiet explanatory line (empty folder, no matches, truncated listing).
class FolderPickerNote extends StatelessWidget {
const FolderPickerNote({
super.key,
required this.cupertino,
required this.text,
});
const FolderPickerNote({super.key, required this.text});
final bool cupertino;
final String text;
@override