diff --git a/frontend/src/routes/briefwechsel/+page.svelte b/frontend/src/routes/briefwechsel/+page.svelte index 050d6567..7587aa58 100644 --- a/frontend/src/routes/briefwechsel/+page.svelte +++ b/frontend/src/routes/briefwechsel/+page.svelte @@ -28,6 +28,7 @@ $effect(() => { }); const isSinglePerson = $derived(!!senderId && !receiverId); +let showAdvanced = $state(false); const RECENT_STORAGE_KEY = 'korrespondenz_recent_persons'; const MAX_RECENT = 5; @@ -107,20 +108,23 @@ function selectPerson(id: string) { bind:receiverId={receiverId} initialSenderName={data.initialValues.senderName} initialReceiverName={data.initialValues.receiverName} - onapplyFilters={applyFilters} - onswapPersons={swapPersons} - /> - - (showAdvanced = !showAdvanced)} /> + {#if showAdvanced} + + {/if} + {#if isSinglePerson} +import { slide } from 'svelte/transition'; import { m } from '$lib/paraglide/messages.js'; import DateInput from '$lib/components/DateInput.svelte'; interface Props { - senderId: string; fromDate?: string; toDate?: string; - sortDir?: string; - documentCount?: number; onapplyFilters: () => void; - ontoggleSort: () => void; } -let { - senderId, - fromDate = $bindable(''), - toDate = $bindable(''), - sortDir = $bindable('DESC'), - documentCount, - onapplyFilters, - ontoggleSort -}: Props = $props(); - -let hasDateFilter = $derived(!!(fromDate || toDate)); -let isActive = $derived(!!(fromDate || toDate || sortDir !== 'DESC')); +let { fromDate = $bindable(''), toDate = $bindable(''), onapplyFilters }: Props = $props();
- - - {m.conv_strip_period()} - - - onapplyFilters()} - placeholder={m.conv_strip_from_placeholder()} - class="w-[120px] border-line py-2.5 text-sm text-ink shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring {fromDate ? 'border-primary' : 'border-line'}" - /> - - +
+ + onapplyFilters()} + placeholder={m.conv_strip_from_placeholder()} + class="block w-full border-line px-3 py-2.5 text-sm text-ink shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring" + /> +
- onapplyFilters()} - placeholder={m.conv_strip_to_placeholder()} - class="w-[120px] border-line py-2.5 text-sm text-ink shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring {toDate ? 'border-primary' : 'border-line'}" - /> - - - - {m.conv_letters_count({ count: documentCount ?? 0 })} - - - - +
+ + onapplyFilters()} + placeholder={m.conv_strip_to_placeholder()} + class="block w-full border-line px-3 py-2.5 text-sm text-ink shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring" + /> +
diff --git a/frontend/src/routes/briefwechsel/CorrespondenzPersonBar.svelte b/frontend/src/routes/briefwechsel/CorrespondenzPersonBar.svelte index f6b077ef..022d672d 100644 --- a/frontend/src/routes/briefwechsel/CorrespondenzPersonBar.svelte +++ b/frontend/src/routes/briefwechsel/CorrespondenzPersonBar.svelte @@ -1,14 +1,20 @@ +
+ + +
+ + + + + + + + + {m.conv_letters_count({ count: documentCount })} + +
diff --git a/frontend/src/routes/briefwechsel/page.svelte.spec.ts b/frontend/src/routes/briefwechsel/page.svelte.spec.ts index f4f3fd74..6c73da12 100644 --- a/frontend/src/routes/briefwechsel/page.svelte.spec.ts +++ b/frontend/src/routes/briefwechsel/page.svelte.spec.ts @@ -103,9 +103,10 @@ describe('Briefwechsel page – results state', () => { await expect.element(page.getByTestId('conv-person-bar')).toBeInTheDocument(); }); - it('shows filter controls when senderId is set', async () => { + it('hides filter controls by default (collapsible)', async () => { render(Page, { data: withSender }); - await expect.element(page.getByTestId('conv-filter-controls')).toBeInTheDocument(); + await expect.element(page.getByTestId('conv-person-bar')).toBeInTheDocument(); + await expect.element(page.getByTestId('conv-filter-controls')).not.toBeInTheDocument(); }); }); @@ -149,16 +150,6 @@ describe('Briefwechsel page – single-person hint bar', () => { }); }); -// ─── Filter controls disabled state ────────────────────────────────────────── - -describe('Briefwechsel page – filter strip Row 2 disabled state', () => { - it('filter controls are not aria-disabled when senderId is set', async () => { - render(Page, { data: withSender }); - const strip = document.querySelector('[aria-disabled="false"]'); - expect(strip).not.toBeNull(); - }); -}); - // ─── Strip letter count ─────────────────────────────────────────────────────── describe('Briefwechsel page – strip letter count', () => {