Compare commits

...
3 Commits
Author SHA1 Message Date
kai 92f852e335 26.11.43: Fotos aus der Mediathek (#44)
release / which version (push) Successful in 2s
release / olares chart · sanity (push) Successful in 3s
release / app (push) Successful in 1m6s
release / tag and release (push) Successful in 2s
2026-11-07 18:58:23 +00:00
kai cfb816b724 26.11.42: Icon Kochmütze mit Herz (#43)
release / which version (push) Successful in 2s
release / olares chart · sanity (push) Successful in 4s
release / app (push) Successful in 1m5s
release / tag and release (push) Successful in 2s
2026-11-07 18:38:18 +00:00
kai 4e413fe600 26.11.41: Leiste bleibt unten, Ausprobieren sichtbar (#42)
release / which version (push) Successful in 2s
release / olares chart · sanity (push) Successful in 9s
release / app (push) Successful in 1m10s
release / tag and release (push) Successful in 2s
2026-11-07 18:25:50 +00:00
39 changed files with 320 additions and 125 deletions

No files matched your search

+3 -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.40 — 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
@@ -20,7 +20,8 @@
> (26.11.33), foodplanhero für Maike (26.11.35), eine Schrift (26.11.37), Produktgruppen,
> 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). Offen: Kai trägt
> 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). 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.40
version: 26.11.43
categories:
- Applications
@@ -61,7 +61,7 @@ permission:
appData: true
spec:
versionName: '26.11.40'
versionName: '26.11.43'
featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png
promoteImage:
+3 -1
View File
@@ -1,4 +1,5 @@
import { ChevronLeft, MonitorPlay } from "lucide-react";
import { TrialNote } from "@/components/dishes/trial-note";
import Link from "next/link";
import { notFound } from "next/navigation";
import { getLocale, getTranslations } from "next-intl/server";
@@ -54,7 +55,7 @@ export default async function DishPage({ params }: { params: Promise<{ id: strin
<div className="relative aspect-[4/3] overflow-hidden sm:mx-4 sm:mt-4 sm:rounded-2xl">
<DishPhoto dishId={dish.id} photo={dish.photo} />
<Link
href="/gerichte"
href={dish.isTrial ? "/gerichte?ansicht=ausprobieren" : "/gerichte"}
aria-label={t("title")}
className="absolute left-3 top-3 flex size-11 items-center justify-center rounded-full bg-background/90 text-foreground"
>
@@ -75,6 +76,7 @@ export default async function DishPage({ params }: { params: Promise<{ id: strin
) : null}
</header>
{photos.length ? <PhotoGallery dishId={dish.id} title={dish.title} photos={photos} canManage={canWrite} /> : null}
{dish.isTrial ? <TrialNote id={dish.id} canWrite={canWrite} /> : null}
{canWrite ? <DishActions id={dish.id} /> : null}
{dish.steps.length || dish.ingredients.length ? (
<Link
+1 -1
View File
@@ -107,7 +107,7 @@ export default async function DishesPage({ searchParams }: { searchParams: Promi
href="/gerichte/hinzufuegen"
className={cn(
buttonVariants({ size: "lg" }),
"fixed bottom-[calc(4.5rem+env(safe-area-inset-bottom))] right-4 z-10 shadow-lg",
"kb-shift fixed bottom-[calc(4.5rem+env(safe-area-inset-bottom))] right-4 z-10 shadow-lg",
)}
>
<Plus aria-hidden />
+17
View File
@@ -0,0 +1,17 @@
import { guardWrite, isResponse } from "@/lib/auth/guard";
import { fail } from "@/lib/auth/http";
import { withHousehold } from "@/lib/db";
export const dynamic = "force-dynamic";
// „In den Pool“ (26.11.41): ein Gericht aus „Ausprobieren“ zu den Stammgerichten.
export async function POST(request: Request, { params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const session = await guardWrite(request);
if (isResponse(session)) return session;
if (!/^[0-9a-f-]{36}$/.test(id)) return fail("invalid", 400);
const r = await withHousehold(session.householdId, (c) =>
c.query("update dishes set is_trial = false, updated_at = now() where id = $1 and archived_at is null", [id]),
);
return r.rowCount === 1 ? new Response(null, { status: 204 }) : fail("notFound", 404);
}
+6
View File
@@ -79,6 +79,12 @@
--nav-space: 0px;
}
/* Knopfleisten unten folgen der Korrektur der Navigation, wenn iOS nach der
Tastatur zu kurz rechnet (lib/use-keyboard-nav.ts setzt --kb-shift, 26.11.41). */
.kb-shift {
translate: 0 var(--kb-shift, 0px);
}
html {
color-scheme: light dark;
-webkit-text-size-adjust: 100%;
+2 -1
View File
@@ -1,3 +1,4 @@
import { iconUrl } from "@/lib/icon-version";
import type { Metadata, Viewport } from "next";
import localFont from "next/font/local";
import { NextIntlClientProvider } from "next-intl";
@@ -36,7 +37,7 @@ export async function generateMetadata(): Promise<Metadata> {
media: `(device-width: ${cw}px) and (device-height: ${ch}px) and (-webkit-device-pixel-ratio: ${dpr}) and (orientation: portrait)`,
})),
},
icons: { icon: "/icon.svg", apple: "/apple-touch-icon.png" },
icons: { icon: iconUrl("/icon.svg"), apple: iconUrl("/apple-touch-icon.png") },
};
}
+7 -6
View File
@@ -1,3 +1,4 @@
import { iconUrl } from "@/lib/icon-version";
import type { MetadataRoute } from "next";
import { getLocale, getTranslations } from "next-intl/server";
@@ -18,14 +19,14 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
theme_color: "#fdfcfe",
// Lange auf das Symbol drücken: direkt zu Wünschen, Plan und Einkauf.
shortcuts: [
{ name: nav("wish"), url: "/wuenschen", icons: [{ src: "/icon-192.png", sizes: "192x192" }] },
{ name: nav("plan"), url: "/plan", icons: [{ src: "/icon-192.png", sizes: "192x192" }] },
{ name: nav("shopping"), url: "/einkauf", icons: [{ src: "/icon-192.png", sizes: "192x192" }] },
{ name: nav("wish"), url: "/wuenschen", icons: [{ src: iconUrl("/icon-192.png"), sizes: "192x192" }] },
{ name: nav("plan"), url: "/plan", icons: [{ src: iconUrl("/icon-192.png"), sizes: "192x192" }] },
{ name: nav("shopping"), url: "/einkauf", icons: [{ src: iconUrl("/icon-192.png"), sizes: "192x192" }] },
],
icons: [
{ src: "/icon-192.png", sizes: "192x192", type: "image/png" },
{ src: "/icon-512.png", sizes: "512x512", type: "image/png" },
{ src: "/icon-512-maskable.png", sizes: "512x512", type: "image/png", purpose: "maskable" },
{ src: iconUrl("/icon-192.png"), sizes: "192x192", type: "image/png" },
{ src: iconUrl("/icon-512.png"), sizes: "512x512", type: "image/png" },
{ src: iconUrl("/icon-512-maskable.png"), sizes: "512x512", type: "image/png", purpose: "maskable" },
],
};
}
+1 -1
View File
@@ -158,7 +158,7 @@ export function CookingMode({
{error ? <ErrorNotice>{t("error")}</ErrorNotice> : null}
<div className="sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<div className="kb-shift sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<Button type="button" variant="outline" size="lg" disabled={index < 0} onClick={() => go(-1)} aria-label={t("back")}>
<ChevronLeft aria-hidden />
</Button>
-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 -1
View File
@@ -491,7 +491,7 @@ export function DishForm({ initial }: { initial?: DishFormValue }) {
</section>
{error ? <ErrorNotice>{t(`form.errors.${error}`)}</ErrorNotice> : null}
<div className="sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<div className="kb-shift sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<Button type="button" variant="outline" onClick={() => router.back()}>
{t("form.cancel")}
</Button>
-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")}
+1 -1
View File
@@ -61,7 +61,7 @@ export function StarterPicker({ starters }: { starters: Starter[] }) {
})}
</ul>
{error ? <ErrorNotice>{t("form.errors.unknown")}</ErrorNotice> : null}
<div className="sticky bottom-[var(--nav-space)] z-10 bg-background/0 pb-2">
<div className="kb-shift sticky bottom-[var(--nav-space)] z-10 bg-background/0 pb-2">
<Button
size="lg"
className="w-full shadow-lg"
+38
View File
@@ -0,0 +1,38 @@
"use client";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { useState } from "react";
import { Button } from "@/components/ui/button";
// Ein Gericht unter „Ausprobieren“ sagt das selbst (26.11.41, Kai: „neue Gerichte werden
// nicht gespeichert“ — sie standen nur nicht im Pool). Mit einem Tipp in den Pool.
export function TrialNote({ id, canWrite }: { id: string; canWrite: boolean }) {
const t = useTranslations("dishes.detail");
const router = useRouter();
const [busy, setBusy] = useState(false);
async function toPool() {
setBusy(true);
const res = await fetch(`/api/dishes/${id}/pool`, { method: "POST" }).catch(() => null);
setBusy(false);
if (res?.ok) router.refresh();
}
return (
<div role="note" className="flex flex-col gap-3 rounded-xl border border-border px-4 py-3">
<p className="text-sm">
{t("inTrial")}{" "}
<Link href="/gerichte?ansicht=ausprobieren" className="font-semibold underline underline-offset-4">
{t("inTrialLink")}
</Link>
</p>
{canWrite ? (
<Button type="button" variant="outline" className="self-start" disabled={busy} onClick={toPool}>
{t("toPool")}
</Button>
) : null}
</div>
);
}
+1 -1
View File
@@ -186,7 +186,7 @@ export function PlanBoard({
) : null}
{status === "open" && slots.length ? (
<div className="sticky bottom-[var(--nav-space)] z-10 bg-background py-2">
<div className="kb-shift sticky bottom-[var(--nav-space)] z-10 bg-background py-2">
<Button type="button" size="lg" className="w-full" disabled={busy} onClick={() => act("POST", "/api/plan/approve")}>
{t("approve")}
</Button>
+1 -1
View File
@@ -281,7 +281,7 @@ export function ReceiptReview({ receipt }: { receipt: Receipt }) {
{done ? (
<p className="text-sm text-muted-foreground">{t("doneText")}</p>
) : (
<div className="sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<div className="kb-shift sticky bottom-[var(--nav-space)] z-10 flex gap-2 bg-background py-2">
<Button type="button" variant="outline" disabled={busy} onClick={remove} aria-label={t("delete")}>
<Trash2 aria-hidden />
</Button>
+1 -1
View File
@@ -177,7 +177,7 @@ acht Paletten Variante H gewählt). Löst die Palette aus E-0002 ab; der Rest vo
- **Schrift:** ~~Überschriften in Newsreader, Text in Geist~~ — seit 26.11.37 Poppins
überall (E-0014).
- **Abschnitte** ohne Kasten, getrennt durch feine Linien.
- **Symbol:** Teller mit Dampf auf Coral, Blatt in Lavendel (`docs/icon/lunch.svg`).
- **Symbol:** Kochmütze mit Herz auf Coral (seit 26.11.42, Kai: Entwurf a; vorher Teller mit Dampf und Lavendel-Blatt), `docs/icon/lunch.svg`.
- **Kontrast** jeder Schrift auf ihrer Fläche mindestens 4,5:1, hell und dunkel —
`tests/contrast.test.ts` rechnet ihn aus den Token.
+7 -14
View File
@@ -1,15 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="112" fill="#f39380"/>
<!-- Teller -->
<circle cx="256" cy="292" r="142" fill="#fefdff"/>
<circle cx="256" cy="292" r="98" fill="none" stroke="#e7e1f6" stroke-width="14"/>
<!-- Dampf -->
<g fill="none" stroke="#fefdff" stroke-width="18" stroke-linecap="round">
<path d="M206 78c-16 18 16 30 0 48"/>
<path d="M256 64c-16 20 16 34 0 54"/>
<path d="M306 78c-16 18 16 30 0 48"/>
</g>
<!-- Salbeiblatt -->
<path d="M206 316c20-62 86-82 116-72-6 52-58 98-116 72z" fill="#7761b0"/>
<path d="M214 312c30-24 58-42 96-62" stroke="#fefdff" stroke-width="7" stroke-linecap="round" fill="none"/>
</svg>
<!-- foodplanhero (Kai, 7.11.2026, 26.11.42): Kochmütze mit Herz, für Maike. Koralle wie bisher. --><rect width="512" height="512" rx="112" fill="#f39380"/><g>
<circle cx="178" cy="214" r="70" fill="#fefdff"/>
<circle cx="256" cy="176" r="86" fill="#fefdff"/>
<circle cx="334" cy="214" r="70" fill="#fefdff"/>
<rect x="158" y="210" width="196" height="132" fill="#fefdff"/>
<rect x="150" y="350" width="212" height="56" rx="20" fill="#fefdff"/>
</g><path d="M256 318 C230 298 202 276 202 250 C202 230 217 218 234 218 C245 218 252 224 256 233 C260 224 267 218 278 218 C295 218 310 230 310 250 C310 276 282 298 256 318 Z" fill="#f39380"/></svg>

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 720 B

+40
View File
@@ -208,6 +208,8 @@ test.describe("recipe link", () => {
await amounts.nth(3).fill("50");
await page.getByRole("button", { name: "Speichern" }).click();
await expect(page.getByRole("heading", { level: 1 })).toHaveText("Linsensuppe vom Blog");
// Gespeichert unter „Ausprobieren“ — und die Seite sagt es (26.11.41).
await expect(page.getByRole("note").filter({ hasText: "Steht unter „Ausprobieren“" })).toBeVisible();
await expect(page.locator("main img").first()).toHaveAttribute("src", /\/api\/fotos\//);
await expect(page.locator(`main a[href="${origin}/rezept"]`)).toBeVisible();
});
@@ -467,3 +469,41 @@ test("spoons and cans: the ingredient preselects its measure, the dish shows spo
await page.getByRole("button", { name: "Entfernen" }).click();
await expect(page).toHaveURL(/entfernt=/);
});
// Kai: „Neue Gerichte werden nicht gespeichert“ — sie standen unter „Ausprobieren“, ohne dass
// die Seite es sagte (26.11.41). Jetzt: Hinweis, Weg dorthin, und mit einem Tipp in den Pool.
test("a dish to try says so, links to its tab and moves to the pool with one tap", async ({ page }) => {
await page.goto("/gerichte/neu");
await page.fill("#title", "Probe-Auflauf");
await page.getByRole("combobox", { name: "Zutat suchen" }).first().fill("Zwieb");
await page.getByRole("option", { name: "Zwiebeln", exact: true }).click();
await page.getByRole("textbox", { name: "Menge", exact: true }).first().fill("2");
await page.getByLabel("Erst mal ausprobieren").check();
await page.getByRole("button", { name: "Speichern" }).click();
await expect(page.getByRole("heading", { level: 1 })).toHaveText("Probe-Auflauf");
const note = page.getByRole("note").filter({ hasText: "Steht unter „Ausprobieren“" });
await expect(note).toBeVisible();
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.
await page.getByRole("link", { name: /Probe-Auflauf/ }).click();
await page.getByRole("button", { name: "Entfernen" }).click();
await expect(page).toHaveURL(/entfernt=/);
});
+34 -12
View File
@@ -73,29 +73,51 @@ test("scrolling never moves the bar, even while the address bar comes and goes",
}
});
test("after typing, a stale gap is bridged briefly and dropped at the first touch", async ({ page }) => {
const shiftOf = (page: Page) => page.getByRole("navigation", { name: "Navigation" }).evaluate((el) => (el as HTMLElement).style.transform);
const kbShift = (page: Page) => page.evaluate(() => document.documentElement.style.getPropertyValue("--kb-shift"));
// 26.11.41 (Kai, Bild: Leiste und „Speichern“ mitten im Bild): iOS rechnet nach der
// Tastatur in der Web-App manchmal lange zu kurz — auch nach Berührung und Scrollen.
test("after typing, a stuck keyboard gap stays bridged through touch and scroll until iOS recovers", async ({ page }) => {
await page.goto("/mehr");
const field = page.locator("#kid-name");
await field.focus();
await expect(page.getByRole("navigation", { name: "Navigation" })).toBeHidden(); // beim Tippen weg
// iOS lässt das Layout nach dem Schließen der Tastatur 300 px zu kurz stehen.
await moveViewport(page, 300);
await moveViewport(page, 300); // iOS lässt das Layout 300 px zu kurz stehen
await field.blur();
const nav = page.getByRole("navigation", { name: "Navigation" });
await expect(nav).toBeVisible();
await expect.poll(() => nav.evaluate((el) => (el as HTMLElement).style.transform)).toBe("translateY(300px)");
await expect.poll(() => shiftOf(page)).toBe("translateY(300px)");
await expect.poll(() => kbShift(page)).toBe("300px");
// Berühren, scrollen, über die erste Sekunde hinaus: bleibt unten.
await page.evaluate(() => window.dispatchEvent(new Event("touchstart")));
await expect.poll(() => nav.evaluate((el) => (el as HTMLElement).style.transform)).toBe("");
await page.evaluate(() => window.dispatchEvent(new Event("touchend")));
await page.mouse.wheel(0, 400);
await page.waitForTimeout(1300);
await moveViewport(page, 300);
await expect.poll(() => shiftOf(page)).toBe("translateY(300px)");
// iOS rechnet wieder richtig: Korrektur weg, Leiste unten.
await moveViewport(page, 0);
await expect.poll(() => shiftOf(page)).toBe("");
await expect.poll(() => kbShift(page)).toBe("");
await navAtBottom(page);
// Danach ist nichts mehr scharf: eine neue Lücke ohne Tippen bleibt unberührt.
await moveViewport(page, 300);
await page.waitForTimeout(100);
expect(await shiftOf(page)).toBe("");
});
test("the bridge ends by itself after a second, and never starts without typing", async ({ page }) => {
test("never without typing; after the first second only a keyboard-sized gap counts", async ({ page }) => {
await page.goto("/mehr");
const nav = page.getByRole("navigation", { name: "Navigation" });
await moveViewport(page, 300); // ohne Tastatur: nichts tun
await page.waitForTimeout(100);
expect(await nav.evaluate((el) => (el as HTMLElement).style.transform)).toBe("");
expect(await shiftOf(page)).toBe("");
await moveViewport(page, 0);
await page.locator("#kid-name").focus();
await page.locator("#kid-name").blur();
await expect.poll(() => nav.evaluate((el) => (el as HTMLElement).style.transform)).toBe("translateY(300px)");
await expect.poll(() => nav.evaluate((el) => (el as HTMLElement).style.transform), { timeout: 3000 }).toBe("");
await page.waitForTimeout(1300);
// Gummiband oder Rundung (unter STUCK_MIN): Lunch fasst die Leiste nicht an.
await moveViewport(page, 80);
await page.waitForTimeout(100);
expect(await shiftOf(page)).toBe("");
await moveViewport(page, 0);
await navAtBottom(page);
});
+5
View File
@@ -0,0 +1,5 @@
// Version der App-Symbole (docs/icon/lunch.svg → scripts/app-icons.mjs). Ändert sich
// das Symbol, hier hochzählen: Die Adressen ändern sich, Browser und Service Worker
// holen das neue statt des gemerkten (26.11.42, Kochmütze mit Herz).
export const ICON_VERSION = "2";
export const iconUrl = (path: string) => `${path}?v=${ICON_VERSION}`;
+67 -32
View File
@@ -11,8 +11,11 @@ import { useEffect, useRef, useState } from "react";
// Größenereignis des sichtbaren Bereichs. In Safari fährt beim Scrollen die
// Adressleiste ein und aus, iOS meldet das verzögert — die Leiste rutschte mit
// (Kai, 7.11.2026). Jetzt gilt: Beim Scrollen fasst Lunch die Leiste nie an.
// Korrigiert wird nur im Fenster nach dem Schließen der Tastatur, und die erste
// Berührung oder der erste Scroll danach nimmt die Korrektur zurück.
// Korrigiert wird nur nach dem Schließen der Tastatur und nur in der Web-App.
//
// Seit 26.11.41: Die Korrektur bleibt, solange iOS den Bildschirm zu kurz rechnet —
// erkennbar an einer Lücke in Tastaturgröße (STUCK_MIN), die das Scrollen in einer
// Web-App sonst nie erzeugt. Kleine Lücken (Gummiband) fasst Lunch weiter nicht an.
/** Wie lange nach dem Schließen der Tastatur nachgemessen wird. */
export const SETTLE_MS = 1000;
@@ -33,6 +36,22 @@ const EDITABLE =
export const isEditable = (el: Element | null) => !!el && el.matches(EDITABLE);
/**
* Ab dieser Lücke ist es die stehengebliebene Tastatur, kein Gummiband (26.11.41).
* iOS-Tastaturen sind 250–400 pt hoch; Gummiband und Rundungen bleiben weit darunter.
*/
export const STUCK_MIN = 150;
/**
* Die Korrektur nach dem Schließen der Tastatur (26.11.41, Kai: Leiste mitten im Bild,
* auch nach dem Scrollen). Im ersten Augenblick gilt jede Lücke über 40 px; danach nur
* noch eine in Tastaturgröße — so lange, bis iOS selbst wieder richtig rechnet.
*/
export function stuckShift(gap: number, settling: boolean): number {
if (settling) return gap;
return gap >= STUCK_MIN ? gap : 0;
}
/** Liefert, ob gerade getippt wird, und eine Ref für die Leiste, die unten gehalten wird. */
export function useKeyboardSafeNav<T extends HTMLElement>() {
const ref = useRef<T>(null);
@@ -45,17 +64,37 @@ export function useKeyboardSafeNav<T extends HTMLElement>() {
useEffect(() => {
const vv = window.visualViewport;
let until = 0; // Ende des Fensters nach dem Schließen der Tastatur
const root = document.documentElement;
// Nach dem Schließen der Tastatur scharf, bis iOS den Bildschirm wieder voll rechnet.
// In der Web-App gibt es keine Adressleiste — eine Lücke in Tastaturgröße ist dort
// immer der Fehler, auch noch nach Berührung und Scrollen (bis 26.11.40 ließ Lunch
// die Korrektur bei der ersten Berührung fallen, und die Leiste sprang zurück).
let armed = false;
let settleUntil = 0;
let frame = 0;
const apply = (shift: number) => {
if (ref.current) ref.current.style.transform = shift ? `translateY(${shift}px)` : "";
// Klebende Knopfleisten (Speichern, Los geht's …) folgen über --kb-shift (globals.css).
if (shift) root.style.setProperty("--kb-shift", `${shift}px`);
else root.style.removeProperty("--kb-shift");
};
const clear = () => {
until = 0;
if (ref.current) ref.current.style.transform = "";
armed = false;
settleUntil = 0;
apply(0);
};
const pin = () => {
const el = ref.current;
if (!el || !vv) return;
if (Date.now() > until || !isStandalone()) return clear();
const gap = keyboardGap(vv, document.documentElement.clientHeight);
el.style.transform = gap ? `translateY(${gap}px)` : "";
frame = 0;
if (!armed || !vv || !isStandalone()) return clear();
const shift = stuckShift(keyboardGap(vv, root.clientHeight), Date.now() < settleUntil);
apply(shift);
// iOS rechnet wieder richtig: entschärfen.
if (!shift && Date.now() >= settleUntil) armed = false;
};
// Bei jedem Ereignis neu messen, nie einen alten Wert stehen lassen: Rechnet iOS
// zwischendurch wieder richtig, fällt die Korrektur im selben Bild weg.
const schedule = () => {
if (armed && !frame) frame = requestAnimationFrame(pin);
};
const onFocusIn = (e: FocusEvent) => {
if (isEditable(e.target as Element)) {
@@ -68,38 +107,34 @@ export function useKeyboardSafeNav<T extends HTMLElement>() {
setTimeout(() => {
if (isEditable(document.activeElement)) return;
setTyping(false);
if (!isStandalone()) return;
window.scrollTo(window.scrollX, window.scrollY); // stößt das Neuvermessen an
until = Date.now() + SETTLE_MS;
requestAnimationFrame(pin);
setTimeout(pin, 300); // nach der Animation der Tastatur noch einmal
setTimeout(() => {
if (!until) return;
clear();
// Steht die Leiste ohne Korrektur noch falsch, iOS noch einmal neu messen lassen.
if (vv && isStandalone() && keyboardGap(vv, document.documentElement.clientHeight)) {
window.scrollTo(window.scrollX, window.scrollY + 1);
window.scrollTo(window.scrollX, window.scrollY - 1);
}
}, SETTLE_MS + 50);
armed = true;
settleUntil = Date.now() + SETTLE_MS;
schedule();
setTimeout(schedule, 300); // nach der Animation der Tastatur noch einmal
setTimeout(schedule, SETTLE_MS + 50); // Ende des ersten Augenblicks
}, 50);
};
// Sobald die Person wieder berührt (jeder Scroll am Handy beginnt so) oder am Rad
// dreht, gilt die Lage, die iOS selbst rechnet. Kein „scroll“: Den lösen auch das
// scrollTo oben und iOS beim Schließen der Tastatur aus.
const onUser = () => until && clear();
document.addEventListener("focusin", onFocusIn);
document.addEventListener("focusout", onFocusOut);
vv?.addEventListener("resize", pin);
window.addEventListener("touchstart", onUser, { passive: true });
window.addEventListener("wheel", onUser, { passive: true });
vv?.addEventListener("resize", schedule);
vv?.addEventListener("scroll", schedule);
window.addEventListener("scroll", schedule, { passive: true });
window.addEventListener("resize", schedule);
window.addEventListener("touchend", schedule, { passive: true });
window.addEventListener("orientationchange", clear);
return () => {
if (frame) cancelAnimationFrame(frame);
document.removeEventListener("focusin", onFocusIn);
document.removeEventListener("focusout", onFocusOut);
vv?.removeEventListener("resize", pin);
window.removeEventListener("touchstart", onUser);
window.removeEventListener("wheel", onUser);
vv?.removeEventListener("resize", schedule);
vv?.removeEventListener("scroll", schedule);
window.removeEventListener("scroll", schedule);
window.removeEventListener("resize", schedule);
window.removeEventListener("touchend", schedule);
window.removeEventListener("orientationchange", clear);
clear();
};
}, []);
+7 -4
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",
@@ -385,7 +385,10 @@
"stepTimerProduct": "{n} Min. laut Packung ({product})",
"photoAdd": "Foto dazu ({n} von {max})",
"photoFull": "5 Fotos sind das Maximum",
"present": "Präsentieren"
"present": "Präsentieren",
"inTrial": "Steht unter „Ausprobieren“, noch nicht im Pool. Dort zieht es der Joker „Etwas Neues“.",
"inTrialLink": "Zu „Ausprobieren“",
"toPool": "In den Pool"
},
"form": {
"newTitle": "Neues Gericht",
@@ -482,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.",
+7 -4
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",
@@ -385,7 +385,10 @@
"stepTimerProduct": "{n} min per pack ({product})",
"photoAdd": "Add photo ({n} of {max})",
"photoFull": "5 photos is the maximum",
"present": "Present"
"present": "Present",
"inTrial": "Listed under “To try”, not yet in the pool. The joker “Something new” picks from there.",
"inTrialLink": "Go to “To try”",
"toPool": "Move to pool"
},
"form": {
"newTitle": "New dish",
@@ -482,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.",
+7 -4
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",
@@ -385,7 +385,10 @@
"stepTimerProduct": "{n} min según el paquete ({product})",
"photoAdd": "Añadir foto ({n} de {max})",
"photoFull": "5 fotos es el máximo",
"present": "Present"
"present": "Present",
"inTrial": "Listed under “To try”, not yet in the pool. The joker “Something new” picks from there.",
"inTrialLink": "Go to “To try”",
"toPool": "Move to pool"
},
"form": {
"newTitle": "New dish",
@@ -482,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.",
+7 -4
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",
@@ -385,7 +385,10 @@
"stepTimerProduct": "{n} min selon le paquet ({product})",
"photoAdd": "Ajouter une photo ({n} sur {max})",
"photoFull": "5 photos au maximum",
"present": "Present"
"present": "Present",
"inTrial": "Listed under “To try”, not yet in the pool. The joker “Something new” picks from there.",
"inTrialLink": "Go to “To try”",
"toPool": "Move to pool"
},
"form": {
"newTitle": "New dish",
@@ -482,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.40 # YY.M.<n> wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen
appVersion: "26.11.40" # 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.40
version: 26.11.43
categories:
- Applications
@@ -61,7 +61,7 @@ permission:
appData: true
spec:
versionName: '26.11.40'
versionName: '26.11.43'
featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png
promoteImage:
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+5
View File
@@ -0,0 +1,5 @@
# The bottom bar stays at the bottom, and dishes to try say so
v26.11.41: On the iPhone, the bottom bar and the buttons above it (Save, Cancel) could get stuck in the middle of the screen after typing, and stayed there even after scrolling. iOS sometimes keeps calculating the screen as if the keyboard were still open, long after it has closed. foodplanhero now holds the bar at the bottom for as long as that lasts, through touches and scrolling, and lets go as soon as iOS calculates correctly again. The buttons above the bar and the plus button on the dishes page follow the bar. Small movements such as bouncing at the end of a page are left alone. Dishes created from a photo, text or recipe link go to "To try" first, which is what the joker "Something new" picks from. Their page now says so, links to that tab and has a "Move to pool" button; the back arrow leads to "To try".
## Deutsch
v26.11.41: Am iPhone konnten nach dem Tippen die Leiste unten und die Knöpfe darüber (Speichern, Abbrechen) mitten im Bild stehen bleiben, auch nach dem Scrollen. iOS rechnet den Bildschirm manchmal noch lange so, als wäre die Tastatur offen, obwohl sie längst zu ist. foodplanhero hält die Leiste jetzt unten, solange das dauert, auch beim Berühren und Scrollen, und lässt sie los, sobald iOS wieder richtig rechnet. Die Knöpfe über der Leiste und der Plus-Knopf bei den Gerichten gehen mit. Kleine Bewegungen wie das Nachfedern am Seitenende bleiben unberührt. Gerichte aus Foto, Text oder Rezept-Link stehen zuerst unter „Ausprobieren“, daraus zieht der Joker „Etwas Neues“. Ihre Seite sagt das jetzt, führt zu diesem Reiter und hat einen Knopf „In den Pool“; der Pfeil zurück führt zu „Ausprobieren“.
+5
View File
@@ -0,0 +1,5 @@
# A new icon: chef's hat with a heart
v26.11.42: foodplanhero has a new icon: a white chef's hat with a heart, on the familiar coral. It replaces the plate with the leaf on the home screen, in the browser tab and in the market. To see it on the home screen, remove the app there once and add it again.
## Deutsch
v26.11.42: foodplanhero hat ein neues Symbol: eine weiße Kochmütze mit Herz auf dem vertrauten Koralle. Sie ersetzt den Teller mit dem Blatt auf dem Home-Bildschirm, im Browser-Tab und im Markt. Damit das iPhone es zeigt, die App vom Home-Bildschirm einmal entfernen und neu hinzufügen.
+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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 13 KiB

+7 -14
View File
@@ -1,15 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="112" fill="#f39380"/>
<!-- Teller -->
<circle cx="256" cy="292" r="142" fill="#fefdff"/>
<circle cx="256" cy="292" r="98" fill="none" stroke="#e7e1f6" stroke-width="14"/>
<!-- Dampf -->
<g fill="none" stroke="#fefdff" stroke-width="18" stroke-linecap="round">
<path d="M206 78c-16 18 16 30 0 48"/>
<path d="M256 64c-16 20 16 34 0 54"/>
<path d="M306 78c-16 18 16 30 0 48"/>
</g>
<!-- Salbeiblatt -->
<path d="M206 316c20-62 86-82 116-72-6 52-58 98-116 72z" fill="#7761b0"/>
<path d="M214 312c30-24 58-42 96-62" stroke="#fefdff" stroke-width="7" stroke-linecap="round" fill="none"/>
</svg>
<!-- foodplanhero (Kai, 7.11.2026, 26.11.42): Kochmütze mit Herz, für Maike. Koralle wie bisher. --><rect width="512" height="512" rx="112" fill="#f39380"/><g>
<circle cx="178" cy="214" r="70" fill="#fefdff"/>
<circle cx="256" cy="176" r="86" fill="#fefdff"/>
<circle cx="334" cy="214" r="70" fill="#fefdff"/>
<rect x="158" y="210" width="196" height="132" fill="#fefdff"/>
<rect x="150" y="350" width="212" height="56" rx="20" fill="#fefdff"/>
</g><path d="M256 318 C230 298 202 276 202 250 C202 230 217 218 234 218 C245 218 252 224 256 233 C260 224 267 218 278 218 C295 218 310 230 310 250 C310 276 282 298 256 318 Z" fill="#f39380"/></svg>

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 720 B

+11 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from "vitest";
import { keyboardGap } from "@/lib/use-keyboard-nav";
import { keyboardGap, STUCK_MIN, stuckShift } from "@/lib/use-keyboard-nav";
// Wann die untere Leiste nach dem Tippen nachgeschoben wird (26.11.32): nur bei einer
// Lücke, wie sie eine eben geschlossene Tastatur hinterlässt — nie für Adressleiste,
@@ -18,3 +18,13 @@ describe("keyboard gap", () => {
expect(keyboardGap(vv(5000), 520)).toBe(0);
});
});
describe("stuck keyboard (26.11.41)", () => {
it("in the first second every gap counts, afterwards only a keyboard-sized one", () => {
expect(stuckShift(80, true)).toBe(80);
expect(stuckShift(80, false)).toBe(0);
expect(stuckShift(STUCK_MIN, false)).toBe(STUCK_MIN);
expect(stuckShift(336, false)).toBe(336);
expect(stuckShift(0, false)).toBe(0);
});
});