diff --git a/CLAUDE.md b/CLAUDE.md index 720be33..ae7b9a7 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.40 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: +> **Status:** 26.11.41 — 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). 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 757a5ab..ec91c12 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.40 + version: 26.11.41 categories: - Applications @@ -61,7 +61,7 @@ permission: appData: true spec: - versionName: '26.11.40' + versionName: '26.11.41' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: diff --git a/app/(app)/gerichte/[id]/page.tsx b/app/(app)/gerichte/[id]/page.tsx index 19fefb7..e4fe12f 100644 --- a/app/(app)/gerichte/[id]/page.tsx +++ b/app/(app)/gerichte/[id]/page.tsx @@ -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
@@ -75,6 +76,7 @@ export default async function DishPage({ params }: { params: Promise<{ id: strin ) : null} {photos.length ? : null} + {dish.isTrial ? : null} {canWrite ? : null} {dish.steps.length || dish.ingredients.length ? ( diff --git a/app/api/dishes/[id]/pool/route.ts b/app/api/dishes/[id]/pool/route.ts new file mode 100644 index 0000000..73cb052 --- /dev/null +++ b/app/api/dishes/[id]/pool/route.ts @@ -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); +} diff --git a/app/globals.css b/app/globals.css index 6c90616..b1bab24 100644 --- a/app/globals.css +++ b/app/globals.css @@ -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%; diff --git a/components/cooking/cooking-mode.tsx b/components/cooking/cooking-mode.tsx index c8a9450..14e2d0d 100644 --- a/components/cooking/cooking-mode.tsx +++ b/components/cooking/cooking-mode.tsx @@ -158,7 +158,7 @@ export function CookingMode({ {error ? {t("error")} : null} -
+
diff --git a/components/dishes/dish-form.tsx b/components/dishes/dish-form.tsx index e779b9e..57a8d1f 100644 --- a/components/dishes/dish-form.tsx +++ b/components/dishes/dish-form.tsx @@ -491,7 +491,7 @@ export function DishForm({ initial }: { initial?: DishFormValue }) { {error ? {t(`form.errors.${error}`)} : null} -
+
diff --git a/components/dishes/starter-picker.tsx b/components/dishes/starter-picker.tsx index 17c950d..1471fbd 100644 --- a/components/dishes/starter-picker.tsx +++ b/components/dishes/starter-picker.tsx @@ -61,7 +61,7 @@ export function StarterPicker({ starters }: { starters: Starter[] }) { })} {error ? {t("form.errors.unknown")} : null} -
+
+ ) : null} +
+ ); +} diff --git a/components/plan/plan-board.tsx b/components/plan/plan-board.tsx index 9c43b7c..2a56a03 100644 --- a/components/plan/plan-board.tsx +++ b/components/plan/plan-board.tsx @@ -186,7 +186,7 @@ export function PlanBoard({ ) : null} {status === "open" && slots.length ? ( -
+
diff --git a/components/receipts/receipt-review.tsx b/components/receipts/receipt-review.tsx index d1dd1a2..ca6c921 100644 --- a/components/receipts/receipt-review.tsx +++ b/components/receipts/receipt-review.tsx @@ -281,7 +281,7 @@ export function ReceiptReview({ receipt }: { receipt: Receipt }) { {done ? (

{t("doneText")}

) : ( -
+
diff --git a/e2e/gerichte.spec.ts b/e2e/gerichte.spec.ts index 9d5d0fc..2a8a215 100644 --- a/e2e/gerichte.spec.ts +++ b/e2e/gerichte.spec.ts @@ -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,28 @@ 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); + 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=/); +}); + diff --git a/e2e/leiste.spec.ts b/e2e/leiste.spec.ts index db8ed2d..44b364f 100644 --- a/e2e/leiste.spec.ts +++ b/e2e/leiste.spec.ts @@ -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); }); diff --git a/lib/use-keyboard-nav.ts b/lib/use-keyboard-nav.ts index d9b3514..aeaf4c9 100644 --- a/lib/use-keyboard-nav.ts +++ b/lib/use-keyboard-nav.ts @@ -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() { const ref = useRef(null); @@ -45,17 +64,37 @@ export function useKeyboardSafeNav() { 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() { 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(); }; }, []); diff --git a/messages/de.json b/messages/de.json index 2be1eca..9b1a331 100644 --- a/messages/de.json +++ b/messages/de.json @@ -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", diff --git a/messages/en.json b/messages/en.json index b25bae5..9a7aa41 100644 --- a/messages/en.json +++ b/messages/en.json @@ -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", diff --git a/messages/es.json b/messages/es.json index 21a1f61..35cbcc6 100644 --- a/messages/es.json +++ b/messages/es.json @@ -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", diff --git a/messages/fr.json b/messages/fr.json index c574908..8e1d472 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -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", diff --git a/olares/Chart.yaml b/olares/Chart.yaml index 21e458a..cf30f3c 100644 --- a/olares/Chart.yaml +++ b/olares/Chart.yaml @@ -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. 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.41 # YY.M. wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen +appVersion: "26.11.41" # MUSS gleich version sein: der Linter prüft es, und der Image-Tag hängt daran diff --git a/olares/OlaresManifest.yaml b/olares/OlaresManifest.yaml index 757a5ab..ec91c12 100644 --- a/olares/OlaresManifest.yaml +++ b/olares/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.40 + version: 26.11.41 categories: - Applications @@ -61,7 +61,7 @@ permission: appData: true spec: - versionName: '26.11.40' + versionName: '26.11.41' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: diff --git a/olares/markt/26.11.41.md b/olares/markt/26.11.41.md new file mode 100644 index 0000000..5965171 --- /dev/null +++ b/olares/markt/26.11.41.md @@ -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“. diff --git a/tests/keyboard-gap.test.ts b/tests/keyboard-gap.test.ts index 8a45231..33e6013 100644 --- a/tests/keyboard-gap.test.ts +++ b/tests/keyboard-gap.test.ts @@ -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); + }); +});