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).
This commit is contained in:
2025-12-21 22:29:16 +01:00
parent 4e8af60488
commit b57f5dc2ad
12 changed files with 1482 additions and 120 deletions

View File

@@ -2,7 +2,6 @@
import { useEffect, useState } from 'react';
import { createClient } from '@/lib/supabase/client';
import CameraCapture from "@/components/CameraCapture";
import BottleGrid from "@/components/BottleGrid";
import AuthForm from "@/components/AuthForm";
import BuddyList from "@/components/BuddyList";
@@ -13,7 +12,9 @@ import LanguageSwitcher from "@/components/LanguageSwitcher";
import OfflineIndicator from "@/components/OfflineIndicator";
import { useI18n } from "@/i18n/I18nContext";
import { useSession } from "@/context/SessionContext";
import { Sparkles } from "lucide-react";
import { Sparkles, Camera } from "lucide-react";
import FloatingScannerButton from '@/components/FloatingScannerButton';
import ScanAndTasteFlow from '@/components/ScanAndTasteFlow';
export default function Home() {
const supabase = createClient();
@@ -23,6 +24,13 @@ export default function Home() {
const [fetchError, setFetchError] = useState<string | null>(null);
const { t } = useI18n();
const { activeSession } = useSession();
const [isFlowOpen, setIsFlowOpen] = useState(false);
const [capturedImage, setCapturedImage] = useState<string | null>(null);
const handleImageSelected = (base64: string) => {
setCapturedImage(base64);
setIsFlowOpen(true);
};
useEffect(() => {
// Check session
@@ -200,7 +208,6 @@ export default function Home() {
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 w-full max-w-5xl">
<div className="flex flex-col gap-8">
<CameraCapture onSaveComplete={fetchCollection} />
<SessionList />
</div>
<div>
@@ -232,10 +239,17 @@ export default function Home() {
</button>
</div>
) : (
<BottleGrid bottles={bottles} />
bottles.length > 0 && <BottleGrid bottles={bottles} />
)}
</div>
</div>
<FloatingScannerButton onImageSelected={handleImageSelected} />
<ScanAndTasteFlow
isOpen={isFlowOpen}
onClose={() => setIsFlowOpen(false)}
base64Image={capturedImage}
/>
</main>
);
}