From a38f1bb3d1d8f3eb841a5eb618eb70f184ce4c7d Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 11 Nov 2026 19:32:46 +0000 Subject: [PATCH] Add outline to floating windows Paint a theme-derived one-pixel outline as a foreground overlay so the full floating window perimeter remains visible over navigator content without changing existing interaction geometry. --- app/lib/shell/windows/window_frame.dart | 21 ++++++++++++++ app/lib/shell/windows/window_layer.dart | 1 + app/notes/floating-window-outline.md | 11 +++++++ app/test/shell/windows/window_host_test.dart | 30 ++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 app/notes/floating-window-outline.md 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/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/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 {