From bca862264043bca03a8ca72ac783ca44daee6fe9 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 8 May 2026 23:08:58 -0400 Subject: [PATCH] feat(web/admin): Save runs Test first, dropdowns honor test response MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Click sequence on a fresh Lidarr config: enter URL + API key → click Save. The page now calls testLidarrConnection first, stashes the returned profiles/folders into local state, lets the existing auto-default $effects pick first-of-each, then sends the put-config request with non-zero defaults. If the test fails, the save aborts and the error surfaces in saveError. The explicit Test connection button keeps working and additionally populates the dropdowns from the same response so an operator can inspect/adjust before saving. Each dropdown reads from its test-state array when present, falling back to the existing query data (which only works after the first successful save). list_errors entries surface as inline notes under their respective dropdowns. Closes the chicken-and-egg where saving required defaults that could only be fetched after saving. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../routes/admin/integrations/+page.svelte | 93 +++++++++++++++---- 1 file changed, 76 insertions(+), 17 deletions(-) diff --git a/web/src/routes/admin/integrations/+page.svelte b/web/src/routes/admin/integrations/+page.svelte index 8512c15f..1b5b7553 100644 --- a/web/src/routes/admin/integrations/+page.svelte +++ b/web/src/routes/admin/integrations/+page.svelte @@ -1,4 +1,5 @@