From ac2f60baff22f335ff792eb4451682e13b938ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20B=C3=B6hm?= Date: Sat, 7 Nov 2026 18:50:03 +0000 Subject: [PATCH] Allow photos from the library, several at once (26.11.43) The photo inputs on the dish page, for a cookbook page and after cooking no longer force the camera (no capture attribute), so iOS offers the photo library, the camera and files. On the dish page several photos can be picked at once and are uploaded one after another up to the limit of five. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HUc2nv7rJVU2gp3Bgtha3q --- CLAUDE.md | 4 ++-- OlaresManifest.yaml | 4 ++-- components/cooking/rate-card.tsx | 1 - components/dishes/dish-actions.tsx | 28 +++++++++++++++++----------- components/dishes/photo-import.tsx | 1 - e2e/gerichte.spec.ts | 13 +++++++++++++ messages/de.json | 6 +++--- messages/en.json | 6 +++--- messages/es.json | 6 +++--- messages/fr.json | 6 +++--- olares/Chart.yaml | 4 ++-- olares/OlaresManifest.yaml | 4 ++-- olares/markt/26.11.43.md | 5 +++++ 13 files changed, 55 insertions(+), 33 deletions(-) create mode 100644 olares/markt/26.11.43.md diff --git a/CLAUDE.md b/CLAUDE.md index 5aabbcd..673e106 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -7,7 +7,7 @@ > **Plattform:** Olares One (Kubernetes), Repo und CI auf Gitea — kein Supabase, > kein Vercel (E-0001). Eigene Gestaltung, nicht AImighty (E-0002). > Verteilung über den Markt, Repo öffentlich (E-0005). -> **Status:** 26.11.42 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: +> **Status:** 26.11.43 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: > Anmeldung (Passkeys, Kinder mit Gerät + PIN), Gerichte (Link, Kochbuchfoto, AI über den > Olares Router), Wünschen, Plan, Einkaufsliste (Echtzeit, offline), Kochmodus mit > Bewertung, Web-App; Einzahl bei Stück-Mengen (26.11.15), Preise und Kosten mit Ampel @@ -21,7 +21,7 @@ > eigene Zutaten und Lieblingsprodukt je Haushalt (26.11.38, E-0015), Löffel und Gebinde > (26.11.39, E-0016), Anmelden per Mail-Link über Resend (26.11.40, E-0017; nur > anmelden, keine Geräte oder Passkeys aus einer Mail-Sitzung), Leiste bleibt nach der -> Tastatur unten (26.11.41), Icon Kochmütze mit Herz (26.11.42). Offen: Kai trägt +> Tastatur unten (26.11.41), Icon Kochmütze mit Herz (26.11.42), Fotos aus der Mediathek (26.11.43). Offen: Kai trägt > den Resend-Schlüssel unter Mehr › Mails verschicken ein. > **Letzte Aktualisierung:** 7. November 2026 diff --git a/OlaresManifest.yaml b/OlaresManifest.yaml index 69bea4f..4c258ea 100644 --- a/OlaresManifest.yaml +++ b/OlaresManifest.yaml @@ -21,7 +21,7 @@ metadata: title: foodplanhero description: Plan. Cook. Smile. The family decides together what's for dinner — and the shopping list writes itself. Runs entirely on your own box. icon: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png - version: 26.11.42 + version: 26.11.43 categories: - Applications @@ -61,7 +61,7 @@ permission: appData: true spec: - versionName: '26.11.42' + versionName: '26.11.43' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: diff --git a/components/cooking/rate-card.tsx b/components/cooking/rate-card.tsx index e70bd9b..452ca3b 100644 --- a/components/cooking/rate-card.tsx +++ b/components/cooking/rate-card.tsx @@ -85,7 +85,6 @@ export function RateCard({ item }: { item: ToRate }) { ref={file} type="file" accept="image/*" - capture="environment" className="sr-only" tabIndex={-1} aria-hidden diff --git a/components/dishes/dish-actions.tsx b/components/dishes/dish-actions.tsx index f00f080..cabd4fb 100644 --- a/components/dishes/dish-actions.tsx +++ b/components/dishes/dish-actions.tsx @@ -24,19 +24,24 @@ export function PhotoButton({ const [busy, setBusy] = useState(false); const [error, setError] = useState<"photo" | "full" | null>(null); - async function upload(file: File) { + // Mehrere aus der Mediathek (26.11.43): nacheinander, bis fünf erreicht sind. + async function upload(files: File[]) { setBusy(true); setError(null); - const form = new FormData(); - form.append("photo", file); - const res = await fetch(`/api/dishes/${id}/photos`, { - method: "POST", - body: form, - }); + let failed: "photo" | "full" | null = null; + for (const file of files.slice(0, Math.max(0, 5 - count))) { + const form = new FormData(); + form.append("photo", file); + const res = await fetch(`/api/dishes/${id}/photos`, { method: "POST", body: form }).catch(() => null); + if (!res?.ok) { + failed = res && (await res.json().catch(() => ({}))).error === "full" ? "full" : "photo"; + break; + } + } setBusy(false); if (input.current) input.current.value = ""; - if (res.ok) router.refresh(); - else setError((await res.json().catch(() => ({}))).error === "full" ? "full" : "photo"); + setError(failed); + router.refresh(); } return ( @@ -45,11 +50,12 @@ export function PhotoButton({ ref={input} type="file" accept="image/*" - capture="environment" + // Ohne capture: Das iPhone bietet Fotomediathek, Kamera und Dateien an (Kai, 26.11.43). + multiple className="sr-only" tabIndex={-1} aria-hidden - onChange={(e) => e.target.files?.[0] && upload(e.target.files[0])} + onChange={(e) => e.target.files?.length && upload(Array.from(e.target.files))} />