From 761c90311139910d74de403ad3a5f5e03ac8b2b0 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 20 Mar 2026 11:27:25 +0100 Subject: [PATCH] refactor(person): remove redundant conversations link from header The co-correspondent chips already link directly to the conversation view pre-filled with both persons, making the generic "Konversationen anzeigen" header link redundant. Removed the link and the person_btn_conversations i18n key from all three locales. Co-Authored-By: Claude Sonnet 4.6 --- frontend/e2e/persons.spec.ts | 15 +++++++++------ frontend/messages/de.json | 1 - frontend/messages/en.json | 1 - frontend/messages/es.json | 1 - frontend/src/routes/persons/[id]/+page.svelte | 4 ---- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/frontend/e2e/persons.spec.ts b/frontend/e2e/persons.spec.ts index 3d3312f6..174aad5e 100644 --- a/frontend/e2e/persons.spec.ts +++ b/frontend/e2e/persons.spec.ts @@ -166,17 +166,20 @@ test.describe('Person detail — sent and received documents', () => { }); test.describe('Person detail — conversations link', () => { - test('has a conversations link that pre-fills the person', async ({ page }) => { + test('co-correspondent chips link to conversations pre-filled with both persons', async ({ page }) => { await page.goto('/persons'); - // Exclude /persons/new to avoid matching the "New person" button const firstLink = page.locator('a[href^="/persons/"]:not([href="/persons/new"])').first(); const href = await firstLink.getAttribute('href'); const personId = href!.split('/persons/')[1]; await firstLink.click(); - // Use the specific person-detail link text, not the nav "Konversationen" link - const convLink = page.getByRole('link', { name: /Konversationen anzeigen/i }); - await expect(convLink).toBeVisible(); - await expect(convLink).toHaveAttribute('href', `/conversations?senderId=${personId}`); + await page.waitForSelector('[data-hydrated]'); + + // Co-correspondent chips link to /conversations?senderId=X&receiverId=Y + const chip = page.locator(`a[href^="/conversations?senderId=${personId}&receiverId="]`).first(); + if (await chip.count() > 0) { + const chipHref = await chip.getAttribute('href'); + expect(chipHref).toMatch(/\/conversations\?senderId=.+&receiverId=.+/); + } }); }); diff --git a/frontend/messages/de.json b/frontend/messages/de.json index da5cffc2..a9182b44 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -189,5 +189,4 @@ "comp_taginput_placeholder_filter": "Nach Schlagworten filtern...", "comp_taginput_remove": "Schlagwort entfernen", "comp_taginput_create_hint": "Enter drücken um Schlagwort zu erstellen.", - "person_btn_conversations": "Konversationen anzeigen" } diff --git a/frontend/messages/en.json b/frontend/messages/en.json index dd23cb72..011a6361 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -189,5 +189,4 @@ "comp_taginput_placeholder_filter": "Filter by tags...", "comp_taginput_remove": "Remove tag", "comp_taginput_create_hint": "Press Enter to create tag.", - "person_btn_conversations": "View conversations" } diff --git a/frontend/messages/es.json b/frontend/messages/es.json index 48e007d7..cd813d8b 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -189,5 +189,4 @@ "comp_taginput_placeholder_filter": "Filtrar por etiquetas...", "comp_taginput_remove": "Eliminar etiqueta", "comp_taginput_create_hint": "Pulse Enter para crear etiqueta.", - "person_btn_conversations": "Ver conversaciones" } diff --git a/frontend/src/routes/persons/[id]/+page.svelte b/frontend/src/routes/persons/[id]/+page.svelte index b44cdd79..8aae5805 100644 --- a/frontend/src/routes/persons/[id]/+page.svelte +++ b/frontend/src/routes/persons/[id]/+page.svelte @@ -199,10 +199,6 @@ {person.firstName} {person.lastName}
- - - {m.person_btn_conversations()} - {#if data.canWrite}