Add T1 Tesseract.js client-side OCR fallback notes

2026-05-21 11:10:19 -04:00
parent 3c3c478300
commit 15ee983a97
+10
@@ -12,6 +12,16 @@ Mobile-first web app for tracking physical assets via barcode scanning, OCR stic
- Username: `admin`
- Password: `Brett85!@`
### T1 Tesseract.js Client-Side OCR Fallback — May 2026
- **CDN**: `tesseract.js@5` added to `<head>`
- **Server-first, client-fallback**: `captureOcr()` tries `/api/ocr` with 8s AbortController timeout; on failure/timeout, falls back to `ocrImageClient()` using Tesseract.js (WASM-based, in-browser)
- **`ocrImageClient(imageBlob)`**: Calls `Tesseract.recognize()` with progress logger, 30s timeout via `Promise.race`, extracts machine_id using same `XXXXX-XXXXXX` regex pattern as server-side
- **`updateOcrProgress(m)`**: Progress bar showing % complete; auto-hides on done/error
- **`parseMachineId(text)`**: JS port of server regex — 5digit-6digit pattern → last 5 digits; fallback to any 5+ digit number
- **Offline badge**: Amber "📡 Offline OCR" shown in status bar during fallback and on result card
- **Progress bar UI**: Small animated bar near OCR status area
- Commit: 5cb8e8a
### T11b Page Transitions + Micro-animations — May 2026
- **Direction-aware tab transitions** — Forward navigation slides in from right, back navigation (to `_prevTab`) slides in from left using reverse animation classes
- **FAB duplicate cleanup** — Removed duplicate FAB HTML element and conflicting CSS block; unified under single `.fab` definition with `.fab.pulse` class