feat: suggest date, sender and title from structured filename (#69) #78
Reference in New Issue
Block a user
Delete Branch "feat/filename-parsing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #69
parseFilename()utility (src/lib/utils/filename.ts) — full-match-only regex for four patterns:YYYY-MM-DD_Lastname_Firstname,YYYYMMDD_Lastname_Firstname, and both reversed. Partial matches return{}, unstructured names fall through unchanged.2024-03-15_Mueller_Hans.pdf) is shown below the accepted types line so users know the supported naming convention.titleFromFilename()— mirrors the same four patterns inDocumentService; dropzone quick-uploads now land with a formatted title (Hans Mueller (12.03.1965)) instead of the raw stripped filename. No sender auto-assignment (requires person to exist).Test plan
filename.spec.ts— all patterns, umlaut names, non-matching filenamesDocumentServiceTestcases fortitleFromFilename()— all 4 patterns + null + fallback1965-03-12_Mueller_Hans.pdfon/documents/new→ date shows12.03.1965, sender showsHans Mueller, title showsHans Mueller (12.03.1965)19650312_Mueller_Hans.pdf→ document title isHans Mueller (12.03.1965)🤖 Generated with Claude Code
Supports four patterns: date_lastname_firstname and lastname_firstname_date, both with ISO (YYYY-MM-DD) and compact (YYYYMMDD) date formats. Returns dateIso, personName and a formatted suggestedTitle. Partial matches are rejected — unrecognised filenames return {}. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>