As a user I want the system to suggest date and sender from the filename so I have less to type when uploading scanned documents #69
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
Background
Scanners and scanning apps often produce files with structured names like
2024-03-15_Hans_Mueller.pdfor19650312-Oma.pdf. Parsing these automatically saves several keystrokes per document and reduces the chance of data entry errors.User Journey
User uploads a file named
1965-03-12_Hans_Mueller.pdf. The system parses the filename and:12.03.1965Hans Mueller(shown as a suggestion, not yet committed)The user can accept, correct, or ignore each suggestion. If the filename doesn't match any known pattern, no suggestion is made and the form behaves as normal.
Parsing patterns to support
2024-03-15_Firstname_Lastname.pdf20240315_Firstname_Lastname.pdfFirstname_Lastname_2024-03-15.pdf2024-03-15.pdfFirstname_Lastname.pdfNames are matched loosely — the suggestion is shown in the typeahead but the user must confirm (select from the dropdown or create new person). No automatic person creation from a filename.
E2E Scenarios
Implementation notes
parseFilename(name: string): { date?: string; personName?: string }utility function insrc/lib/utils/keeps this testable in isolation.initialNameprop — use that to pass the parsed name.Also applies during bulk upload (#66): filename parsing should run for each file in the drop zone, so documents land with dates/names already populated where the filename is structured.