fix: sync reactive state with data prop using \$effect

Replaces bare \$state(data.x) initialisers (which only capture the
initial value) with \$state + \$effect pairs so that state stays in sync
whenever page data is invalidated or the URL changes. Affects all list
pages (searchValue) and all edit/detail pages (form fields).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:06:30 +01:00
parent dc1850126b
commit b9b98f178f
13 changed files with 60 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
let deleteOpen = $state(false);
let deleting = $state(false);
let searchValue = $state(data.search ?? "");
$effect(() => { searchValue = data.search ?? ""; });
let searchTimeout: ReturnType<typeof setTimeout>;
function debounceSearch(value: string) {