feat(search): add year/group headers in document list when sorted by date, sender, or receiver #236

Merged
marcel merged 11 commits from feat/issue-220-group-headers into main 2026-04-15 10:48:16 +02:00
Showing only changes of commit 25aa05411f - Show all commits

View File

@@ -19,7 +19,12 @@ export async function load({ url, fetch }) {
const sort: ValidSort = (VALID_SORTS as readonly string[]).includes(rawSort)
? (rawSort as ValidSort)
: 'DATE';
const dir = url.searchParams.get('dir') || 'desc';
const VALID_DIRS = ['asc', 'desc'] as const;
type ValidDir = (typeof VALID_DIRS)[number];
const rawDir = url.searchParams.get('dir') ?? 'desc';
const dir: ValidDir = (VALID_DIRS as readonly string[]).includes(rawDir)
? (rawDir as ValidDir)
: 'desc';
const tagQ = url.searchParams.get('tagQ') || '';
const isDashboard = !q && !from && !to && !senderId && !receiverId && !tags.length && !tagQ;