load in optimization and error correction
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m23s

This commit is contained in:
2026-03-20 13:08:15 -05:00
parent da7d2f4d5d
commit 5b2fefbca4
21 changed files with 334 additions and 130 deletions
+15 -1
View File
@@ -1,5 +1,5 @@
import { createSignal, createEffect, onCleanup, untrack } from "solid-js";
import type { Task } from "@/store";
import { store, type Task } from "@/store";
export function useDelayedSort(
sourceTasks: () => Task[],
@@ -16,6 +16,20 @@ export function useDelayedSort(
const sorted = [...sourceTasks()].sort(sortFn);
const currentDisplayed = untrack(() => displayedTasks());
// Startup hydration loads tasks in stages; animating each reorder causes
// the entire visible list to flash even when only later-stage tasks changed.
if (store.isInitializing) {
if (timer) {
clearTimeout(timer);
timer = undefined;
}
if (shakingTaskIds().length > 0) {
setShakingTaskIds([]);
}
setDisplayedTasks(sorted);
return;
}
// Initial load (though now handled by initial state, kept for safety if it resets)
if (currentDisplayed.length === 0 && sorted.length > 0) {
setDisplayedTasks(sorted);
+17
View File
@@ -0,0 +1,17 @@
import autoAnimate from "@formkit/auto-animate";
import { createEffect } from "solid-js";
import { store } from "@/store";
export function useTaskListAutoAnimate(getElement: () => HTMLElement | undefined) {
let hasInitialized = false;
createEffect(() => {
if (hasInitialized || store.isInitializing) return;
const element = getElement();
if (!element) return;
autoAnimate(element, { duration: 300, easing: "ease-out" });
hasInitialized = true;
});
}