From 4103e1b0ca9e4fc6db282cf25dedcbe7584ed6eb Mon Sep 17 00:00:00 2001 From: kristianwind Date: Thu, 27 Aug 2026 16:33:30 +0200 Subject: [PATCH] fix(tasks): open the task by clicking its text, links carved out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first cut put an open-button overlay over the row, which intercepted every click on the title text — nine smoke tests (and real users) open a task by clicking its text, and the overlay stole those clicks. Make the body a role=button instead, with each link stopping its own click from bubbling: plain text opens the task, a link opens the page. Co-Authored-By: Claude Opus 4.8 --- web/e2e/smoke.spec.js | 6 +-- web/src/lib/components/TaskRow.svelte | 58 +++++++++++---------------- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/web/e2e/smoke.spec.js b/web/e2e/smoke.spec.js index ecc2ac5..8621c06 100644 --- a/web/e2e/smoke.spec.js +++ b/web/e2e/smoke.spec.js @@ -101,9 +101,9 @@ test('en URL i en opgave bliver et klikbart link, og resten åbner opgaven', asy await expect(link).toHaveAttribute('href', 'https://example.com/artikel'); await expect(link).toHaveAttribute('rel', /noopener/); - // Clicking anywhere but the link still opens the task — the open-overlay sits - // behind the text, the link above it. - await row.getByRole('button', { name: /læs https/ }).click(); + // Clicking the plain part of the title still opens the task; only the link is + // carved out. Aimed at the top-left, over "læs", not the URL in the middle. + await row.locator('.content').click({ position: { x: 3, y: 3 } }); await expect(page.getByRole('complementary', { name: 'Opgave' })).toBeVisible(); expect(trouble).toEqual([]); diff --git a/web/src/lib/components/TaskRow.svelte b/web/src/lib/components/TaskRow.svelte index 04ba0cc..d3e4dc3 100644 --- a/web/src/lib/components/TaskRow.svelte +++ b/web/src/lib/components/TaskRow.svelte @@ -101,25 +101,30 @@ -
- - - + text ever having been anything but plain text. The link is a real , which + an in a