- Add cursor-pointer to all clickable buttons and interactive elements
- Add focus:ring-2 focus:ring-primary/blue focus:outline-none to all buttons
- Add aria-label to icon-only buttons and actions
- Update focus states from focus-visible to focus for consistency
- Add disabled:cursor-not-allowed for disabled button states
- Improve keyboard navigation with proper focus indicators
Components updated:
- BottomNav: navigation buttons with aria-labels
- Scanner: try again, zoom, word selection, cancel buttons
- ItemComparisonModal: skip and update action buttons
- ConfirmationModal: close, cancel, delete buttons with input focus
- AIOnboarding: all mode toggles, camera, upload, capture, edit, delete buttons
- Plus interactive cards and list items
This ensures WCAG AA compliance for keyboard navigation and visual feedback.
- Increased tesseract.js worker creation timeout from 8s → 20s (accounts for lazy loading and language model download on first run)
- Added allowedDevOrigins to next.config.mjs to permit localhost and .local hostnames
- Resolves OCR timeout on slow connections and first-time initialization
Addressed P3 design opportunities from critique:
1. Technical Jargon Simplification
- "Optical Assist" → "Smart Scan" (clearer scanning intent)
- "Protocol Detected" → "Text Found" (plain language)
- "OCR Matching Key" → "Item ID or Code" (concrete terminology)
- "Select identity from label matrix" → "Tap any text to use it"
- Removed cryptic "Cycle" terminology, added countdown seconds
2. Feature Discoverability
- Added helpful descriptions to Admin manager sections
- Scanner status message now hints at zoom and tap features
- Concrete examples in input placeholders
3. Help & Documentation
- User Management: "Create accounts and control access"
- Category Groups: "Organize items by type or location"
- Sign Out: clearer procedure description
Build: passes with zero errors
Replace static import of tesseract.js (500KB) with dynamic import in Scanner
component. Library now only loads when OCR recognition is actually performed,
not on initial page load.
Performance Impact:
- Removes 500KB from initial bundle
- Library only loads when user activates OCR mode
- Preload strategy in page.tsx still works (loads on-demand if scanner opened)
- No functional change; same behavior, faster initial load
Implementation:
- Remove static import from Scanner.tsx (line 6)
- Replace with dynamic import at point of use (line 166+)
- page.tsx preloadOCR already uses dynamic import (no change needed)
- Improves initial page load time significantly
Build: Passes with zero errors. Compile time: 2.4s.
- Fix null type error in AIOnboarding.tsx line 352: img src attribute
- Fix similar issue in Scanner.tsx line 237: capturedImage null handling
- Use '|| undefined' pattern to satisfy React 19/Next.js 15 type requirements
- Both components now properly handle null/undefined image states