Animate desktop chat selection border colors

This commit is contained in:
2026-11-07 19:30:30 +00:00
parent 0da7442296
commit 6b654693d9
4 changed files with 70 additions and 3 deletions
@@ -288,9 +288,12 @@ mixin _ChatScreenWorkspace on State<ChatScreen> {
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(
+1
View File
@@ -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;
+22
View File
@@ -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.
@@ -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<ChatWorkspace>(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 {