From 7a803f0802c3d5fe307614d4d0c22de3542d05d9 Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Sat, 10 Oct 2026 10:03:01 +0300 Subject: [PATCH] refactor(motion): Redis CLI auto-scroll and key-tree chevron use QueryaMotion tokens The CLI scrolls to the newest output with the fast token and the enter curve, and jumps when reduced motion makes the duration zero (animateTo needs a non-zero duration). The key folder chevron rotates with the tree expand token and curve, like the other tree chevrons. --- lib/features/redis/redis_cli_workspace.dart | 14 ++++++++++---- lib/features/redis/redis_keys_view.dart | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/features/redis/redis_cli_workspace.dart b/lib/features/redis/redis_cli_workspace.dart index edd0a770..3e07177a 100644 --- a/lib/features/redis/redis_cli_workspace.dart +++ b/lib/features/redis/redis_cli_workspace.dart @@ -308,12 +308,18 @@ class _RedisCliWorkspaceState extends material.State { void _scrollToBottom() { material.WidgetsBinding.instance.addPostFrameCallback((_) { - if (_scrollController.hasClients) { + if (!mounted || !_scrollController.hasClients) return; + final end = _scrollController.position.maxScrollExtent; + final duration = context.motionDuration(QueryaMotion.fast); + // animateTo needs a non-zero duration; reduced motion jumps. + if (duration > QueryaMotion.instant) { _scrollController.animateTo( - _scrollController.position.maxScrollExtent, - duration: const Duration(milliseconds: 150), - curve: material.Curves.easeOut, + end, + duration: duration, + curve: context.motionCurve(QueryaMotion.enter), ); + } else { + _scrollController.jumpTo(end); } }); } diff --git a/lib/features/redis/redis_keys_view.dart b/lib/features/redis/redis_keys_view.dart index ed50afd1..d870a4b9 100644 --- a/lib/features/redis/redis_keys_view.dart +++ b/lib/features/redis/redis_keys_view.dart @@ -737,7 +737,8 @@ class _FolderTile extends material.StatelessWidget { children: [ material.AnimatedRotation( turns: isExpanded ? 0.25 : 0.0, - duration: const Duration(milliseconds: 150), + duration: context.motionDuration(QueryaMotion.treeExpand), + curve: context.motionCurve(QueryaMotion.treeExpandCurve), child: material.Icon( material.Icons.chevron_right_rounded, size: 18,