From 6d09b0673dd9097112be6a07060ff7d0d6ca5d44 Mon Sep 17 00:00:00 2001 From: Kavi Date: Tue, 2 Jun 2026 04:31:42 -0400 Subject: [PATCH] Show raw descriptions everywhere (match PDF exactly) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove cleanDesc() stripping in breakdown accordion, top merchants, tooltip rows, and Ledger table — descriptions now show verbatim as they appear in the source PDF so any transaction can be cross-referenced. --- web/dashboard.js | 6 +++--- web/dashboard2.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/dashboard.js b/web/dashboard.js index a3ebe7a..87dd78b 100644 --- a/web/dashboard.js +++ b/web/dashboard.js @@ -30,7 +30,7 @@ let html = `
${esc(title)}
${window.MT.CLP(txns.reduce((a, t) => a + t.amount, 0))}
${txns.length} transactions
`; - for (const t of top) html += `
${t.date.slice(5).replace('-', '/')}${esc(window.MT.cleanDesc(t.description) || t.counterparty || '—')}${window.MT.CLP(t.amount)}
`; + for (const t of top) html += `
${t.date.slice(5).replace('-', '/')}${esc(t.description || t.counterparty || '—')}${window.MT.CLP(t.amount)}
`; html += '
'; if (txns.length > 6) html += `
+${txns.length - 6} more
`; tip.innerHTML = html; tip.classList.add('show'); place(e); @@ -133,7 +133,7 @@ const months = window.MT.months; const spendByM = {}; months.forEach(m => spendByM[m] = sum(spend.filter(t => t.ym === m))); // top merchants - const byMerch = groupSum(tx.filter(isExpense), t => window.MT.cleanDesc(t.description) || 'Unknown'); + const byMerch = groupSum(tx.filter(isExpense), t => t.description || 'Unknown'); const merch = sortEntries(byMerch).slice(0, 10); const biggestCat = cats[0]; @@ -172,7 +172,7 @@ host.innerHTML = ''; cats.forEach(([catName, catData], i) => { const color = catColor(i); - const byDesc = groupSum(catData.txns, t => MT.cleanDesc(t.description) || t.description || '—'); + const byDesc = groupSum(catData.txns, t => t.description || '—'); const descs = sortEntries(byDesc); const pct = Math.round(catData.value / total * 100); const section = document.createElement('div'); diff --git a/web/dashboard2.js b/web/dashboard2.js index dcbe280..b945d48 100644 --- a/web/dashboard2.js +++ b/web/dashboard2.js @@ -285,7 +285,7 @@ const shown = rows.slice(0, st.limit); $('#lx-rows').innerHTML = shown.map(t => ` ${t.date} - ${esc(MT.cleanDesc(t.description) || t.counterparty || '—')} + ${esc(t.description || t.counterparty || '—')} ${esc(t.bank)} ${MT.acctShort(t.doc_type)}${t.last4 ? ' ··' + t.last4 : ''} ${FLOW_LABEL[t.flow_type] || t.flow_type} ${t.direction === 'credit' ? '+' : '−'}${CLP(t.amount)}`).join('');