ExpirationBadge component: Visual indicators for documents expiring within 30 days (amber) or already expired (red)
DocumentCardMetadata component: Type-specific metadata display that adapts based on document type (insurance, registration, manual) and variant (card, mobile, detail)
Updated DocumentsPage: Desktop list cards now show metadata and expiration badges
Updated DocumentsMobileScreen: Mobile cards with compact metadata display
Redesigned DocumentDetailPage: Side-by-side layout on desktop (preview left, metadata right) and stacked layout on mobile with full metadata visibility
Changes
File
Change
ExpirationBadge.tsx
NEW - Expiration warning/expired badge component
ExpirationBadge.test.tsx
NEW - 15 unit tests
DocumentCardMetadata.tsx
NEW - Type-specific metadata display
DocumentCardMetadata.test.tsx
NEW - 18 unit tests
DocumentsPage.tsx
MODIFIED - Added badges and metadata to cards
DocumentsMobileScreen.tsx
MODIFIED - Added badges and metadata to mobile cards
DocumentDetailPage.tsx
MODIFIED - Complete redesign with side-by-side layout
jest.config.ts
MODIFIED - Fixed testMatch pattern
Test Plan
ExpirationBadge unit tests pass (15 tests)
DocumentCardMetadata unit tests pass (18 tests)
npm run lint - passes (only pre-existing warnings)
npm run type-check - passes
Manual testing on desktop viewport (1920px)
Manual testing on tablet viewport (768px)
Manual testing on mobile viewport (320px, 375px)
Verify expiration badges show correctly for expiring/expired documents
Verify metadata displays correctly for insurance, registration, manual types
- Create ExpirationBadge component with 30-day warning and expired states
- Create DocumentCardMetadata component for type-specific field display
- Update DocumentsPage to show metadata and expiration badges on cards
- Update DocumentsMobileScreen with metadata and badges (mobile variant)
- Redesign DocumentDetailPage with side-by-side layout (desktop) and
stacked layout (mobile) showing full metadata panel
- Add 33 unit tests for new components
- Fix jest.config.ts testMatch pattern for test discovery
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Rename "Open" button to "View Details" on desktop and mobile document lists
- Add hasDisplayableMetadata helper to check if document has metadata to display
- Conditionally render Details section only when metadata exists
- Prevents showing empty "Details" header for documents without metadata
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Fixes #43
This PR enhances the Documents feature with:
Changes
ExpirationBadge.tsxExpirationBadge.test.tsxDocumentCardMetadata.tsxDocumentCardMetadata.test.tsxDocumentsPage.tsxDocumentsMobileScreen.tsxDocumentDetailPage.tsxjest.config.tsTest Plan
Screenshots
To be added during review
🤖 Generated with Claude Code