From 95988ee8435fe2b99471f4a5440d4af2494d8a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 8 Aug 2026 14:56:06 +0200 Subject: [PATCH] fix(nav): drop the access-level line from a record-switcher entry Three lines in a 240 px menu: the name, the access level, the kind of record. The middle one truncated more often than it read, and it is what the warning banner states in full once you are inside the record, where it governs what the page lets you do. Two lines left, and the level stays on the row as `data-access-level` for the browser journeys. The switcher's own "Read only" / "Can add entries" strings had no other reader and leave all six bundles. --- e2e/account-sharing.spec.ts | 9 +++++++++ messages/de.json | 4 +--- messages/en.json | 4 +--- messages/es.json | 4 +--- messages/fr.json | 4 +--- messages/it.json | 4 +--- messages/pl.json | 4 +--- .../layout/account-switcher-menu.tsx | 20 +++++++------------ 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/e2e/account-sharing.spec.ts b/e2e/account-sharing.spec.ts index 0046c15d5..f721792c1 100644 --- a/e2e/account-sharing.spec.ts +++ b/e2e/account-sharing.spec.ts @@ -313,6 +313,15 @@ test.describe("account sharing", () => { const entry = page.locator('[data-slot="account-switcher-entry"]'); await expect(entry).toHaveCount(1); await expect(entry).toContainText(E2E_OWNER.username); + // Two lines: the name and the kind of record. The access level used to + // take a third and was truncated more often than it was read; it is what + // the banner says once you are inside. The row still CARRIES the level as + // an attribute, which is the positive control for the absence below — + // without it, a renamed slot would make this read green. + await expect(entry).toHaveAttribute("data-access-level", /.+/); + await expect(entry).not.toContainText("Read only"); + await expect(entry).not.toContainText("Can add entries"); + await expect(entry).not.toContainText("change or remove what is in it"); // The way home is in the same menu as the way in. await expect( page.locator('[data-slot="account-switcher-own"]'), diff --git a/messages/de.json b/messages/de.json index 2ca8e44a9..0f4263acf 100644 --- a/messages/de.json +++ b/messages/de.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Akte öffnen", - "ownRecord": "Meine eigene Akte", - "readOnly": "Nur lesen", - "canWrite": "Darf Einträge anlegen" + "ownRecord": "Meine eigene Akte" }, "switch": { "failed": "Die Akte konnte nicht geöffnet werden. Bitte noch einmal versuchen.", diff --git a/messages/en.json b/messages/en.json index cce8b2ea2..3fb6bdf44 100644 --- a/messages/en.json +++ b/messages/en.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Open a record", - "ownRecord": "My own record", - "readOnly": "Read only", - "canWrite": "Can add entries" + "ownRecord": "My own record" }, "switch": { "failed": "Could not open that record. Please try again.", diff --git a/messages/es.json b/messages/es.json index 14df01c07..80c5f542a 100644 --- a/messages/es.json +++ b/messages/es.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Abrir un historial", - "ownRecord": "Mi propio historial", - "readOnly": "Solo lectura", - "canWrite": "Puede añadir entradas" + "ownRecord": "Mi propio historial" }, "switch": { "failed": "No se pudo abrir ese historial. Inténtalo de nuevo.", diff --git a/messages/fr.json b/messages/fr.json index 1510ead0c..1c0d89f63 100644 --- a/messages/fr.json +++ b/messages/fr.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Ouvrir un dossier", - "ownRecord": "Mon propre dossier", - "readOnly": "Lecture seule", - "canWrite": "Peut ajouter des entrées" + "ownRecord": "Mon propre dossier" }, "switch": { "failed": "Impossible d'ouvrir ce dossier. Veuillez réessayer.", diff --git a/messages/it.json b/messages/it.json index c0d97c4ef..6e485828c 100644 --- a/messages/it.json +++ b/messages/it.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Apri una cartella", - "ownRecord": "La mia cartella", - "readOnly": "Sola lettura", - "canWrite": "Può aggiungere voci" + "ownRecord": "La mia cartella" }, "switch": { "failed": "Non è stato possibile aprire quella cartella. Riprova.", diff --git a/messages/pl.json b/messages/pl.json index 90eb7eda8..4b433e175 100644 --- a/messages/pl.json +++ b/messages/pl.json @@ -9677,9 +9677,7 @@ }, "switcher": { "label": "Otwórz kartę", - "ownRecord": "Moja własna karta", - "readOnly": "Tylko odczyt", - "canWrite": "Może dodawać wpisy" + "ownRecord": "Moja własna karta" }, "switch": { "failed": "Nie udało się otworzyć tej karty. Spróbuj ponownie.", diff --git a/src/components/layout/account-switcher-menu.tsx b/src/components/layout/account-switcher-menu.tsx index 8fac8a3b6..54abd94ca 100644 --- a/src/components/layout/account-switcher-menu.tsx +++ b/src/components/layout/account-switcher-menu.tsx @@ -101,11 +101,15 @@ export function AccountSwitcherMenuItems() { ) } > + {/* Two lines, not three. The access level had a line of its + own here and it never fit — a 240 px menu truncated + "Kann verwalten" as often as it showed it, and the entry + still said which kind of record this is on the line below. + The level is what the banner states once you are inside, + where it governs what the page lets you do. It stays on + the row as `data-access-level` for the browser journeys. */}
{accountLabel(account)} - - {accessLabel(presentation.access, t)} - {recordKindLabel(presentation.recordKind, t)} @@ -122,16 +126,6 @@ export function AccountSwitcherMenuItems() { ); } -function accessLabel( - access: ReturnType["access"], - t: ReturnType["t"], -): string { - if (access === "manage") return t("recordSharing.row.canManage"); - return access === "view-and-add" - ? t("recordSharing.switcher.canWrite") - : t("recordSharing.switcher.readOnly"); -} - function recordKindLabel( recordKind: ReturnType["recordKind"], t: ReturnType["t"],