diff --git a/e2e/measurement-flow.spec.ts b/e2e/measurement-flow.spec.ts index 12493d915..1d42626e0 100644 --- a/e2e/measurement-flow.spec.ts +++ b/e2e/measurement-flow.spec.ts @@ -101,14 +101,12 @@ test.describe("add measurement flow", () => { .first() .click(); - // The Radix DropdownMenu mounts its content in a portal; the role - // is `menuitem`. Both items currently render the literal "Add" in - // EN (measurements.addMeasurement = "Add", mood.addEntry = "Add"), - // so we disambiguate by hitting the FIRST one — that's the - // measurement entry per the dashboard JSX order. Sub-optimal, but - // robust against the i18n collision we don't want to fix in this - // phase (would touch dashboard copy). - await page.getByRole("menuitem").first().click(); + // v1.5 phase-5: the menu items now have distinct labels — the + // measurement entry says "Measurement" / "Messung" instead of "Add", + // so we can target it directly. + await page + .getByRole("menuitem", { name: /measurement|messung/i }) + .click(); // Form should be visible inside the dialog. Switch type to WEIGHT // (combo-box defaults to BLOOD_PRESSURE). diff --git a/messages/de.json b/messages/de.json index faa6af6bf..d5027e0b7 100644 --- a/messages/de.json +++ b/messages/de.json @@ -216,6 +216,8 @@ "trendDown": "fallend", "trendStable": "stabil", "quickEntry": "Schnelleingabe", + "quickAddMeasurement": "Messung", + "quickAddMood": "Stimmungseintrag", "addMeasurement": "Messwert hinzufügen", "compliance7d": "Einnahmetreue (7 Tage)", "complianceGood": "Gut", diff --git a/messages/en.json b/messages/en.json index f542a39f2..76c44a975 100644 --- a/messages/en.json +++ b/messages/en.json @@ -216,6 +216,8 @@ "trendDown": "falling", "trendStable": "stable", "quickEntry": "Quick entry", + "quickAddMeasurement": "Measurement", + "quickAddMood": "Mood entry", "addMeasurement": "Add measurement", "compliance7d": "Compliance (7 days)", "complianceGood": "Good", diff --git a/src/app/page.tsx b/src/app/page.tsx index f5c530f22..101f56196 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -373,15 +373,19 @@ export default function DashboardPage() { + {/* v1.5 phase-5: the menu items used to share the literal label + "Add" with the dialog titles, so screen-reader users heard + two indistinguishable "Add" rows in the same dropdown. The + trigger already says "Add" — these label what's being added. */} setQuickEntryDialog("measurement")} > - - {t("measurements.addMeasurement")} + setQuickEntryDialog("mood")}> - - {t("mood.addEntry")} +