Commit Graph

45 Commits

Author SHA1 Message Date
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
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
17727243be feat: add global auth listener with hard reload on logout 2025-12-18 21:45:27 +01:00
087292f65d feat: improve PWA auth robustness and session management 2025-12-18 21:27:00 +01:00
7008bbfd84 feat: social UI optimization, collapsible sections, and admin fixes 2025-12-18 21:16:09 +01:00
a64e8f17a1 feat: session deletion, improved tasting deletion visibility, and PWA login loop fix 2025-12-18 21:02:44 +01:00
c63a348e6b fix: add defensive fallbacks for missing database relationships 2025-12-18 20:35:38 +01:00
869c8fe9c5 feat: add stop session button and update walkthrough 2025-12-18 17:20:49 +01:00
ca1621e765 feat: refine session workflow with global state, quick tasting, and statistics 2025-12-18 17:19:38 +01:00
7f600698e4 feat: modernize search filters & intelligent label shortening
- Introduced shortenCategory utility to strip redundant terms from labels
- Refactored BottleGrid filters into a compact, collapsible layout
- Added filter count indicator and improved chip styling
- Fully localized new filter UI elements
2025-12-18 16:46:39 +01:00
a503e1a317 feat: expand camera analysis display with new fields
- Added distilled date, bottled date, and batch info to the analysis result summary in CameraCapture
- These fields now appear only if Gemini successfully identifies them from the photo
2025-12-18 16:10:50 +01:00
0f56c8b0f4 feat: add gallery upload and fix mobile header issues
- Added 'Upload from Gallery' button to CameraCapture component
- Implemented secondary file input without 'capture' attribute to allow gallery selection on mobile
- Fixed overlapping header elements on mobile by making the header responsive
- Compacted 'Dram of the Day' button on small screens
- Added translations for the new gallery upload feature
2025-12-18 15:48:11 +01:00
b18f8907a3 feat: add plan assignment to user management
- Added plan dropdown to user edit modal
- Shows current plan with highlighted card
- Allows admin to assign/change user's subscription plan
- Loads user's current plan when opening edit modal
- Updates plan via setUserPlan service
- Visual feedback with success/error messages

Admins can now:
- View user's current subscription plan
- Assign users to different plans (Starter, Bronze, Silver, Gold)
- See plan details (credits/month, price) in dropdown

This completes the subscription plan system!
2025-12-18 15:29:13 +01:00
42b4b2b2e1 feat: implement subscription plan system with monthly credits
- Database schema:
  * subscription_plans table - stores plan tiers (Starter, Bronze, Silver, Gold)
  * user_subscriptions table - assigns users to plans
  * Default plans created (10, 50, 100, 250 credits/month)
  * All existing users assigned to Starter plan

- Subscription service (subscription-service.ts):
  * getAllPlans() - fetch all plans
  * getActivePlans() - fetch active plans for users
  * createPlan() - admin creates new plan
  * updatePlan() - admin edits plan
  * deletePlan() - admin removes plan
  * getUserSubscription() - get user's current plan
  * setUserPlan() - admin assigns user to plan
  * grantMonthlyCredits() - distribute credits to all users

- Plan management interface (/admin/plans):
  * Visual plan cards with credits, price, description
  * Create/Edit/Delete plans
  * Toggle active/inactive status
  * Sort order management
  * Grant monthly credits button (manual trigger)

- Features:
  * Monthly credit allocation based on plan
  * Prevents duplicate credit grants (tracks last_credit_grant_at)
  * Admin can manually trigger monthly credit distribution
  * Plans can be activated/deactivated
  * Custom pricing and credit amounts per plan

- UI:
  * Beautiful plan cards with color coding
  * Modal for create/edit with validation
  * Success/error messages
  * Manage Plans button in admin dashboard

Ready for future automation (cron job for monthly credits)
and payment integration (Stripe/PayPal).
2025-12-18 15:16:44 +01:00
95a8b3940b feat: implement comprehensive credits management system
- Database schema:
  * Extended user_credits table with daily_limit, API costs, last_reset_at
  * Created credit_transactions table for full audit trail
  * Added RLS policies for secure access control

