From 8e041af6ad8a1a79ce9d7e1a2862013f704c6995 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sat, 7 Nov 2026 23:36:21 +0000 Subject: [PATCH] Shorten quick switching to 440 milliseconds --- .../features/chat/workspace/chat_pane_switch_motion.dart | 2 +- app/notes/faster-quick-switch.md | 7 +++++++ .../features/chat/workspace/chat_mobile_panes_test.dart | 4 ++-- .../features/chat/workspace/chat_switch_styles_test.dart | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 app/notes/faster-quick-switch.md diff --git a/app/lib/features/chat/workspace/chat_pane_switch_motion.dart b/app/lib/features/chat/workspace/chat_pane_switch_motion.dart index c08d1a52..96efe020 100644 --- a/app/lib/features/chat/workspace/chat_pane_switch_motion.dart +++ b/app/lib/features/chat/workspace/chat_pane_switch_motion.dart @@ -15,7 +15,7 @@ class ChatPaneSwitchMotion { value: 1, ); - static const Duration duration = Duration(milliseconds: 560); + static const Duration duration = Duration(milliseconds: 440); static const Curve curve = _TapeEase(); final AnimationController _controller; Animation get animation => _controller.view; diff --git a/app/notes/faster-quick-switch.md b/app/notes/faster-quick-switch.md new file mode 100644 index 00000000..95302972 --- /dev/null +++ b/app/notes/faster-quick-switch.md @@ -0,0 +1,7 @@ +# Faster quick switch + +Base quick-switch duration is 440 ms, down from 560 ms (21% shorter). +Tape remains the default and the existing easing is preserved. All styles share +the same clock. The saved global speed factor and reduced-motion behavior are +unchanged. Existing geometry/retained-state tests now sample the same animation +fractions rather than assuming the old wall-clock duration. diff --git a/app/test/features/chat/workspace/chat_mobile_panes_test.dart b/app/test/features/chat/workspace/chat_mobile_panes_test.dart index 22cb3c58..fc713160 100644 --- a/app/test/features/chat/workspace/chat_mobile_panes_test.dart +++ b/app/test/features/chat/workspace/chat_mobile_panes_test.dart @@ -152,7 +152,7 @@ void main() { bState.controller.text = 'Retained draft'; controller.activate(a); await tester.pump(); - await tester.pump(const Duration(milliseconds: 140)); + await tester.pump(ChatPaneSwitchMotion.duration ~/ 4); final t = ChatPaneSwitchMotion.curve.transform(.25); final incoming = tester.getRect(rect(a)); final wrapped = tester.getRect(rect(b)); @@ -215,7 +215,7 @@ void main() { final pane = controller.panes.firstWhere((pane) => pane.sessionId == id); await tester.tap(find.byKey(ValueKey('chat-peek-${pane.id}'))); await tester.pump(); - await tester.pump(const Duration(milliseconds: 140)); + await tester.pump(ChatPaneSwitchMotion.duration ~/ 4); final incoming = tester.getRect(rect(pane.id)); final next = controller .panes[(controller.panes.indexWhere((p) => p.id == pane.id) + 1) % 4]; diff --git a/app/test/features/chat/workspace/chat_switch_styles_test.dart b/app/test/features/chat/workspace/chat_switch_styles_test.dart index c9d579ed..ec2f077a 100644 --- a/app/test/features/chat/workspace/chat_switch_styles_test.dart +++ b/app/test/features/chat/workspace/chat_switch_styles_test.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:pipelines_app/features/chat/workspace/chat_pane_switch_motion.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:pipelines_app/features/chat/workspace/chat_peek_header.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -75,7 +76,7 @@ void main() { before.controller.text = 'Keep my draft'; controller.activate(a); await tester.pump(); - await tester.pump(const Duration(milliseconds: 140)); + await tester.pump(ChatPaneSwitchMotion.duration ~/ 4); // Card paint rectangles vary, but transcripts keep their useful full // viewport until settling to the real small preview once. expect( @@ -125,7 +126,7 @@ void main() { QuickSwitchAnimation.rolodex, }.contains(style), ); - await tester.pump(const Duration(milliseconds: 210)); + await tester.pump(ChatPaneSwitchMotion.duration * 3 ~/ 8); expect( surface().children.indexWhere( (w) => w.key == ValueKey('chat-workspace-$b'),