Commit Graph

107 Commits

Author SHA1 Message Date
8cf51d4aea fix: Add retry logic for OpenRouter 429 rate limit errors
- Retries up to 3 times with exponential backoff (2s, 4s, 8s)
- Also handles 503 service unavailable errors
- Logs retry attempts for debugging
- Only retries rate limit errors, other errors fail immediately
2025-12-26 00:06:21 +01:00
8ccd600dcb feat: Instant editor opening with background AI analysis
- Editor opens immediately with placeholder data
- AI analyzes label in background while user can already edit
- Blue 'KI analysiert...' banner shows when AI is still working
- User edits preserved when AI results arrive (dirty field tracking)
- Model/provider shown in admin perf overlay
- Renamed 'CLOUD' to 'AI' in perf display
2025-12-26 00:02:38 +01:00
fb2a8d0f7b feat: Add OpenRouter as AI provider with easy switch
- Added openrouter.ts with provider configuration
- Default provider: OpenRouter with google/gemma-3-27b-it
- Switch to Gemini via AI_PROVIDER=gemini in .env.local
- Both providers use same credit system
- OpenRouter uses OpenAI-compatible API

To switch providers, set in .env.local:
AI_PROVIDER=openrouter  # default
AI_PROVIDER=gemini      # Google Gemini
2025-12-25 23:56:24 +01:00
f0f36e9c03 perf: Remove Tesseract OCR - saves ~45MB on mobile
- Removed Tesseract.js files from precache (~45MB)
- Scanner now uses only Gemini AI (more accurate, less data)
- Offline scans queued for later processing when online
- App download from ~50MB to ~5MB

BREAKING: Local offline OCR no longer available
Use Gemini AI instead (requires network for scanning)
2025-12-25 23:39:08 +01:00
462d27ea7b fix: Switch to @supabase/ssr for browser client
- Use createBrowserClient from @supabase/ssr instead of supabase-js
- Stores auth session in cookies (not localStorage) for SSR compatibility
- Server actions can now access authenticated user sessions
- Fixes 'Nicht autorisiert' error in split creation
2025-12-25 23:20:53 +01:00
2286867447 feat: Improve Bottle Split UX
- Add 'Split starten' button to bottle detail page
- Support flexible sample sizes (1-20cl) instead of fixed 5/10cl
- Preselect bottle when coming from bottle page
- Save sample sizes/shipping defaults to localStorage
- Update schema: sample_sizes JSONB array
- Update server actions and UI for dynamic sizes
2025-12-25 22:46:58 +01:00
0c7786db90 feat: Bottle Split System (Flaschenteilung)
- Add bottle_splits and split_participants tables with RLS
- Implement soft-lock: pending requests count as reserved
- Create /splits/create wizard (3 steps: bottle, pricing, shipping)
- Create /splits/[slug] public page with price calculator
- Create /splits/manage host dashboard with participant workflow
- Add SplitProgressBar component for visual volume display
- Status workflow: PENDING -> APPROVED -> PAID -> SHIPPED
- Forum export (BBCode format)
- Saved defaults in localStorage for glass/shipping costs
2025-12-25 22:36:38 +01:00
75461d7c30 feat: Buddy System & Bulk Scanner
- Add Buddy linking via QR code/handshake (buddy_invites table)
- Add Bulk Scanner for rapid-fire bottle scanning in sessions
- Add processing_status to bottles for background AI analysis
- Fix offline OCR with proper tessdata caching in Service Worker
- Fix Supabase GoTrueClient singleton warning
- Add collection refresh after offline sync completes

