feat(documents): explain that a date range excludes undated documents
DocumentList gains from/to props; when a date range is active and yields no results, the empty state shows the localized docs_range_excludes_undated note instead of the generic copy, so the reader understands undated letters aren't part of a range. Person-grouped modes keep undated letters under their sender/receiver (badge-on-row, no synthetic sub-group). Refs #668
This commit is contained in:
@@ -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[]) {
|
||||
</div>
|
||||
<h3 class="font-serif text-lg font-medium text-ink">{m.docs_empty_heading()}</h3>
|
||||
<p class="mt-1 font-sans text-sm text-ink-2">
|
||||
{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}
|
||||
</p>
|
||||
<button
|
||||
onclick={() => goto('/documents')}
|
||||
|
||||
Reference in New Issue
Block a user