Shorten quick switching to 440 milliseconds
This commit is contained in:
@@ -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<double> get animation => _controller.view;
|
||||
|
||||
@@ -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.
|
||||
@@ -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];
|
||||
|
||||
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user