From f34de9760850489d8f08eddb9bd33a41beda4771 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Thu, 4 Jun 2026 09:28:32 +0000
Subject: fix(lists): tick count down when media leaves a list

On revalidation the {#await} branch swaps and remounts CleanAnimeList,
resetting NumberTicker's tween to 0 so it always counted up. Persist the
last displayed count in AnimeListTemplate (which survives the remount) and
feed it as the ticker's start, so the count animates in the real
direction: down when an item leaves due/upcoming, up when one arrives.
---
 src/lib/List/ListTitle.svelte | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/lib/List/ListTitle.svelte')

diff --git a/src/lib/List/ListTitle.svelte b/src/lib/List/ListTitle.svelte
index f24476fe..2ccb591d 100644
--- a/src/lib/List/ListTitle.svelte
+++ b/src/lib/List/ListTitle.svelte
@@ -6,6 +6,7 @@ import type { Title } from "./mediaTitle";
 
 export let time: number | undefined = undefined;
 export let count = -1337;
+export let start = 0;
 export let title: Title = {
 	title: "Media List",
 	hint: "This is a media list.",
@@ -20,8 +21,9 @@ export let hideCount = false;
   {#if !hideCount}
     <span class="opaque list-title-count">
       {#if count === -1337}...{:else}<NumberTicker
+          {start}
           end={count}
-          duration={Math.min(2500, Math.max(500, Math.abs(count) * 10))}
+          duration={Math.min(2500, Math.max(500, Math.abs(count - start) * 10))}
         />{/if}
     </span>
   {/if}
-- 
cgit v1.2.3

