From 2700dbe3ba90dcfd1f0d502b93aeb24f08ff39aa Mon Sep 17 00:00:00 2001 From: Ruud Andriessen Date: Tue, 10 Mar 2026 22:34:40 +0100 Subject: [PATCH] feat(sidebar): animate task status transitions --- src/components/layout/task-list.tsx | 225 ++++++++++++++++------------ 1 file changed, 133 insertions(+), 92 deletions(-) diff --git a/src/components/layout/task-list.tsx b/src/components/layout/task-list.tsx index 1e2628f..5b01794 100644 --- a/src/components/layout/task-list.tsx +++ b/src/components/layout/task-list.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; import { Link, useRouterState } from "@tanstack/react-router"; import { useLiveQuery } from "@tanstack/react-db"; +import { AnimatePresence, LayoutGroup, motion, useReducedMotion } from "motion/react"; import { CheckCheck, CircleAlert, @@ -28,6 +29,9 @@ import { type TaskSidebarGroup, } from "@/lib/task-sidebar"; +const SIDEBAR_LAYOUT_EASE = [0.2, 0.8, 0.2, 1] as const; +const SIDEBAR_ENTER_EASE = [0.16, 1, 0.3, 1] as const; + function renderGroupIcon(group: TaskSidebarGroup) { switch (group) { case "merged": @@ -55,6 +59,7 @@ export function TaskList() { ); const pathname = useRouterState({ select: (state) => state.location.pathname }); + const shouldReduceMotion = useReducedMotion(); const [deletingTask, setDeletingTask] = useState(false); const [taskToDelete, setTaskToDelete] = useState<{ id: string; title: string } | null>(null); const [deleteError, setDeleteError] = useState(null); @@ -119,102 +124,138 @@ export function TaskList() { /> - +