From 215d4a465bc48b3ab7576c9a0cc749d0dae2975a Mon Sep 17 00:00:00 2001 From: m Date: Fri, 1 May 2026 10:55:30 +0200 Subject: [PATCH] fix(t-paliad-098): row-level click navigates to checklist instance The .entity-table tbody tr CSS rule sets cursor: pointer on every row, but the three checklist-instance tables only wired navigation to the name cell's . Clicks on Vorlage / Fortschritt / Angelegt cells looked clickable yet did nothing. Added row-level click handlers (skipping inner /button so the project-link cell and delete button still work) in: - checklists.ts (Vorhandene Instanzen tab) - projects-detail.ts (Checklisten tab on project detail) - checklists-detail.ts (instance list on template detail) Search-result anchors (handlers/search.go) already worked since they are real elements, no row handler needed. --- frontend/src/client/checklists-detail.ts | 9 +++++++++ frontend/src/client/checklists.ts | 14 +++++++++----- frontend/src/client/projects-detail.ts | 10 +++++++++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/frontend/src/client/checklists-detail.ts b/frontend/src/client/checklists-detail.ts index 68ae31d..85f82be 100644 --- a/frontend/src/client/checklists-detail.ts +++ b/frontend/src/client/checklists-detail.ts @@ -210,6 +210,15 @@ function renderInstances() { void deleteInstance(id); }); }); + + body.querySelectorAll(".checklist-instance-row").forEach((row) => { + const id = row.dataset.id!; + row.addEventListener("click", (e) => { + const target = e.target as HTMLElement; + if (target.closest("a") || target.closest("button")) return; + window.location.href = `/checklists/instances/${id}`; + }); + }); } function renderAkteOptions() { diff --git a/frontend/src/client/checklists.ts b/frontend/src/client/checklists.ts index ae428c4..0bdc56e 100644 --- a/frontend/src/client/checklists.ts +++ b/frontend/src/client/checklists.ts @@ -173,7 +173,7 @@ function renderInstances() { projectCell = `Persönlich`; } - return ` + return ` ${esc(tplName)} ${esc(inst.name)} ${projectCell} @@ -189,10 +189,14 @@ function renderInstances() { `; }).join(""); - // Re-translate the "Persönlich" label for the project column on lang change — - // the data-i18n attribute is on a span we just rewrote, so initI18n's - // observer-style sweep covers this naturally on its next pass. Nothing to do - // here. + body.querySelectorAll(".checklist-instance-row").forEach((row) => { + const id = row.dataset.id!; + row.addEventListener("click", (e) => { + // Let inner links (project, instance name) handle their own navigation. + if ((e.target as HTMLElement).closest("a")) return; + window.location.href = `/checklists/instances/${id}`; + }); + }); } function showTab(tab: TabId, opts: { pushHistory?: boolean } = {}) { diff --git a/frontend/src/client/projects-detail.ts b/frontend/src/client/projects-detail.ts index 4b56508..6b87898 100644 --- a/frontend/src/client/projects-detail.ts +++ b/frontend/src/client/projects-detail.ts @@ -725,7 +725,7 @@ function renderChecklistInstances() { const total = tpl ? tpl.itemCount : 0; const done = Object.values(inst.state || {}).filter(Boolean).length; const pct = total === 0 ? 0 : Math.round((done / total) * 100); - return ` + return ` ${escapeHtml(tplName)} ${escapeHtml(inst.name)} @@ -739,6 +739,14 @@ function renderChecklistInstances() { ${escapeHtml(fmtDate(inst.created_at))} `; }).join(""); + + body.querySelectorAll(".checklist-instance-row").forEach((row) => { + const id = row.dataset.id!; + row.addEventListener("click", (e) => { + if ((e.target as HTMLElement).closest("a")) return; + window.location.href = `/checklists/instances/${id}`; + }); + }); } function escapeHtml(s: string): string {