diff --git a/CLAUDE.md b/CLAUDE.md
index a1819fc..219827a 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.45 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut:
+> **Status:** 26.11.46 — 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
@@ -22,7 +22,7 @@
> (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), Fotos aus der Mediathek (26.11.43), gleich große Karten (26.11.44), Runde beenden/löschen/ändern,
-> Tage je Gericht von Hand und Kalender-Abo je Haushalt (26.11.45, E-0018). Offen: Kai trägt
+> Tage je Gericht von Hand und Kalender-Abo je Haushalt (26.11.45, E-0018), Einkaufsliste einsprechen (26.11.46). Offen: Kai trägt
> den Resend-Schlüssel unter Mehr › Mails verschicken ein und abonniert den Kalender-Link einmal auf dem iPhone.
> **Letzte Aktualisierung:** 8. November 2026
diff --git a/OlaresManifest.yaml b/OlaresManifest.yaml
index 9baccd1..e379235 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.45
+ version: 26.11.46
categories:
- Applications
@@ -61,7 +61,7 @@ permission:
appData: true
spec:
- versionName: '26.11.45'
+ versionName: '26.11.46'
featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png
promoteImage:
diff --git a/app/(app)/einkauf/page.tsx b/app/(app)/einkauf/page.tsx
index 2a9c19b..9cb4451 100644
--- a/app/(app)/einkauf/page.tsx
+++ b/app/(app)/einkauf/page.tsx
@@ -4,6 +4,7 @@ import { getLocale, getTranslations } from "next-intl/server";
import { ShoppingList } from "@/components/shopping/shopping-list";
import { StorePicker } from "@/components/shopping/store-picker";
import { buttonVariants } from "@/components/ui/button";
+import { aiFor } from "@/lib/ai-settings";
import { requireAdult } from "@/lib/auth/session";
import { withHousehold } from "@/lib/db";
import { currentRound } from "@/lib/rounds";
@@ -37,7 +38,7 @@ export default async function ShoppingPage() {
{data.chains.length ? : null}
{"items" in data && data.items ? (
-
+
) : (
{data.round ? t("notYet") : t("noRound")}
diff --git a/app/api/dishes/voice/route.ts b/app/api/dishes/voice/route.ts
index 8c78d45..8efeb8e 100644
--- a/app/api/dishes/voice/route.ts
+++ b/app/api/dishes/voice/route.ts
@@ -1,30 +1,13 @@
-import { getLocale } from "next-intl/server";
-import { AiNotConfigured, AiUnavailable, transcribe } from "@/lib/ai";
-import { aiFor } from "@/lib/ai-settings";
import { guardWrite, isResponse } from "@/lib/auth/guard";
-import { fail, json } from "@/lib/auth/http";
+import { json } from "@/lib/auth/http";
+import { transcribeUpload } from "@/lib/voice";
export const dynamic = "force-dynamic";
-const MAX_BYTES = 25 * 1024 * 1024; // rund zehn Minuten Sprache
-
-// Gericht einsprechen, Schritt 1: Aufnahme → Abschrift (Router „default-stt“ oder
-// eigenes Sprachmodell). Die Aufnahme wird nicht gespeichert.
+// Gericht einsprechen, Schritt 1: Aufnahme → Abschrift.
export async function POST(request: Request) {
const session = await guardWrite(request);
if (isResponse(session)) return session;
- const form = await request.formData().catch(() => null);
- const audio = form?.get("audio");
- if (!(audio instanceof File) || audio.size === 0 || audio.size > MAX_BYTES || !/^(audio|video)\//.test(audio.type)) return fail("audio", 400);
- const ai = await aiFor(session.householdId);
- if (!ai?.speechModel) return fail("noSpeech", 409);
- try {
- const ext = audio.type.includes("mp4") || audio.type.includes("m4a") ? "m4a" : audio.type.includes("ogg") ? "ogg" : audio.type.includes("wav") ? "wav" : "webm";
- const text = await transcribe(ai, audio, `aufnahme.${ext}`, await getLocale());
- if (!text) return fail("empty", 422);
- return json({ text });
- } catch (error) {
- if (error instanceof AiUnavailable || error instanceof AiNotConfigured) return fail("aiUnavailable", 503);
- throw error;
- }
+ const result = await transcribeUpload(request, session.householdId);
+ return result instanceof Response ? result : json(result);
}
diff --git a/app/api/shopping/items/route.ts b/app/api/shopping/items/route.ts
index 766a269..75aabe8 100644
--- a/app/api/shopping/items/route.ts
+++ b/app/api/shopping/items/route.ts
@@ -14,10 +14,13 @@ export async function PATCH(request: Request) {
}
export async function POST(request: Request) {
- const body = z.object({ label: z.string().trim().min(1).max(80) }).safeParse(await readJson(request));
+ // Ein Posten getippt, oder mehrere auf einmal nach dem Einsprechen (26.11.46).
+ const label = z.string().trim().min(1).max(80);
+ const body = z.union([z.object({ label }), z.object({ labels: z.array(label).min(1).max(20) })]).safeParse(await readJson(request));
if (!body.success) return fail("invalid", 400);
+ const labels = "labels" in body.data ? body.data.labels : [body.data.label];
return withShopping(request, async (c, round, session) => {
- await addManual(c, session.householdId, round.id, body.data.label);
+ for (const l of labels) await addManual(c, session.householdId, round.id, l);
return json({ ok: true }, 201);
});
}
diff --git a/app/api/shopping/voice/route.ts b/app/api/shopping/voice/route.ts
new file mode 100644
index 0000000..5c6ac10
--- /dev/null
+++ b/app/api/shopping/voice/route.ts
@@ -0,0 +1,18 @@
+import { guardWrite, isResponse } from "@/lib/auth/guard";
+import { json } from "@/lib/auth/http";
+import { SHOPPERS } from "@/lib/auth/roles";
+import { splitSpoken } from "@/lib/spoken-list";
+import { transcribeUpload } from "@/lib/voice";
+
+export const dynamic = "force-dynamic";
+
+// Einkaufsliste einsprechen (Kai, 8.11.2026): Abschrift → einzelne Posten. Kein
+// Sprachmodell zerlegt — die Regeln in lib/spoken-list.ts tun es, und auf die
+// Liste kommt erst, was die Person geprüft hat.
+export async function POST(request: Request) {
+ const session = await guardWrite(request, [...SHOPPERS]);
+ if (isResponse(session)) return session;
+ const result = await transcribeUpload(request, session.householdId);
+ if (result instanceof Response) return result;
+ return json({ text: result.text, items: splitSpoken(result.text) });
+}
diff --git a/components/shopping/shopping-list.tsx b/components/shopping/shopping-list.tsx
index 8c7b958..209a04f 100644
--- a/components/shopping/shopping-list.tsx
+++ b/components/shopping/shopping-list.tsx
@@ -5,6 +5,7 @@ import { useLocale, useTranslations } from "next-intl";
import { useCallback, useEffect, useRef, useState } from "react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
+import { VoiceAdd } from "@/components/shopping/voice-add";
import { formatQuantity, type PackKind } from "@/lib/units";
import { cn } from "@/lib/utils";
@@ -46,7 +47,7 @@ function writeQueue(ops: Op[]) {
// Einkaufsliste (Konzept, „Einkaufen“): große Haken, nach Gängen des Hauptladens,
// in Echtzeit bei allen (SSE), und ohne Netz bedienbar — Haken landen in einer
// Warteschlange im Browser und gehen raus, sobald wieder Netz da ist.
-export function ShoppingList({ initial, aisles, me }: { initial: Item[]; aisles: Aisle[]; me: string }) {
+export function ShoppingList({ initial, aisles, me, canRecord = false }: { initial: Item[]; aisles: Aisle[]; me: string; canRecord?: boolean }) {
const t = useTranslations("shopping");
const tm = useTranslations("measure");
const locale = useLocale();
@@ -131,6 +132,7 @@ export function ShoppingList({ initial, aisles, me }: { initial: Item[]; aisles:
async function send(method: string, url: string, body: object) {
const res = await fetch(url, { method, headers: { "content-type": "application/json" }, body: JSON.stringify(body) }).catch(() => null);
if (res?.ok) await reload();
+ return !!res?.ok;
}
const amount = (i: Item) => {
@@ -212,6 +214,7 @@ export function ShoppingList({ initial, aisles, me }: { initial: Item[]; aisles:
+ {canRecord ? send("POST", "/api/shopping/items", { labels })} /> : null}
{done.length ? (
diff --git a/components/shopping/voice-add.tsx b/components/shopping/voice-add.tsx
new file mode 100644
index 0000000..de4f3d9
--- /dev/null
+++ b/components/shopping/voice-add.tsx
@@ -0,0 +1,99 @@
+"use client";
+
+import { Mic, Square, X } from "lucide-react";
+import { useTranslations } from "next-intl";
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { ErrorNotice } from "@/components/ui/notice";
+import { useRecorder } from "@/lib/use-recorder";
+
+const mmss = (s: number) => `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
+
+// Einkaufsliste einsprechen (Kai, 8.11.2026, 26.11.46): aufnehmen, Abschrift in
+// Posten zerlegen (lib/spoken-list.ts), prüfen und ändern, dann hinzufügen.
+export function VoiceAdd({ onAdd }: { onAdd: (labels: string[]) => Promise }) {
+ const t = useTranslations("shopping.voice");
+ const [busy, setBusy] = useState<"transcribe" | "add" | null>(null);
+ const [error, setError] = useState(null);
+ const [items, setItems] = useState(null);
+ const rec = useRecorder(upload);
+
+ async function upload(audio: Blob) {
+ setBusy("transcribe");
+ const form = new FormData();
+ form.append("audio", new File([audio], "aufnahme", { type: audio.type }));
+ const res = await fetch("/api/shopping/voice", { method: "POST", body: form }).catch(() => null);
+ const data = await res?.json().catch(() => ({}));
+ setBusy(null);
+ if (!res?.ok) return setError(["noSpeech", "aiUnavailable", "empty", "audio"].includes(data?.error) ? data.error : "unknown");
+ if (!data.items?.length) return setError("empty");
+ setItems(data.items);
+ }
+
+ async function add() {
+ const labels = (items ?? []).map((i) => i.trim()).filter(Boolean);
+ if (!labels.length) return;
+ setBusy("add");
+ const ok = await onAdd(labels);
+ setBusy(null);
+ if (ok) setItems(null);
+ else setError("unknown");
+ }
+
+ const filled = (items ?? []).filter((i) => i.trim()).length;
+
+ return (
+