From 75f7a98a91752d067b944ec5c1336a6f592994e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20B=C3=B6hm?= Date: Sat, 7 Nov 2026 08:25:26 +0000 Subject: [PATCH] Keep bottom-pinned buttons on the keyboard while typing (26.11.26) Sticky button bars used a fixed offset for the bottom bar, which is hidden while typing, so they floated mid-screen on iOS. They now use --nav-space, which drops to 0 while an editable field has focus. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HUc2nv7rJVU2gp3Bgtha3q --- CLAUDE.md | 5 ++++- OlaresManifest.yaml | 4 ++-- app/globals.css | 10 ++++++++++ components/cooking/cooking-mode.tsx | 2 +- components/dishes/dish-form.tsx | 2 +- components/dishes/starter-picker.tsx | 2 +- components/plan/plan-board.tsx | 2 +- components/receipts/receipt-review.tsx | 2 +- e2e/pwa.spec.ts | 19 +++++++++++++++++++ lib/use-keyboard-nav.ts | 5 +++++ olares/Chart.yaml | 4 ++-- olares/OlaresManifest.yaml | 4 ++-- olares/markt/26.11.26.md | 5 +++++ 13 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 olares/markt/26.11.26.md diff --git a/CLAUDE.md b/CLAUDE.md index 39ed144..cfb1770 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.25 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: +> **Status:** 26.11.26 — 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 @@ -403,6 +403,9 @@ Vorlagen ersetzt. `tests/seed.test.ts` prüft die Dateien. Ein Haushalt `useKeyboardSafeNav` (`lib/use-keyboard-nav.ts`): beim Tippen `hidden`, danach am `visualViewport` ausgerichtet (`translateY` um die Lücke) und ein Scroll auf der Stelle. Eine neue feste Leiste unten nutzt denselben Haken. `e2e/pwa.spec.ts` wacht. +- Feste Knopfleisten unten nehmen `sticky bottom-[var(--nav-space)]` (seit 26.11.26), nie + einen festen Abstand: Beim Tippen setzt der Haken `data-typing` an ``, dann ist + `--nav-space` 0 und die Knöpfe sitzen über der Tastatur. ## AI diff --git a/OlaresManifest.yaml b/OlaresManifest.yaml index 6812883..3ba72f7 100644 --- a/OlaresManifest.yaml +++ b/OlaresManifest.yaml @@ -21,7 +21,7 @@ metadata: title: What's cooking? description: 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.25 + version: 26.11.26 categories: - Applications @@ -61,7 +61,7 @@ permission: appData: true spec: - versionName: '26.11.25' + versionName: '26.11.26' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: diff --git a/app/globals.css b/app/globals.css index 0910656..3b438ff 100644 --- a/app/globals.css +++ b/app/globals.css @@ -65,6 +65,16 @@ --font-serif: var(--font-newsreader), ui-serif, Georgia, serif; } +/* Abstand fester Knopfleisten (Speichern, Übernehmen, Weiter) zur unteren Navigation. + Beim Tippen ist die Navigation weg (lib/use-keyboard-nav.ts) — dann sitzen die Knöpfe + direkt über der Tastatur statt mitten im Bild (Kai, 7.11.2026). */ +:root { + --nav-space: calc(4rem + env(safe-area-inset-bottom)); +} +:root[data-typing] { + --nav-space: 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 da68d3a..479e2eb 100644 --- a/components/cooking/cooking-mode.tsx +++ b/components/cooking/cooking-mode.tsx @@ -251,7 +251,7 @@ export function CookingMode({ {error ? {t("error")} : null} -
+
diff --git a/components/dishes/dish-form.tsx b/components/dishes/dish-form.tsx index 4a68175..62da5ef 100644 --- a/components/dishes/dish-form.tsx +++ b/components/dishes/dish-form.tsx @@ -447,7 +447,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 2e92951..19a540d 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} -
+
diff --git a/components/receipts/receipt-review.tsx b/components/receipts/receipt-review.tsx index 63a7014..b0209f0 100644 --- a/components/receipts/receipt-review.tsx +++ b/components/receipts/receipt-review.tsx @@ -168,7 +168,7 @@ export function ReceiptReview({ receipt }: { receipt: Receipt }) { {done ? (

{t("doneText")}

) : ( -
+
diff --git a/e2e/pwa.spec.ts b/e2e/pwa.spec.ts index 8b8ee56..28587f9 100644 --- a/e2e/pwa.spec.ts +++ b/e2e/pwa.spec.ts @@ -57,3 +57,22 @@ test("the bottom bar steps aside while typing and comes back at the bottom", asy expect(Math.round(box!.y + box!.height)).toBe(height); await expect(nav).not.toHaveAttribute("style", /translateY/); }); + +test("buttons pinned to the bottom sit on the keyboard while typing, above the bar afterwards", async ({ page }) => { + // iOS: „Speichern“ schwebte beim Tippen eine Leistenhöhe über der Tastatur (Kai, 7.11.2026). + await page.goto("/gerichte/neu"); + const save = page.getByRole("button", { name: "Speichern" }); + const height = page.viewportSize()!.height; + const nav = page.getByRole("navigation", { name: "Navigation" }); + const bottomOf = async () => { + const box = (await save.locator("xpath=..").boundingBox())!; + return Math.round(box.y + box.height); + }; + await page.locator("#title").focus(); + await expect(nav).toBeHidden(); + await expect.poll(bottomOf).toBe(height); + await page.locator("#title").blur(); + await expect(nav).toBeVisible(); + const navTop = Math.round((await nav.boundingBox())!.y); + await expect.poll(bottomOf).toBeLessThanOrEqual(navTop); +}); diff --git a/lib/use-keyboard-nav.ts b/lib/use-keyboard-nav.ts index bca4b4e..f478eba 100644 --- a/lib/use-keyboard-nav.ts +++ b/lib/use-keyboard-nav.ts @@ -18,6 +18,11 @@ export function useKeyboardSafeNav() { const ref = useRef(null); const [typing, setTyping] = useState(false); + // Für feste Knopfleisten (globals.css, --nav-space): beim Tippen ohne Abstand zur Navigation. + useEffect(() => { + document.documentElement.toggleAttribute("data-typing", typing); + }, [typing]); + useEffect(() => { const vv = window.visualViewport; // Abstand zwischen Unterkante des sichtbaren Bereichs und der des Layouts. diff --git a/olares/Chart.yaml b/olares/Chart.yaml index 9129558..f9159ba 100644 --- a/olares/Chart.yaml +++ b/olares/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: lunch description: Was gibt's? — die Familie entscheidet gemeinsam, was es gibt; aus dem Plan entsteht die Einkaufsliste type: application -version: 26.11.25 # YY.M. wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen -appVersion: "26.11.25" # MUSS gleich version sein: der Linter prüft es, und der Image-Tag hängt daran +version: 26.11.26 # YY.M. wie im AImighty-Markt — bei jeder Chart-Änderung erhöhen +appVersion: "26.11.26" # 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 6812883..3ba72f7 100644 --- a/olares/OlaresManifest.yaml +++ b/olares/OlaresManifest.yaml @@ -21,7 +21,7 @@ metadata: title: What's cooking? description: 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.25 + version: 26.11.26 categories: - Applications @@ -61,7 +61,7 @@ permission: appData: true spec: - versionName: '26.11.25' + versionName: '26.11.26' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: diff --git a/olares/markt/26.11.26.md b/olares/markt/26.11.26.md new file mode 100644 index 0000000..83b729f --- /dev/null +++ b/olares/markt/26.11.26.md @@ -0,0 +1,5 @@ +# Buttons stay at the bottom +v26.11.26: On the iPhone, buttons pinned to the bottom (Save, Confirm, Approve plan, Next in cooking mode) floated in the middle of the screen while typing, a bar's height above the keyboard. They now sit right on the keyboard while you type and above the bottom bar afterwards. + +## Deutsch +v26.11.26: Am iPhone schwebten die unten festen Knöpfe (Speichern, Übernehmen, Plan freigeben, Weiter im Kochmodus) beim Tippen mitten im Bild, eine Leistenhöhe über der Tastatur. Jetzt sitzen sie beim Tippen direkt über der Tastatur und danach wieder über der unteren Leiste. -- 2.54.0