diff --git a/api/static/dashboard.html b/api/static/dashboard.html index d4e569d..cfca49e 100644 --- a/api/static/dashboard.html +++ b/api/static/dashboard.html @@ -303,6 +303,11 @@ border-bottom: 1px solid var(--border); font: 600 12px var(--mono); } .trig-row:last-child { border-bottom: 0; } .trig-row:nth-child(even) { background: rgba(255,255,255,.016); } + .trig-row { cursor: pointer; } + .trig-row:hover { background: rgba(91,163,255,.05); } + .trig-row.open { background: rgba(91,163,255,.07); border-bottom: 0; } + .trig-detail { border-bottom: 1px solid var(--border-soft); + background: rgba(13,17,23,.4); padding-bottom: 6px; } .trig-sym { width: 68px; font-weight: 700; font-size: 15px; letter-spacing: .2px; } .trig-state { width: 56px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; text-align: center; padding: 3px 0; border-radius: 4px; @@ -1263,7 +1268,27 @@ function trigCatalyst(adv, rawHeadline) { return '' + dot + ' ' + esc(typ) + badge + ''; } +// click a trigger row -> same reasoning timeline as the watch panel, right +// where the day's relevant names live +const trigExpanded = new Set(); +let lastTrigArgs = null; +async function toggleTrigReasoning(symbol) { + if (trigExpanded.has(symbol)) trigExpanded.delete(symbol); else trigExpanded.add(symbol); + if (lastTrigArgs) renderTriggers(lastTrigArgs[0], lastTrigArgs[1]); +} +function fillTrigReasoning() { + trigExpanded.forEach(async (symbol) => { + const hostEl = document.querySelector('[data-trig-crit="' + CSS.escape(symbol) + '"]'); + if (hostEl && hostEl.querySelector(".empty")) { + try { + const r = await fetch("/api/criteria?symbol=" + encodeURIComponent(symbol)); + hostEl.innerHTML = renderCriteriaGrid(await r.json()); + } catch (e) {} + } + }); +} function renderTriggers(tw, catMap) { + lastTrigArgs = [tw, catMap]; const arr = (tw && tw.triggers) || []; const cat = catMap || {}; $("trig-count").textContent = tw && tw.armed != null ? tw.armed : 0; @@ -1285,8 +1310,10 @@ function renderTriggers(tw, catMap) { const distTxt = fired ? '▲' : (dist != null ? (dist >= 0 ? '▲ ' : '') + dist.toFixed(1) + '%' : '—'); const distCls = dist == null ? '' : (dist >= 0 ? 'pos' : dist > -1 ? 'warn' : 'neg'); const near = (t.state === 'armed' && dist != null && dist > -1.0) ? ' near' : ''; - return '
' - + '
' + (t.catalyst ? '📰 ' : '') + esc(t.symbol) + '
' + const isOpen = trigExpanded.has(t.symbol); + return '
' + + '
▶ ' + (t.catalyst ? '📰 ' : '') + esc(t.symbol) + '
' + '
' + esc(t.state) + '
' + '
' + (t.gap != null ? 'gap ' + t.gap.toFixed(0) + '% ' : '') + (t.rvol != null ? t.rvol.toFixed(1) + 'x' : '') + (t.rvol_tod != null ? ' \u00B7 tod ' + (t.rvol_tod >= 100 ? t.rvol_tod.toFixed(0) : t.rvol_tod.toFixed(1)) + 'x' : '') + '
' + '
entry ' + fmt(trig) + ' stop ' + fmt(stop) + ' now ' + fmt(price) + '
' @@ -1295,8 +1322,11 @@ function renderTriggers(tw, catMap) { + '
' + '
' + distTxt + '
' + '
' + trigCatalyst(cat[(t.symbol || '').toUpperCase()] || cat[t.symbol], t.catalyst) + '
' - + '
'; + + '' + + (isOpen ? '
loading…
' : ''); }).join(''); + fillTrigReasoning(); } // catalyst engine status chip (shows the LLM news engine is live + its activity)