import { type Component, For, createMemo, onMount } from "solid-js"; import { store, getCombinedScore, matchesFilter } from "@/store"; import { TaskCard } from "@/components/TaskCard"; import { useDelayedSort } from "@/hooks/useDelayedSort"; import autoAnimate from "@formkit/auto-animate"; export const DigInView: Component = () => { const sourceTasks = createMemo(() => store.tasks.filter(t => !t.deletedAt && matchesFilter(t))); const { displayedTasks, shakingTaskIds } = useDelayedSort( sourceTasks, (a, b) => { if (a.completed !== b.completed) return a.completed ? 1 : -1; // Primary: Size descending (largest first) const sizeA = a.size ?? 5; const sizeB = b.size ?? 5; if (sizeA !== sizeB) return sizeB - sizeA; // Secondary: Combined score descending (higher focus first) return getCombinedScore(b) - getCombinedScore(a); }, 300 ); let listRef: HTMLDivElement | undefined; onMount(() => { if (listRef) autoAnimate(listRef, { duration: 300, easing: 'ease-out' }); }); return (

Dig In

Largest tasks first. Tackle big projects head-on.

{(task) => (
)}
{displayedTasks().length === 0 && (
⛏️

Nothing here. Add some tasks to dig into!

)}
); };