diff --git a/app/lib/features/chat/chat_screen_workspace.dart b/app/lib/features/chat/chat_screen_workspace.dart index 2b67ab95..80e92512 100644 --- a/app/lib/features/chat/chat_screen_workspace.dart +++ b/app/lib/features/chat/chat_screen_workspace.dart @@ -288,9 +288,12 @@ mixin _ChatScreenWorkspace on State { onFocusPane: (pane) => _composerFocus.request(pane.sessionId), paneBuilder: (context, pane, active) => Semantics( selected: active, - child: DecoratedBox( - position: DecorationPosition.foreground, - decoration: BoxDecoration( + child: AnimatedContainer( + duration: showsListBesideDetail(context) + ? Motion.of(context, Motion.standard) + : Duration.zero, + curve: Motion.curve, + foregroundDecoration: BoxDecoration( border: !showsListBesideDetail(context) ? Border( bottom: BorderSide( diff --git a/app/lib/features/chat/screen.dart b/app/lib/features/chat/screen.dart index cfc50a93..8c78ad4d 100644 --- a/app/lib/features/chat/screen.dart +++ b/app/lib/features/chat/screen.dart @@ -4,6 +4,7 @@ import '../../shell/detail_page.dart'; import '../../shell/empty_detail_pane.dart'; import '../../shell/list_detail.dart'; import 'dart:async'; +import '../../ui/motion/motion.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart' show setEquals; diff --git a/app/notes/desktop-pane-border-motion.md b/app/notes/desktop-pane-border-motion.md new file mode 100644 index 00000000..7b8b4f6b --- /dev/null +++ b/app/notes/desktop-pane-border-motion.md @@ -0,0 +1,22 @@ +# Desktop pane selection border + +The retained pane's foreground border now interpolates over the shared 200 ms +ease-out motion when desktop selection changes. The incoming chat's own color +fades in while the previous outline fades out. The decoration stays in front +of the existing DetailPane without changing constraints or rebuilding its state. +The global speed factor applies once; reduced motion makes the change immediate. +Mobile bottom-boundary behavior remains immediate. + +Changed: chat_screen_workspace.dart uses AnimatedContainer.foregroundDecoration; +screen.dart imports the shared Motion policy. The regression observes both +partway opacity values, settled identity colors, retained thread State and the +immediate reduced-motion result. + +37 focused workspace/insets/color tests passed (/tmp/memwatch/out.Em8ced). +Analyzer clean (flutter-analyze.6H29Tg). Fixture web build succeeded. Capture kit +filmed selection between two colored panes at 1440×1000 Material dark; reviewed +/tmp/review/desktop-focus-border-final/02-film-key-chat-pane-chat-pane-1-sheet.png +and 03-first-active.png. Final report has no browser errors. The first capture +used the uncolored fixture's old title; corrected to the colored fixture title. +No production chats were used for testing. No device testing or APK build for +this desktop web change. diff --git a/app/test/features/chat/chat_workspace_insets_color_test.dart b/app/test/features/chat/chat_workspace_insets_color_test.dart index 28479114..9e53d3e1 100644 --- a/app/test/features/chat/chat_workspace_insets_color_test.dart +++ b/app/test/features/chat/chat_workspace_insets_color_test.dart @@ -155,6 +155,47 @@ void main() { ); expect(tester.takeException(), isNull); }); + testWidgets('desktop focus border fades between retained panes', ( + tester, + ) async { + tester.platformDispatcher.accessibilityFeaturesTestValue = + const FakeAccessibilityFeatures(disableAnimations: false); + addTearDown(tester.platformDispatcher.clearAccessibilityFeaturesTestValue); + await _mount(tester, const Size(1800, 1000)); + final controller = tester + .widget(find.byType(ChatWorkspace)) + .controller; + controller.splitActive('b', ChatSplitAxis.horizontal); + await tester.pumpAndSettle(); + final state = tester.state(_thread('a')); + controller.activate( + controller.panes.firstWhere((p) => p.sessionId == 'a').id, + ); + await tester.pump(); + expect(_border(tester, 'a'), Colors.transparent); + await tester.pump(const Duration(milliseconds: 60)); + expect(_border(tester, 'a').a, inExclusiveRange(0, 1)); + expect(_border(tester, 'b').a, inExclusiveRange(0, 1)); + await tester.pumpAndSettle(); + expect( + _border(tester, 'a'), + chatColorShade(tester.element(_thread('a')), 'orange'), + ); + expect(_border(tester, 'b'), Colors.transparent); + expect(tester.state(_thread('a')), same(state)); + tester.platformDispatcher.accessibilityFeaturesTestValue = + const FakeAccessibilityFeatures(disableAnimations: true); + await tester.pump(); + controller.activate( + controller.panes.firstWhere((p) => p.sessionId == 'b').id, + ); + await tester.pump(); + expect( + _border(tester, 'b'), + chatColorShade(tester.element(_thread('b')), 'teal'), + ); + expect(_border(tester, 'a'), Colors.transparent); + }); testWidgets('mobile pair keeps only its coloured draggable bottom boundary', ( tester, ) async {