From bb2c00f2fab157bbe64d72973c998f40350aa60d Mon Sep 17 00:00:00 2001 From: Mick <119439091+mickbrowns1@users.noreply.github.com> Date: Fri, 22 May 2026 11:31:23 -0400 Subject: [PATCH] =?UTF-8?q?Collapse=20MITRE=20tactic=20cards=20by=20defaul?= =?UTF-8?q?t=20=E2=80=94=20click=20to=20expand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each card shows tactic name, technique count, and rule badge in the header. Clicking the header toggles the technique chips with an animated chevron. The existing '+N more' expander still works within the expanded card. Co-Authored-By: Claude Sonnet 4.6 --- frontend/index.html | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index fd4f855..15f65f1 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1949,6 +1949,9 @@ async function loadMitre() { const borderColor = t.rule_count >= 20 ? 'border-l-purple-500' : t.rule_count >= 5 ? 'border-l-blue-500' : 'border-l-slate-600' const badgeColor = t.rule_count >= 20 ? 'bg-purple-900/60 text-purple-300 border-purple-700' : t.rule_count >= 5 ? 'bg-blue-900/60 text-blue-300 border-blue-700' : 'bg-slate-800/60 text-slate-400 border-slate-700' + const bodyId = 'mitre-body-' + t.tactic.replace(/[^a-z0-9]/gi, '_') + const chevId = 'mitre-chev-' + t.tactic.replace(/[^a-z0-9]/gi, '_') + const MAX_SHOWN = 12 const chips = t.techniques.slice(0, MAX_SHOWN).map(tech => `${esc(tech.id || tech.name)}` @@ -1963,14 +1966,25 @@ async function loadMitre() { ` : '' - return `
-
- ${esc(t.tactic)} - ${t.rule_count} rule${t.rule_count !== 1 ? 's' : ''} -
- ${t.techniques.length > 0 ? ` -
${chips}
- ${moreSection}` : `

No technique IDs mapped

`} + const techCount = t.techniques.length + const bodyContent = techCount > 0 + ? `
${chips}
${moreSection}` + : `

No technique IDs mapped

` + + return `
+ +
` }).join('') } catch(e) { @@ -1978,6 +1992,14 @@ async function loadMitre() { } } +function mitreToggleTactic(bodyId, chevId) { + const body = document.getElementById(bodyId) + const chev = document.getElementById(chevId) + if (!body) return + const hidden = body.classList.toggle('hidden') + if (chev) chev.style.transform = hidden ? '' : 'rotate(180deg)' +} + function mitreToggleMore(id, btn) { const el = document.getElementById(id) if (!el) return