Replaces the Material 3 screens with the Noo design system: warm neutrals, one violet accent, pill controls, Schibsted Grotesk/ Instrument Sans, Lucide icons, no gradients/shadows. - New lib/widgets/noo/ component kit (core, lists, files, media, nav, overlays) plus lib/theme/design_tokens.dart for the color/type/space/ radius/motion tokens. - Rebuilt the app shell (top/bottom bars, drawer, desktop sidebar and toolbar), every tab (Files/Offline, Photos, Favorites, Recent, Activity, Trash, Shares), Settings, the lock and login screens, the media viewer, search, the details/share sheets, and the share-upload and move/copy destination pickers. - Added a design canvas (linked from DESIGN_SYSTEM.md) covering the screens the spec didn't already describe, with matching Android and iOS chrome; wrote up the approved recipes into DESIGN_SYSTEM.md §4. - Removed now-dead legacy widgets (media_grid_tile, swipeable_item, sync_status_badge, selectable_thumbnail) and updated architecture.md/styling.md/standards.md to describe the new structure and component/testing conventions. - Added widget tests for the noo/ component kit. This is a UI-only rework: no provider/model/service behavior changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
85 lines
2.4 KiB
Dart
85 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
|
import 'package:provider/provider.dart';
|
|
import '../../providers/settings_controller.dart';
|
|
import '../../theme/design_tokens.dart';
|
|
import '../noo/lists/noo_settings_row.dart';
|
|
import 'settings_section.dart';
|
|
|
|
String _swipeActionLabel(SwipeAction action) {
|
|
switch (action) {
|
|
case SwipeAction.none:
|
|
return 'None';
|
|
case SwipeAction.favorite:
|
|
return 'Favorite';
|
|
case SwipeAction.delete:
|
|
return 'Delete';
|
|
case SwipeAction.share:
|
|
return 'Share';
|
|
}
|
|
}
|
|
|
|
/// Settings section 8: what swiping a file left/right does in list view.
|
|
class SettingsSwipeSection extends StatelessWidget {
|
|
const SettingsSwipeSection({super.key});
|
|
|
|
void _openPicker(
|
|
BuildContext context, {
|
|
required String title,
|
|
required SwipeAction current,
|
|
required ValueChanged<SwipeAction> onChanged,
|
|
}) {
|
|
showSettingsPicker(
|
|
context,
|
|
title: title,
|
|
options: [
|
|
for (final action in SwipeAction.values)
|
|
NooSettingsRow(
|
|
label: Text(_swipeActionLabel(action)),
|
|
trailing: action == current
|
|
? Icon(LucideIcons.check, size: 18, color: context.nooColors.accentText)
|
|
: null,
|
|
onTap: () {
|
|
onChanged(action);
|
|
Navigator.pop(context);
|
|
},
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final settings = context.watch<SettingsController>();
|
|
|
|
return SettingsSection(
|
|
title: 'Swipe on a file',
|
|
subtitle: 'Choose what swiping a file left or right does in list view',
|
|
children: [
|
|
NooSettingsRow(
|
|
icon: LucideIcons.chevronsRight,
|
|
label: const Text('Swipe right'),
|
|
value: _swipeActionLabel(settings.swipeRightAction),
|
|
onTap: () => _openPicker(
|
|
context,
|
|
title: 'Swipe right',
|
|
current: settings.swipeRightAction,
|
|
onChanged: settings.setSwipeRightAction,
|
|
),
|
|
),
|
|
NooSettingsRow(
|
|
icon: LucideIcons.chevronsLeft,
|
|
label: const Text('Swipe left'),
|
|
value: _swipeActionLabel(settings.swipeLeftAction),
|
|
onTap: () => _openPicker(
|
|
context,
|
|
title: 'Swipe left',
|
|
current: settings.swipeLeftAction,
|
|
onChanged: settings.setSwipeLeftAction,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|