diff --git a/templates/dashboard.html b/templates/dashboard.html index d7c3c90..8c5141f 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1007,9 +1007,11 @@ function escapeHtml(t) { } // ─── Actions ──────────────────────────────────────────────────────────────── -async function confirm(id, ev) { +async function confirm(id, ev, ctx = 'card') { ev.stopPropagation(); - const reason = document.getElementById('reason-'+id).value; + const reasonElId = (ctx === 'modal') ? ('reason-modal-' + id) : ('reason-' + id); + const reasonEl = document.getElementById(reasonElId); + const reason = reasonEl ? reasonEl.value : ''; await api(`/api/engrams/${id}/confirm`, { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, @@ -1020,9 +1022,11 @@ async function confirm(id, ev) { if (state.view === 'status') loadStatus(); } -async function reject(id, ev) { +async function reject(id, ev, ctx = 'card') { ev.stopPropagation(); - const reason = document.getElementById('reason-'+id).value; + const reasonElId = (ctx === 'modal') ? ('reason-modal-' + id) : ('reason-' + id); + const reasonEl = document.getElementById(reasonElId); + const reason = reasonEl ? reasonEl.value : ''; await api(`/api/engrams/${id}/reject`, { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, @@ -1058,18 +1062,62 @@ async function createEngram() { async function showDetail(id) { const item = await api(`/api/engrams/${id}`); const body = document.getElementById('modalBody'); + const links = (item.links || []); + const suggestions = (item.link_suggestions || []).concat(item.predictive_links || []); + const suggHtml = suggestions.length ? suggestions.map(s => ` +
Confidence: ${Math.round(item.confidence*100)}%
-Confirmed: ${item.confirmed ? '✅' : '❌'}
-Tags: ${item.tags.map(t => ''+t+'').join(' ')}
-Content:
-History:
-Links: ${item.links?.join(', ') || 'none'}
+