chore: improve document card with upload date and file type icon (#162) #172
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?
Relates to #162
Severity: Medium
Problem
The document card shows "Maintenance / Type: manual / Vehicle: YOTA" with view/edit/delete icons, but no upload date, no file size, no thumbnail preview. It's hard to identify documents at scale.
Recommendation
Acceptance Criteria
Implementation Plan (from #162 -- Milestone 16)
Phase: 7 (Document improvements) | Priority: Medium | Depends on: None | Blocks: None
Context
Document cards lack upload date and file type information, making it harder to scan and identify documents at a glance.
Implementation
1. In
frontend/src/features/documents/components/DocumentCardMetadata.tsx:createdAtfield fromDocumentRecordtype (line 22 ofdocuments.types.ts)date-fns/formatDistanceToNowor similar (e.g., "Uploaded 3 days ago")contentTypefield:application/pdf->PictureAsPdfRoundedIconimage/*->ImageRoundedIconInsertDriveFileRoundedIcon2. Ensure consistent rendering in:
frontend/src/features/documents/pages/DocumentsPage.tsx(desktop card grid)frontend/src/features/documents/mobile/DocumentsMobileScreen.tsx(same card rendering pattern)Files
frontend/src/features/documents/components/DocumentCardMetadata.tsxfrontend/src/features/documents/pages/DocumentsPage.tsx(card rendering)frontend/src/features/documents/mobile/DocumentsMobileScreen.tsxCommit Convention
Test Criteria
Branch
Work on branch
issue-162-ux-design-audit-cleanup(shared with all #162 sub-issues)Milestone: Implementation Complete
Phase: Execution | Agent: Developer | Status: PASS
Changes
dayjswithrelativeTimeplugin for "X days ago" formattingPictureAsPdfRoundedIcon,ImageRoundedIcon,InsertDriveFileRoundedIconbased oncontentTypeVerification
553877bVerdict: PASS | Next: Move to status/done