fix: use writable \$derived for search inputs, remove unnecessary \$state wrap

- Replace \$state + \$effect pattern with writable \$derived (Svelte 5.25+)
  for all searchValue instances across list pages — cleaner and lint-compliant
- Remove now-unused untrack imports from those files
- Drop \$state() wrapper around SvelteMap in device-mapping-dialog
  (SvelteMap is already reactive)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:46:15 +01:00
parent 422f97417e
commit 446e9f835b
9 changed files with 9 additions and 27 deletions

View File

@@ -1,5 +1,4 @@
<script lang="ts">
import { untrack } from "svelte";
import { goto, invalidateAll } from "$app/navigation";
import { page } from "$app/state";
import { SvelteURLSearchParams } from "svelte/reactivity";
@@ -18,8 +17,7 @@
let deleteTarget: Video | null = $state(null);
let deleteOpen = $state(false);
let deleting = $state(false);
let searchValue = $state(untrack(() => data.search ?? ""));
$effect(() => { searchValue = data.search ?? ""; });
let searchValue = $derived(data.search ?? "");
let searchTimeout: ReturnType<typeof setTimeout>;
function debounceSearch(value: string) {