From f17fcf0f9dd6ad4be709cb0e5c6038ebc9f81858 Mon Sep 17 00:00:00 2001 From: Jaakko Vanhala Date: Sun, 5 Apr 2026 18:29:18 +0300 Subject: [PATCH] Terminaalin koodivastaus tiivistetty yhdelle riville, klikkaus laajentaa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tuloste näyttää ensimmäisen koodirivin + "(+N riviä)": ✓ Qwen2.5-Coder (75 tok) ▶ fn fibonacci(n: usize) -> usize { (+8 riviä) Klikkaus laajentaa/sulkee koko koodin highlight.js-korostuksella ja vasemman reunan indikaattoriviivalla. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index 052f5b7..2e93435 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -1788,8 +1788,15 @@ const tokGen = data.tokens_generated || 0; termLog(` ${data.model || model} (${tokGen} tok)`); if (!silent) { - const highlighted = highlightCode(response).replace(/\n/g, '\n '); - termLog(`
${highlighted}
`); + // Kompakti yksirivinen esikatselu — klikkaa/hover laajentaa + const firstLine = response.split('\n').find(l => l.trim()) || response; + const lineCount = response.split('\n').filter(l => l.trim()).length; + const preview = esc(firstLine.trim()); + const fullHighlighted = highlightCode(response).replace(/\n/g, '\n '); + const uid = 'code-' + Date.now(); + termLog(` ` + + ` ${preview} ${lineCount > 1 ? `(+${lineCount - 1} riviä)` : ''}` + + ``); } return response; } catch (e) {