Name every capture sheet by what it logs, in one order

The measurement and mood sheets were titled with the bare 'Add', the
medication one with the noun alone. Every capture sheet now carries the
verb phrase the dashboard's add menu shows, and the add menu lists its
entries in the capture picker's order. Normalise 'z.B.' to 'z. B.' in the
German catalogue and drop the register page's subtitle, which repeated
its title.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 16:20:41 +02:00
1 parent 7493ec48e4
commit 0b881fe5b7
13 files changed
+38 -55

No files matched your search

@@ -183,6 +183,10 @@ describe("<DashboardHeader> — every entry follows its module, as the capture p
`${kind} ${JSON.stringify(modules)}`,
).toBe(picker.includes(kind));
}
// Same order as the picker, so the two ways in never disagree on
// where an entry sits.
const positions = picker.map((kind) => html.indexOf(label[kind]));
expect(positions).toEqual([...positions].sort((x, y) => x - y));
}
});
});
@@ -190,12 +190,6 @@ export function DashboardHeader({
{t("dashboard.quickAddMeasurement")}
</DropdownMenuItem>
)}
{canAddMood && (
<DropdownMenuItem onClick={() => onQuickEntry("mood")}>
<Waves className="mr-2 h-4 w-4" aria-hidden="true" />
{t("dashboard.quickAddMood")}
</DropdownMenuItem>
)}
{/* v1.4.37 W7b — third quick-add row: medication intake.
Same Sheet-on-mobile / Dialog-on-desktop primitive as
the other two; the menu label is a self-contained
@@ -209,6 +203,12 @@ export function DashboardHeader({
{t("dashboard.quickAddMedicationIntake")}
</DropdownMenuItem>
)}
{canAddMood && (
<DropdownMenuItem onClick={() => onQuickEntry("mood")}>
<Waves className="mr-2 h-4 w-4" aria-hidden="true" />
{t("dashboard.quickAddMood")}
</DropdownMenuItem>
)}
{canAddSymptom && (
<DropdownMenuItem onClick={() => onQuickEntry("symptom")}>
<Stethoscope className="mr-2 h-4 w-4" aria-hidden="true" />
@@ -203,7 +203,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "measurement"}
onOpenChange={handleQuickEntryOpenChange}
title={t("measurements.addMeasurement")}
title={t("dashboard.quickAddMeasurement")}
footer={<div ref={setMeasurementFooterEl} className="flex w-full" />}
>
<MeasurementForm
@@ -215,7 +215,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "mood"}
onOpenChange={handleQuickEntryOpenChange}
title={t("mood.addEntry")}
title={t("dashboard.quickAddMood")}
footer={<div ref={setMoodFooterEl} className="flex w-full" />}
>
<MoodForm
@@ -231,7 +231,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "medicationIntake"}
onOpenChange={handleQuickEntryOpenChange}
title={t("dashboard.medicationIntakeQuickAdd.sheetTitle")}
title={t("dashboard.quickAddMedicationIntake")}
description={t("dashboard.medicationIntakeQuickAdd.sheetDescription")}
footer={
<div ref={setMedicationIntakeFooterEl} className="flex w-full" />
@@ -249,7 +249,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "symptom"}
onOpenChange={handleQuickEntryOpenChange}
title={t("symptoms.entry.sheetTitle")}
title={t("dashboard.quickAddSymptom")}
description={t("symptoms.entry.sheetDescription")}
footer={<div ref={setSymptomFooterEl} className="flex w-full" />}
>
@@ -267,7 +267,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "workout"}
onOpenChange={handleQuickEntryOpenChange}
title={t("insights.workouts.manual.sheetTitle")}
title={t("dashboard.quickAddWorkout")}
description={t("insights.workouts.manual.sheetDescription")}
footer={<div ref={setWorkoutFooterEl} className="flex w-full" />}
>
@@ -285,7 +285,7 @@ export function QuickEntrySheets({
<ResponsiveSheet
open={openSheet === "lifeEvent"}
onOpenChange={handleQuickEntryOpenChange}
title={t("lifeEvents.title")}
title={t("dashboard.quickAddLifeEvent")}
description={t("lifeEvents.subtitle")}
footer={<div ref={setLifeEventFooterEl} className="flex w-full" />}
>
+12 -9
View File
@@ -263,18 +263,21 @@ export function CapturePicker({
];
const options = allOptions.filter((opt) => offered.includes(opt.kind));
// One title per kind, the same verb phrase the dashboard's add menu
// shows, so the sheet names what is being logged wherever it opens from.
const formTitleByKind: Record<CaptureKind, string> = {
measurement: t("measurements.addMeasurement"),
medication: t("nav.capture.medication"),
mood: t("mood.addEntry"),
symptom: t("symptoms.entry.sheetTitle"),
workout: t("insights.workouts.manual.sheetTitle"),
lifeEvent: t("lifeEvents.title"),
measurement: t("dashboard.quickAddMeasurement"),
medication: t("dashboard.quickAddMedicationIntake"),
mood: t("dashboard.quickAddMood"),
symptom: t("dashboard.quickAddSymptom"),
workout: t("dashboard.quickAddWorkout"),
lifeEvent: t("dashboard.quickAddLifeEvent"),
};
// `openKind === null` keeps the form sheet closed (the title is unread
// then); the mood label is the harmless default, matching the prior
// ternary's else branch.
const formTitle = openKind ? formTitleByKind[openKind] : t("mood.addEntry");
// then); the mood label is the harmless default.
const formTitle = openKind
? formTitleByKind[openKind]
: t("dashboard.quickAddMood");
return (
<>