Add opposing arc swap animation for chat quick switch

This commit is contained in:
2026-11-08 01:00:08 +00:00
parent 2fe08226f2
commit d6006bb1f8
6 changed files with 147 additions and 47 deletions
@@ -6,6 +6,7 @@ const quickSwitchAnimationKey = 'pipelines.quick-switch-animation.v1';
enum QuickSwitchAnimation {
tape('Tape', 'Chats travel together in a continuous vertical loop.'),
swap('Swap', 'Chats slide past each other into their new positions.'),
arcSwap('Arc swap', 'Chats trade places along opposite left and right arcs.'),
cardStack(
'Card deck',
'Lift the front card, slide it aside and tuck it behind.',
@@ -85,6 +85,14 @@ QuickSwitchPose quickSwitchPose(
case QuickSwitchAnimation.tape:
case QuickSwitchAnimation.swap:
return const QuickSwitchPose();
case QuickSwitchAnimation.arcSwap:
// Vertical travel is the same as Swap. This half-sine bows both paths
// outwards, meeting their exact endpoints without a hinge or 3D filter.
return QuickSwitchPose(
translation: Offset(direction * .38 * wave, 0),
rotationZ: direction * .035 * wave,
shadow: .4 * wave,
);
case QuickSwitchAnimation.cardStack:
return QuickSwitchPose(
translation: Offset(