New components:
- BuddyHandshake.tsx - QR code display and code entry
- BulkScanSheet.tsx - Camera UI with capture queue
- BottleSkeletonCard.tsx - Pending bottle display
- useBulkScanner.ts - Queue management hook
- buddy-link.ts - Server actions for buddy linking
- bulk-scan.ts - Server actions for batch processing
2025-12-25 22:11:50 +01:00
afe9197776 feat: improved local OCR with Strip & Match distillery detection
- Added comprehensive distillery database (200+ entries)
- Implemented Strip & Match heuristic for fuzzy matching
- Added contextual age detection from distillery lines
- Added whitespace normalization for OCR text
- Disabled local name extraction (too noisy, let Gemini handle it)
- Fixed confidence scale normalization in TastingEditor (0-1 vs 0-100)
- Improved extractName filter (60% letters required)
- Relaxed Fuse.js thresholds for partial matches
2025-12-25 13:14:08 +01:00
a1a91795d1 feat: optimize scan OCR with sharp preprocessing and 1024px resizing 2025-12-24 00:02:58 +01:00
11275dd875 feat: unify tasting form refactor & align db schema status levels 2025-12-23 22:13:05 +01:00
6a41667f9c feat: refactor UploadQueue to floating bubble UI for mobile 2025-12-23 16:20:14 +01:00
c134c78a2c feat: improve AI resilience, add background enrichment loading states, and fix duplicate identifier in TagSelector 2025-12-23 11:38:16 +01:00
1d98bb9947 feat: log raw AI JSON response to browser console 2025-12-22 11:33:15 +01:00
fd168fea0e feat: granular performance tracking and cache hit indicators for AI scans 2025-12-22 10:45:05 +01:00
7d06ba7a57 feat: robust FormData handling for AI services to improve N100 performance and stability 2025-12-22 10:36:26 +01:00
5e35710b67 feat: optimize scan flow with WebP compression and fix admin metrics visibility 2025-12-22 10:15:29 +01:00
f0588418c8 Industrial Dark UI Overhaul: Updated colors, typography, navigation, and component styling across the application 2025-12-22 00:05:31 +01:00
cf491d83b6 DramLog UI Overhaul: Rebranding, Navigation Improvements, and Scan Workflow Fixes
- Renamed app to DramLog and updated branding to Gold (#C89D46)
- Implemented new BottomNavigation with Floating Scan Button
- Fixed 'black screen' race condition in ScanAndTasteFlow
- Refactored TastingEditor and StatsDashboard for a cleaner editorial look
- Standardized colors and typography across the application
2025-12-21 23:41:33 +01:00
d83d2a8873 feat: enable gallery upload and update scanner button theme to amber 2025-12-21 22:45:07 +01:00
b57f5dc2ad feat: refine Scan & Taste UI, fix desktop scrolling, and resolve production login fetch error
- Reverted theme from gold to amber and restored legacy typography.
- Refactored ScanAndTasteFlow and TastingEditor for robust desktop scrolling.
- Hotfixed sw.js to completely bypass Supabase Auth/API requests to fix 'Failed to fetch' in production.
- Integrated full tasting note persistence (tags, buddies, sessions).
2025-12-21 22:29:16 +01:00
4e8af60488 fix: robust SW status tracking and polling for mobile production 2025-12-21 00:33:50 +01:00
ab8f0fe3ef fix: robust SW progress sync and startup delay 2025-12-21 00:21:01 +01:00
f0cb661d91 fix: enable SW on localhost and optimize pre-cache sequence for faster feedback 2025-12-21 00:18:38 +01:00
716afce2ae feat: move offline indicator to header, rename to Offline-Modus, and redesign tasting form 2025-12-21 00:13:33 +01:00
74a10b193c fix: mobile indicator visibility, sequential pre-cache, and verified ready state 2025-12-21 00:02:39 +01:00
000f2582a3 fix: optimize bunker loading and add progress feedback 2025-12-20 23:57:55 +01:00
b0a79541b6 feat: add Offline Mode Indicator (Bunker Status) 2025-12-20 23:51:16 +01:00
7d5091a139 fix: resolve pre-cache 404s and implement Bunker v7 with SWR 2025-12-20 23:44:37 +01:00
e0436987a1 feat: Unify AI prompts for Gemini and Mistral 2025-12-19 22:01:29 +01:00
2601a8f12f feat: Switch to Mistral Large 3 (mistral-large-latest) 2025-12-19 21:59:51 +01:00
25b1378794 feat: Replace Nebius with Pixtral AI for bottle scanning 2025-12-19 21:53:18 +01:00
06891a3619 style: Add wall clock time to session timeline 2025-12-19 21:11:36 +01:00
fdc1dd01e5 feat: Complete Flight Recorder with Session Closing and UI feedback 2025-12-19 21:06:16 +01:00
822dc18bfc style: Improve active session visibility and fix mobile timeline layout 2025-12-19 21:01:48 +01:00
b48ad8cd56 fix: Resolve build blockers by removing outdated tests and refining schema 2025-12-19 20:53:11 +01:00
0a692498ce fix: Type error in TastingList for optional bottle_id 2025-12-19 20:50:42 +01:00
e8c3032954 feat: Add Flight Recorder, Timeline, ABV Curve and Offline Bottle Caching with Draft Notes support 2025-12-19 20:45:20 +01:00
24e243fff8 feat: Upgrade to Next.js 16.1 & React 19.2, migrate to Supabase SSR with async client handling 2025-12-19 20:31:46 +01:00
d9b44a0ec5 fix(ai): prevent OpenAI credential error at module load time
- Moved OpenAI client initialization to a lazy getter function
- Added explicit check for NEBIUS_API_KEY in the getter
- Ensures Server Actions return structured errors instead of crashing when keys are missing
2025-12-19 14:30:38 +01:00
e2c9bef8f4 fix: improve server action resilience and error logging
- Moved Supabase client initialization inside try-catch in Server Actions
- Added safety checks for null Supabase client in magicScan
- Added detailed server-side logging for debugging deployment issues
- Ensures all failure paths return a structured error response instead of 500
2025-12-19 14:28:40 +01:00
cbb28b389c fix: resolve TagSelector build error and improve component type safety
- Fixed undefined setTags in TagSelector.tsx
- Updated TagSelector to use Dexie cache for immediate UI updates
- Refined TastingList mapping to satisfy TypeScript interface
- Verified fix with a successful production build
2025-12-19 14:17:40 +01:00
f52cfb80fc fix: resolve magic scan crash and implement context-aware AI languages
- Fixed SQL syntax error in magicScan caused by single quotes
- Implemented dynamic locale-aware AI suggestions (Technical: EN, Custom Tags: Localized)
- Updated Dexie schema to version 2 (added locale to pending_scans)
- Fixed missing bottle_id in UploadQueue synchronization
- Installed missing dexie dependencies via pnpm
2025-12-19 14:06:13 +01:00
60ca3a6190 feat: implement robust offline-first sync with Dexie.js
- Migrated to Dexie.js for IndexedDB management
- Added optimistic UI for tasting notes with 'Wartet auf Sync' badge
- Implemented background caching for tags and buddies
- Unified scanning and tasting sync in a global UploadQueue
2025-12-19 13:40:56 +01:00
e08a18b2d5 fix: add missing state for suggested custom tags in TastingNoteForm 2025-12-19 13:20:38 +01:00
14e7759cf9 feat: complete AI custom tag proposals integration
- Fixed data fetching in TastingNoteForm to include suggested_custom_tags
- Verified Nebius service compatibility with updated AI prompts
- Cleaned up artifacts and implementation plan
2025-12-19 13:20:30 +01:00
74916aec73 feat: implement AI custom tag proposals
- AI now suggests dominant notes not in the system list (Part 3: Custom Suggestions)
- Updated TagSelector to show 'Neu anlegen?' buttons for AI-proposed custom tags
- Added suggested_custom_tags to bottles table and metadata schema
- Updated TastingNoteForm to handle both system and custom AI suggestions
2025-12-19 13:20:13 +01:00
b2a1d292da feat: implement advanced tagging system, tag weighting, and app focus refactoring
- Implemented reusable TagSelector component with i18n support
- Added tag weighting system (popularity scores 1-5)
- Created admin panel for tag management
- Integrated Nebius AI and Brave Search for 'Magic Scan'
- Refactored app focus: removed bottle status, updated counters, and displayed extended bottle details
- Updated i18n for German and English
- Added database migration scripts
2025-12-19 12:58:44 +01:00
9eb9b41061 feat: implement server-side image compression with sharp and cleanup RLS policies 2025-12-18 22:08:28 +01:00
d26ebc0b2e fix(query): resolve PostgREST grouping error in SessionList 2025-12-18 21:48:25 +01:00