From 64a7408e7d43895ac139395371abfa5df439de35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 17 May 2026 14:42:33 +0200 Subject: [PATCH] feat(dashboard): wire medication-intake action into the Hinzufuegen menu Add the third row to the dashboard quick-add DropdownMenu so a medication-intake event can be logged without leaving the page. The new ResponsiveSheet shares the same footer-portal contract as the existing Measurement and Mood sheets so the Save and Cancel buttons sticky-pin above the mobile soft keyboard, and the menu label is a self-contained verb-phrase ('Medikamenteneinnahme erfassen' / 'Log medication intake') that doesn't collide with the trigger or the sibling rows. --- src/app/page.tsx | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 15325a6a8..0a2fc9a35 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -11,6 +11,7 @@ import { Heart, Moon, Percent, + Pill, Plus, Smile, Target, @@ -38,6 +39,7 @@ import { } from "@/components/ui/dropdown-menu"; import { MeasurementForm } from "@/components/measurements/measurement-form"; import { MoodForm } from "@/components/mood/mood-form"; +import { MedicationIntakeQuickAdd } from "@/components/dashboard/medication-intake-quick-add"; import { TrendCard } from "@/components/charts/trend-card"; import { TrendHint } from "@/components/charts/trend-hint"; import { summaryToTrend7Delta } from "@/lib/analytics/trend-delta"; @@ -196,13 +198,19 @@ export default function DashboardPage() { const { t } = useTranslations(); const fmt = useFormatters(); const [quickEntryDialog, setQuickEntryDialog] = useState< - "measurement" | "mood" | null + "measurement" | "mood" | "medicationIntake" | null >(null); // v1.4.27 R4 RC2 — DOM handles for the form action-row portal target // on each quick-entry sheet. The Sheet branch sticky-pins this slot. const [measurementFooterEl, setMeasurementFooterEl] = useState(null); const [moodFooterEl, setMoodFooterEl] = useState(null); + // v1.4.37 W7b — medication-intake quick-add lives on the same Sheet + // primitive as the other two quick-entries; the form's action row is + // portalled into this slot so Save / Cancel stay reachable above the + // mobile soft keyboard. + const [medicationIntakeFooterEl, setMedicationIntakeFooterEl] = + useState(null); // v1.4.29 M5 — the three inline dashboard queries default to a // 0-ms `staleTime`, so a tab-focus-and-return triggered a refetch @@ -582,6 +590,17 @@ export default function DashboardPage() {