From 0309faa9938ac1aa904dbdedac1df6aeeda33a5f Mon Sep 17 00:00:00 2001 From: jonathan Date: Wed, 20 May 2026 15:55:58 +0200 Subject: [PATCH] fix: append day section to DOM before file rows so getElementById works _attachFileRowHandlers uses getElementById to wire up buttons; those elements must already be in the document. Moving section.appendChild and container.appendChild ahead of the file rows loop fixes the null reference that silently dropped all rendered content. Co-Authored-By: Claude Sonnet 4.6 --- web.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web.py b/web.py index 650cc81..00c78e7 100644 --- a/web.py +++ b/web.py @@ -1148,6 +1148,8 @@ function renderFiles(files) { `; const dayTbody = document.createElement('tbody'); table.appendChild(dayTbody); + section.appendChild(table); + container.appendChild(section); // File rows dayFiles.forEach(f => { @@ -1219,9 +1221,6 @@ function renderFiles(files) { _attachFileRowHandlers(f, isRec, expanded, dayId); }); - section.appendChild(table); - container.appendChild(section); - // Day toggle handler document.getElementById('daytgl-' + dayId).addEventListener('click', () => { const nowExp = !dayExpanded.get(dayId);