Allow photos from the library, several at once (26.11.43)
ci / olares chart · sanity (pull_request) Successful in 3s
ci / app · types + tests + build (pull_request) Successful in 3m7s
markt / eintrag (pull_request) Successful in 29s
ci / oberfläche · Browser am iPhone (pull_request) Successful in 7m47s

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HUc2nv7rJVU2gp3Bgtha3q
This commit is contained in:
Kai BöhmandClaude Opus 5.5 committed 2026-11-07 18:50:03 +00:00
1 parent cfb816b724
commit ac2f60baff
13 files changed
+55 -33

No files matched your search

+2 -2
View File
@@ -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
+2 -2
View File
@@ -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:
-1
View File
@@ -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
+17 -11
View File
@@ -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))}
/>
<Button
variant="secondary"
-1
View File
@@ -43,7 +43,6 @@ export function PhotoImport() {
<input
type="file"
accept="image/*"
capture="environment"
multiple
className="sr-only"
aria-label={t("choose")}
+13
View File
@@ -486,6 +486,19 @@ test("a dish to try says so, links to its tab and moves to the pool with one tap
await expect(page.locator("main").getByRole("link", { name: "Gerichte", exact: true })).toHaveAttribute("href", "/gerichte?ansicht=ausprobieren");
await note.getByRole("button", { name: "In den Pool" }).click();
await expect(note).toHaveCount(0);
// Fotos auch aus der Mediathek, mehrere auf einmal (26.11.43): kein capture, multiple.
const picker = page.locator("input[type=file]");
expect(await picker.getAttribute("capture")).toBeNull();
expect(await picker.getAttribute("multiple")).not.toBeNull();
const shots = await Promise.all(
[[200, 80, 60], [60, 140, 90]].map(async ([r, g, b], i) => ({
name: `mediathek-${i}.png`,
mimeType: "image/png",
buffer: await sharp({ create: { width: 800, height: 600, channels: 3, background: { r: r!, g: g!, b: b! } } }).png().toBuffer(),
})),
);
await picker.setInputFiles(shots);
await expect(page.getByRole("heading", { name: "Fotos · 2 von 5" })).toBeVisible();
await page.goto("/gerichte");
await expect(page.getByRole("link", { name: /Probe-Auflauf/ })).toBeVisible();
// Aufräumen, damit der Plan danach denselben Bestand vorschlägt.
+3 -3
View File
@@ -377,7 +377,7 @@
"remove": "Entfernen",
"removed": "„{title}“ ist aus dem Pool entfernt.",
"undo": "Rückgängig",
"photo": "Foto aufnehmen",
"photo": "Foto hinzufügen",
"photoError": "Das Foto ließ sich nicht lesen. Nimm ein JPEG, PNG oder HEIC bis 15 MB.",
"stepTimer": "{n} Min.",
"source": "Quelle",
@@ -485,9 +485,9 @@
"addPhotoText": "Die AI liest Zutaten und Schritte von der Seite ab.",
"photo": {
"title": "Kochbuch fotografieren",
"choose": "Seite fotografieren",
"choose": "Seite fotografieren oder wählen",
"chosen": "{n, plural, one {1 Foto gewählt} other {# Fotos gewählt}}",
"chooseHint": "Eine Rezeptseite, höchstens zwei Fotos. Das Foto wird nicht gespeichert.",
"chooseHint": "Eine Rezeptseite, höchstens zwei Fotos – neu aufgenommen oder aus der Mediathek. Das Foto wird nicht gespeichert.",
"read": "Rezept lesen",
"reading": "Die AI liest …",
"readingHint": "Das kann eine Minute dauern.",
+3 -3
View File
@@ -377,7 +377,7 @@
"remove": "Remove",
"removed": "\"{title}\" was removed from the pool.",
"undo": "Undo",
"photo": "Take a photo",
"photo": "Add photo",
"photoError": "The photo couldn't be read. Use a JPEG, PNG or HEIC up to 15 MB.",
"stepTimer": "{n} min",
"source": "Source",
@@ -485,9 +485,9 @@
"addPhotoText": "The AI reads ingredients and steps from the page.",
"photo": {
"title": "Photograph a cookbook",
"choose": "Take a photo of the page",
"choose": "Take or choose a photo of the page",
"chosen": "{n, plural, one {1 photo chosen} other {# photos chosen}}",
"chooseHint": "One recipe page, at most two photos. The photo is not kept.",
"chooseHint": "One recipe page, at most two photos – new or from your library. The photo is not kept.",
"read": "Read recipe",
"reading": "The AI is reading …",
"readingHint": "This can take a minute.",
+3 -3
View File
@@ -377,7 +377,7 @@
"remove": "Remove",
"removed": "\"{title}\" was removed from the pool.",
"undo": "Undo",
"photo": "Take a photo",
"photo": "Add photo",
"photoError": "The photo couldn't be read. Use a JPEG, PNG or HEIC up to 15 MB.",
"stepTimer": "{n} min",
"source": "Source",
@@ -485,9 +485,9 @@
"addPhotoText": "The AI reads ingredients and steps from the page.",
"photo": {
"title": "Photograph a cookbook",
"choose": "Take a photo of the page",
"choose": "Take or choose a photo of the page",
"chosen": "{n, plural, one {1 photo chosen} other {# photos chosen}}",
"chooseHint": "One recipe page, at most two photos. The photo is not kept.",
"chooseHint": "One recipe page, at most two photos – new or from your library. The photo is not kept.",
"read": "Read recipe",
"reading": "The AI is reading …",
"readingHint": "This can take a minute.",
+3 -3
View File
@@ -377,7 +377,7 @@
"remove": "Remove",
"removed": "\"{title}\" was removed from the pool.",
"undo": "Undo",
"photo": "Take a photo",
"photo": "Add photo",
"photoError": "The photo couldn't be read. Use a JPEG, PNG or HEIC up to 15 MB.",
"stepTimer": "{n} min",
"source": "Source",
@@ -485,9 +485,9 @@
"addPhotoText": "The AI reads ingredients and steps from the page.",
"photo": {
"title": "Photograph a cookbook",
"choose": "Take a photo of the page",
"choose": "Take or choose a photo of the page",
"chosen": "{n, plural, one {1 photo chosen} other {# photos chosen}}",
"chooseHint": "One recipe page, at most two photos. The photo is not kept.",
"chooseHint": "One recipe page, at most two photos – new or from your library. The photo is not kept.",
"read": "Read recipe",
"reading": "The AI is reading …",
"readingHint": "This can take a minute.",
+2 -2
View File
@@ -2,5 +2,5 @@ apiVersion: v2
name: lunch
description: foodplanhero (Plan. Cook. Smile.) — die Familie entscheidet gemeinsam, was es gibt; aus dem Plan entsteht die Einkaufsliste
type: application
version: 26.11.42 # YY.M.<n> wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen
appVersion: "26.11.42" # MUSS gleich version sein: der Linter prüft es, und der Image-Tag hängt daran
version: 26.11.43 # YY.M.<n> wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen
appVersion: "26.11.43" # MUSS gleich version sein: der Linter prüft es, und der Image-Tag hängt daran
+2 -2
View File
@@ -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:
+5
View File
@@ -0,0 +1,5 @@
# Photos from your library
v26.11.43: Photos for a dish no longer have to be taken with the camera. Tapping "Add photo" on the iPhone now offers the photo library, the camera and files, and you can pick several photos from the library at once, up to five per dish. The same works for photos of a cookbook page and for the photo after cooking.
## Deutsch
v26.11.43: Fotos für ein Gericht müssen nicht mehr mit der Kamera aufgenommen werden. „Foto hinzufügen“ bietet am iPhone jetzt Fotomediathek, Kamera und Dateien an, und aus der Mediathek lassen sich mehrere Fotos auf einmal wählen, bis zu fünf je Gericht. Genauso geht es beim Foto einer Kochbuchseite und beim Foto nach dem Kochen.