From 29e5e0fd1ad1689f20e830c1f4eccaae2ef80582 Mon Sep 17 00:00:00 2001 From: geronimi73 Date: Thu, 2 Apr 2026 21:51:45 +0200 Subject: [PATCH] chevrons for tool result expansion --- src/ifcchat/app.js | 8 +++++--- src/ifcchat/style.css | 9 +++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/ifcchat/app.js b/src/ifcchat/app.js index ef0e9bce5b..8f2b1f3b97 100644 --- a/src/ifcchat/app.js +++ b/src/ifcchat/app.js @@ -75,14 +75,16 @@ function addMessage(role, text) { const wrap = document.createElement("div"); wrap.className = `msg ${role}`; wrap.innerHTML = ` -
${role}
+
${role}${role === "tool" ? '' : ''}
`; const bubble = wrap.querySelector(".bubble"); bubble.textContent = text; bubble.onclick = function () { if (bubble.scrollHeight > 100 && role === "tool") { - bubble.style.maxHeight = bubble.style.maxHeight == 'none' ? '' : 'none'; - bubble.style.borderBottom = bubble.style.borderBottom == '' ? 'dotted 2px gray' : ''; + const expanded = bubble.style.maxHeight === 'none'; + bubble.style.maxHeight = expanded ? '' : 'none'; + bubble.style.borderBottom = expanded ? '' : 'dotted 2px gray'; + wrap.querySelector(".chevron").style.transform = expanded ? '' : 'rotate(90deg)'; } } msgsEl.appendChild(wrap); diff --git a/src/ifcchat/style.css b/src/ifcchat/style.css index 6c3af2f56e..90fd417501 100644 --- a/src/ifcchat/style.css +++ b/src/ifcchat/style.css @@ -82,6 +82,15 @@ main { font-size: 60%; max-height: 100px; overflow: hidden; + cursor: pointer; +} + +.chevron { + display: inline-block; + font-size: 10px; + margin-left: 6px; + transition: transform 0.2s; + vertical-align: middle; } .composer {