Show raw descriptions everywhere (match PDF exactly)

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.
This commit is contained in:
Kavi 2026-06-02 04:31:42 -04:00
parent b266542591
commit 6d09b0673d
2 changed files with 4 additions and 4 deletions

View File

@ -30,7 +30,7 @@
let html = `<div class="t-head"><span class="t-dot" style="background:${c}"></span><span class="t-title">${esc(title)}</span></div>
<div class="t-amt num" style="color:${c}">${window.MT.CLP(txns.reduce((a, t) => a + t.amount, 0))}</div>
<div class="t-meta">${txns.length} transactions</div><div class="t-rows">`;
for (const t of top) html += `<div class="t-row"><span class="d">${t.date.slice(5).replace('-', '/')}</span><span class="desc">${esc(window.MT.cleanDesc(t.description) || t.counterparty || '—')}</span><span class="a">${window.MT.CLP(t.amount)}</span></div>`;
for (const t of top) html += `<div class="t-row"><span class="d">${t.date.slice(5).replace('-', '/')}</span><span class="desc">${esc(t.description || t.counterparty || '—')}</span><span class="a">${window.MT.CLP(t.amount)}</span></div>`;
html += '</div>';
if (txns.length > 6) html += `<div class="t-more">+${txns.length - 6} more</div>`;
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');

View File

@ -285,7 +285,7 @@
const shown = rows.slice(0, st.limit);
$('#lx-rows').innerHTML = shown.map(t => `
<tr><td class="lx-date">${t.date}</td>
<td class="lx-desc" title="${esc(t.description)}">${esc(MT.cleanDesc(t.description) || t.counterparty || '—')}</td>
<td class="lx-desc">${esc(t.description || t.counterparty || '—')}</td>
<td style="white-space:nowrap;color:var(--ink-mute)">${esc(t.bank)} <span class="lx-pdf">${MT.acctShort(t.doc_type)}${t.last4 ? ' ··' + t.last4 : ''}</span></td>
<td><span class="lx-flow-tag"><i style="background:${FLOW_C[t.flow_type] || col.mute()}"></i>${FLOW_LABEL[t.flow_type] || t.flow_type}</span></td>
<td class="r lx-amt ${t.direction === 'credit' ? 'cr' : 'db'}">${t.direction === 'credit' ? '+' : ''}${CLP(t.amount)}</td></tr>`).join('');