- Core services:
  * credit-service.ts - balance checking, deduction, addition, transaction history
  * admin-credit-service.ts - admin controls for managing users and credits

- API integration:
  * Integrated credit checking into discover-whiskybase.ts
  * Credits deducted after successful API calls
  * Insufficient credits error handling

- Admin interface:
  * /admin/users page with user management
  * Statistics dashboard (total users, credits in circulation, usage)
  * Interactive user table with search
  * Edit modal for credit adjustment and settings
  * Per-user daily limits and API cost configuration

- Features:
  * Automatic credit initialization (100 credits for new users)
  * Credit transaction logging with balance_after tracking
  * Admin can add/remove credits with reason
  * Admin can set custom daily limits per user
  * Admin can set custom API costs per user
  * Low credit warnings (< 10 credits)
  * Full transaction history

- User experience:
  * Credits checked before API calls
  * Clear error messages for insufficient credits
  * Graceful handling of credit deduction failures

System is ready for future enhancements like credit packages,
auto-recharge, and payment integration.
2025-12-18 15:02:32 +01:00
334bece471 feat: implement comprehensive i18n system with German and English support
- Created type-safe i18n system with TranslationKeys interface
- Added German (de) and English (en) translations with 160+ keys
- Implemented I18nContext provider and useI18n hook
- Added LanguageSwitcher component for language selection
- Refactored all major components to use translations:
  * Home page, StatsDashboard, DramOfTheDay
  * BottleGrid, EditBottleForm, CameraCapture
  * BuddyList, SessionList, TastingNoteForm
  * StatusSwitcher and bottle management features
- Implemented locale-aware currency formatting (EUR)
- Implemented locale-aware date formatting
- Added localStorage persistence for language preference
- Added automatic browser language detection
- Organized translations into 8 main categories
- System is extensible for additional languages
2025-12-18 13:44:48 +01:00
acf02a78dd feat: enhance bottle metadata with distillation/bottling dates and batch info 2025-12-18 13:24:41 +01:00
fef1c4a275 feat: implement automated Whiskybase ID discovery 2025-12-18 12:40:57 +01:00
35c2443473 feat: implement QOL features (Stats, Search, Dram of the Day) 2025-12-18 12:34:51 +01:00
970dabbbf6 feat: add bottle editing and purchase price tracking 2025-12-18 12:16:01 +01:00
6e09300bab feat: enforce 12-hour limit for active tasting sessions 2025-12-18 12:12:20 +01:00
e3af71c584 feat: complete bottle-to-session integration flow 2025-12-18 12:08:24 +01:00
d386bb9825 feat: add HEIC image support for iPhone uploads 2025-12-18 12:01:31 +01:00
e339585e3a fix: restore missing imports in CameraCapture 2025-12-18 11:52:07 +01:00
5f757d7b56 feat: implement Save & Taste flow in CameraCapture 2025-12-18 11:49:40 +01:00
e6974cd060 fix: resolve collection fetch race condition and improve tasting deletion UI 2025-12-18 11:17:22 +01:00
d07af05b66 feat: implement buddies and tasting sessions features 2025-12-18 10:56:41 +01:00
330c8e1cc0 feat: optimize layout for mobile devices (Pixel 9 Pro) 2025-12-18 09:59:31 +01:00
9ba1f8bd56 fix: corect layout spacing and restore filter functionality 2025-12-18 09:52:07 +01:00
a3aa4f8b25 fix: restore BottleGrid and apply storage URL normalization 2025-12-18 09:36:13 +01:00
a41a72fb0d eval fix 2025-12-18 00:32:45 +01:00
6f08bb3c4c feat: implement offline queue, background sync and AI robustness 2025-12-17 23:25:12 +01:00
fe82d52a85 style: polish bottle cards with premium aesthetic and better readability 2025-12-17 23:20:34 +01:00
939d69a634 feat: add tasting sorting and polish UI with premium aesthetic 2025-12-17 23:18:07 +01:00
19689ffd2f feat: implement PWA, manifest, service worker and offline indicator 2025-12-17 23:15:51 +01:00
5807d949ef init 2025-12-17 23:12:53 +01:00