diff --git a/frontend/src/routes/DocumentList.svelte b/frontend/src/routes/DocumentList.svelte index 8d29c870..e0cc4d17 100644 --- a/frontend/src/routes/DocumentList.svelte +++ b/frontend/src/routes/DocumentList.svelte @@ -15,7 +15,9 @@ let { error, total = 0, q = '', - sort = 'DATE' + sort = 'DATE', + from = '', + to = '' }: { items: DocumentListItem[]; canWrite: boolean; @@ -23,8 +25,15 @@ let { total?: number; q?: string; sort?: SortMode; + from?: string; + to?: string; } = $props(); +// A from/to range excludes undated documents — when it yields nothing, the +// empty state must say so explicitly (a localized constant, never a reflected +// backend string). Issue #668. +const hasDateRange = $derived(!!from || !!to); + const groups = $derived.by(() => { if (sort === 'SENDER') return groupBySender(items); if (sort === 'RECEIVER') return groupByReceiver(items); @@ -119,7 +128,13 @@ function groupByReceiver(docItems: DocumentListItem[]) {

{m.docs_empty_heading()}

- {q ? m.docs_empty_for_term({ term: q }) : m.docs_empty_text()} + {#if hasDateRange} + {m.docs_range_excludes_undated()} + {:else if q} + {m.docs_empty_for_term({ term: q })} + {:else} + {m.docs_empty_text()} + {/if}