From 08641a3f6f1d95cc8d8dbfeebdecf6c0d2a2b0a6 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.net>
Date: Thu, 21 May 2026 13:44:46 +0000
Subject: feat(debug): add dry-run mutations mode

New 'Dry-run mutations' toggle in the Debug settings panel blocks
outgoing list updates (the + button) and skips the post-mutation
refresh so optimistic UI changes persist locally for testing. The
mutation gate sits in incrementMediaProgress; CleanAnimeList only
revalidates when the request actually went out.
---
 src/lib/List/Anime/CleanAnimeList.svelte | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

(limited to 'src/lib/List/Anime/CleanAnimeList.svelte')

diff --git a/src/lib/List/Anime/CleanAnimeList.svelte b/src/lib/List/Anime/CleanAnimeList.svelte
index 3f397c25..42f4d933 100644
--- a/src/lib/List/Anime/CleanAnimeList.svelte
+++ b/src/lib/List/Anime/CleanAnimeList.svelte
@@ -224,10 +224,16 @@ const increment = (anime: Media, progress: number) => {
 			? media.filter((m) => m.id !== anime.id)
 			: media;
 
-	incrementMediaProgress(anime.id, anime.mediaListEntry?.progress, user, () => {
-		pendingUpdate = null;
-		$revalidateAnime = $revalidateAnime + 1;
-	});
+	incrementMediaProgress(
+		anime.id,
+		anime.mediaListEntry?.progress,
+		user,
+		(skipped) => {
+			pendingUpdate = null;
+
+			if (!skipped) $revalidateAnime = $revalidateAnime + 1;
+		},
+	);
 };
 </script>
 
-- 
cgit v1.2.3

