From 14106beb67fe5adca34bfce83ae16aafaddac47b Mon Sep 17 00:00:00 2001 From: jstet Date: Fri, 25 Sep 2026 14:35:34 +0200 Subject: [PATCH] wizard: pre-select the form-of-address default (#43) The Sie/Du toggle used to start empty (language = null), which left both buttons unselected on first load. The agent call fell back to 'formal' anyway, so the empty state was just confusing UX. Default to 'formal' on first load and after a 'Clear form' reset; keep the storage type permissive (a stored 'null' from older sessions still loads and coalesces to 'formal'). Drop the now-redundant `language || 'formal'` at the call site. --- src/routes/+page.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 8e7b0c8..7a84d62 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -24,7 +24,10 @@ // Form state // Restored from the last visit (#23); the examples only fill a first visit. const saved = loadWizardInputs(); - let language = $state<'formal' | 'informal' | null>(saved?.language ?? null); + // Pre-select "formal" so the Sie/Du buttons never start empty — the agent + // would default to it anyway, and the previous "nothing selected" state + // left the user guessing which side of the toggle was active. + let language = $state<'formal' | 'informal'>(saved?.language ?? 'formal'); // Language of every question, label, hint and title (#39). Defaults to // German to match the rest of the toolchain. let surveyLanguage = $state<'de' | 'en'>(saved?.surveyLanguage ?? 'de'); @@ -70,7 +73,7 @@ targetGroup = ''; useOfResults = ''; furtherNotes = ''; - language = null; + language = 'formal'; surveyLanguage = 'de'; selectedDemographics = []; resetResult(); @@ -173,7 +176,7 @@ researchQuestions, targetGroup, useOfResults, - language: language || 'formal', + language, surveyLanguage, selectedDemographics, demographicQuestions: demographicQuestions(selectedDemographics),