diff --git a/app/lib/features/chat/files/files_header.dart b/app/lib/features/chat/files/files_header.dart index 6c59c479..99e5e9fe 100644 --- a/app/lib/features/chat/files/files_header.dart +++ b/app/lib/features/chat/files/files_header.dart @@ -82,6 +82,7 @@ class FilesHeader extends StatelessWidget { ), AppOverflowMenu( label: 'Sort', + icon: const Icon(Icons.sort), onSelected: (_, key) => controller.setSort(controller.sort.reverseOr(key)), actions: [ diff --git a/app/lib/shell/windows/window_frame.dart b/app/lib/shell/windows/window_frame.dart index 001076aa..61240ef6 100644 --- a/app/lib/shell/windows/window_frame.dart +++ b/app/lib/shell/windows/window_frame.dart @@ -128,6 +128,27 @@ class WindowFrame extends StatelessWidget { ); } +/// The foreground edge of a floating window. This is separate from +/// [WindowFrame] because the window body is painted by a later navigator +/// child and may otherwise cover the card's decoration. +class WindowOutline extends StatelessWidget { + const WindowOutline({super.key}); + + @override + Widget build(BuildContext context) { + final colors = Theme.of(context).colorScheme; + return IgnorePointer( + child: DecoratedBox( + decoration: BoxDecoration( + border: Border.all(color: colors.outlineVariant), + borderRadius: BorderRadius.circular(windowCornerRadius), + ), + child: const SizedBox.expand(), + ), + ); + } +} + /// The lower right corner of a window: drag to resize. class WindowResizeCorner extends StatelessWidget { const WindowResizeCorner({ diff --git a/app/lib/shell/windows/window_layer.dart b/app/lib/shell/windows/window_layer.dart index b5d93d66..efaffc28 100644 --- a/app/lib/shell/windows/window_layer.dart +++ b/app/lib/shell/windows/window_layer.dart @@ -300,6 +300,7 @@ class _WindowLayerState extends State onResizeEnd: _resizeEnded, ), ), + Positioned.fromRect(rect: frame, child: const WindowOutline()), ], ); final center = widget.bounds.center(Offset.zero); diff --git a/app/lib/ui/layout/app_overflow_menu.dart b/app/lib/ui/layout/app_overflow_menu.dart index 98f925ff..159906b1 100644 --- a/app/lib/ui/layout/app_overflow_menu.dart +++ b/app/lib/ui/layout/app_overflow_menu.dart @@ -33,6 +33,7 @@ class AppOverflowMenu extends StatelessWidget { this.label = 'More actions', this.sheetTitle, this.enabled = true, + this.icon = const Icon(Icons.more_vert), }); final List> actions; @@ -48,6 +49,10 @@ class AppOverflowMenu extends StatelessWidget { final bool enabled; + /// The button glyph. Most callers use the default overflow icon; controls + /// whose action has a distinct meaning can provide a matching Material icon. + final Widget icon; + @override Widget build(BuildContext context) { if (actions.isEmpty) return const SizedBox.shrink(); @@ -57,7 +62,7 @@ class AppOverflowMenu extends StatelessWidget { child: Material( type: MaterialType.transparency, child: PopupMenuButton( - icon: const Icon(Icons.more_vert), + icon: icon, tooltip: label, enabled: enabled, onSelected: (value) => onSelected(context, value), diff --git a/app/notes/file-explorer-sort-icon.md b/app/notes/file-explorer-sort-icon.md new file mode 100644 index 00000000..b5494776 --- /dev/null +++ b/app/notes/file-explorer-sort-icon.md @@ -0,0 +1,11 @@ +# File explorer sort icon + +- Changed `FilesHeader` to use the Material `Icons.sort` glyph for the Sort + control instead of the generic overflow glyph. +- Extended `AppOverflowMenu` with an optional icon while preserving the default + `Icons.more_vert` for existing callers. +- Added widget coverage for the recognizable sort icon and key/direction + selection behavior. +- Focused verification: `files_panel_test.dart` and `files_models_test.dart` + through `tool/memwatch/full.sh`, followed by `tool/analyze.sh` (recorded in + the stage handoff). diff --git a/app/notes/floating-window-outline.md b/app/notes/floating-window-outline.md new file mode 100644 index 00000000..241dc226 --- /dev/null +++ b/app/notes/floating-window-outline.md @@ -0,0 +1,11 @@ +# Floating window outline + +- Added a one-logical-pixel `ColorScheme.outlineVariant` outline over the full + floating window perimeter, including the body painted by its navigator. +- The outline is non-interactive and keeps the existing title drag, body input, + resize, popup layering, and window state behavior unchanged. +- Focused checks: `window_host_test.dart`, `window_layering_test.dart`, and + `window_conveniences_test.dart` — 41 passed. +- `tool/analyze.sh` — clean. +- Browser captures were not run in this implementation stage; rendered review + remains for the UI review stage. diff --git a/app/test/features/chat/files/files_panel_test.dart b/app/test/features/chat/files/files_panel_test.dart index a562f6c6..50637cc0 100644 --- a/app/test/features/chat/files/files_panel_test.dart +++ b/app/test/features/chat/files/files_panel_test.dart @@ -93,6 +93,31 @@ void main() { expect(find.widgetWithText(TextButton, 'demo'), findsOneWidget); }); + testWidgets('file sorting uses a sort icon and preserves direction', ( + tester, + ) async { + final controller = await pump(tester); + + expect(find.byTooltip('Sort'), findsOneWidget); + expect(find.byIcon(Icons.sort), findsOneWidget); + expect(controller.sort.key, FilesSortKey.name); + expect(controller.sort.ascending, isTrue); + + await tester.tap(find.byTooltip('Sort')); + await tester.pumpAndSettle(); + await tester.tap(find.text('size')); + await tester.pumpAndSettle(); + expect(controller.sort.key, FilesSortKey.size); + expect(controller.sort.ascending, isTrue); + + await tester.tap(find.byTooltip('Sort')); + await tester.pumpAndSettle(); + await tester.tap(find.text('size ↑')); + await tester.pumpAndSettle(); + expect(controller.sort.key, FilesSortKey.size); + expect(controller.sort.ascending, isFalse); + }); + testWidgets('text tap opens shared viewer and fetches inline URL', ( tester, ) async { diff --git a/app/test/shell/windows/window_host_test.dart b/app/test/shell/windows/window_host_test.dart index 750c9ccc..75e5574e 100644 --- a/app/test/shell/windows/window_host_test.dart +++ b/app/test/shell/windows/window_host_test.dart @@ -47,6 +47,36 @@ void main() { expect(tester.getRect(find.byType(ProbeContent)).top, greaterThan(80)); }); + testWidgets('the outline covers the full window and uses the theme palette', ( + tester, + ) async { + manager.open('probe', 'a'); + await pumpProbe(tester, manager); + + final outline = find.byType(WindowOutline); + expect(outline, findsOneWidget); + expect(tester.getSize(outline), const Size(360, 420)); + final decoration = + tester + .widget( + find.descendant( + of: outline, + matching: find.byType(DecoratedBox), + ), + ) + .decoration + as BoxDecoration; + expect( + decoration.border, + Border.all( + color: Theme.of( + tester.element(find.byType(WindowOutline)), + ).colorScheme.outlineVariant, + ), + ); + expect(decoration.borderRadius, BorderRadius.circular(windowCornerRadius)); + }); + testWidgets('the app behind takes input everywhere outside a window', ( tester, ) async {