From 0d2c9c0f7f3050cdcb40a2f781d89699b08e314e Mon Sep 17 00:00:00 2001 From: vikingowl Date: Fri, 24 Apr 2026 13:38:03 +0200 Subject: [PATCH] fix(web): silence svelte 5 warnings, add missing enrichment proxy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Wrap $state initializers that read props (MarketForm, ResearchPanel, maerkte +page) in untrack() so Svelte 5 stops warning about state_referenced_locally. Intent stays "take an initial snapshot of the prop" — the warning existed to make that intent explicit. - Add enrichment/crawl-all-status/+server.ts proxy route; the admin discovery page was polling this path and getting 404s in a tight loop because the equivalent SvelteKit proxy only existed for the plain /crawl-status endpoint. --- .../lib/components/admin/MarketForm.svelte | 22 +++++++++++-------- .../lib/components/admin/ResearchPanel.svelte | 3 ++- .../enrichment/crawl-all-status/+server.ts | 12 ++++++++++ web/src/routes/admin/maerkte/+page.svelte | 3 ++- 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 web/src/routes/admin/discovery/enrichment/crawl-all-status/+server.ts diff --git a/web/src/lib/components/admin/MarketForm.svelte b/web/src/lib/components/admin/MarketForm.svelte index 014dfaa..41cf7d9 100644 --- a/web/src/lib/components/admin/MarketForm.svelte +++ b/web/src/lib/components/admin/MarketForm.svelte @@ -3,6 +3,7 @@ import Input from '$lib/components/ui/Input.svelte'; import Button from '$lib/components/ui/Button.svelte'; + import { untrack } from 'svelte'; import type { Snippet } from 'svelte'; interface Props { @@ -39,21 +40,24 @@ UA: 'UAH' }; - let selectedCountry = $state(market?.country ?? 'DE'); + let selectedCountry = $state(untrack(() => market?.country ?? 'DE')); const currency = $derived(currencyByCountry[selectedCountry] ?? 'EUR'); let hours: OpeningHoursEntry[] = $state( - market?.opening_hours?.length ? [...market.opening_hours] : [] + untrack(() => (market?.opening_hours?.length ? [...market.opening_hours] : [])) ); let admission: AdmissionInfo = $state( - market?.admission_info ?? { - adult_cents: 0, - child_cents: 0, - reduced_cents: 0, - free_under_age: 0, - notes: '' - } + untrack( + () => + market?.admission_info ?? { + adult_cents: 0, + child_cents: 0, + reduced_cents: 0, + free_under_age: 0, + notes: '' + } + ) ); let geocoding = $state(false); diff --git a/web/src/lib/components/admin/ResearchPanel.svelte b/web/src/lib/components/admin/ResearchPanel.svelte index e82460d..b09aae6 100644 --- a/web/src/lib/components/admin/ResearchPanel.svelte +++ b/web/src/lib/components/admin/ResearchPanel.svelte @@ -1,4 +1,5 @@