From 17428a4f513d68cdba576d63baf7737acce206d3 Mon Sep 17 00:00:00 2001 From: Nikola Petrov Date: Fri, 2 Oct 2026 19:25:42 +0200 Subject: [PATCH] Fix the report's transfer rows rendering as text The report builds its excluded rows as a group per currency -- the transfer legs and, when a tolerance admitted one, the fee -- so its tbody children nest two arrays deep. h flattened only one level, so each group was stringified and the page showed "[object HTMLTableRowElement]" wherever a period held a matched transfer. Children now flatten all the way down. Co-Authored-By: Claude Opus 5.5 --- internal/web/static/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/web/static/app.js b/internal/web/static/app.js index 1e1f134..c175f00 100644 --- a/internal/web/static/app.js +++ b/internal/web/static/app.js @@ -41,7 +41,9 @@ function blankTransfer() { // --- plumbing ------------------------------------------------------------- // h builds an element. Text always goes in as a text node, never as HTML, -// since descriptions come straight off bank statements. +// since descriptions come straight off bank statements. Children flatten all +// the way down: a map that yields a group of rows — the report's transfers +// and their fee — would otherwise be stringified into the page. function h(tag, attrs, ...children) { const el = document.createElement(tag); for (const [k, v] of Object.entries(attrs || {})) { @@ -51,7 +53,7 @@ function h(tag, attrs, ...children) { else if (k === 'value') el.value = v; else el.setAttribute(k, v === true ? '' : v); } - for (const c of children.flat()) { + for (const c of children.flat(Infinity)) { if (c === null || c === undefined || c === false) continue; el.append(c instanceof Node ? c : document.createTextNode(String(c))); }