From 6bc7d036763a861a1f8e27ab77c4cbe544f05f17 Mon Sep 17 00:00:00 2001 From: Jaakko Vanhala Date: Sun, 5 Apr 2026 09:25:43 +0300 Subject: [PATCH] Reitityksen tilatieto UI:ssa: task_routed-viestit terminaaliin ja codelab-latausindikaattoriin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Näyttää "Reititetty solmulle #N" tai "Kaikki N solmua varattuja — odotetaan..." sekä agents-terminaalissa että koodilaboratorion lataustekstissä. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index fd8b0e2..41dedfa 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2199,6 +2199,34 @@ targetBox.scrollTop = targetBox.scrollHeight; } } + } else if (data.type === "task_routed") { + const term = document.getElementById('agent-terminal'); + const isQueued = data.status === 'queued'; + const color = isQueued ? '#d29922' : '#58a6ff'; + const icon = isQueued ? '⏳' : '→'; + const msg = esc(data.message || ''); + + // Agents-terminaali + if (term && data.task_id && activeStreams[data.task_id]) { + const div = document.createElement('div'); + div.className = 'terminal-line'; + div.style.color = color; + div.innerHTML = ` ${icon} ${msg}`; + if (isQueued) div.id = 'routing-' + data.task_id; + // Päivitetään olemassaoleva jonorivi jos löytyy + const existing = document.getElementById('routing-' + data.task_id); + if (existing) { existing.innerHTML = ` ${icon} ${msg}`; existing.style.color = color; } + else term.appendChild(div); + term.scrollTop = term.scrollHeight; + } + + // Codelab-loading-teksti + const codeLoading = document.getElementById('code-loading'); + if (codeLoading && codeLoading.style.display !== 'none') { + codeLoading.textContent = isQueued + ? `⏳ ${msg}` + : `→ ${msg} — generoidaan...`; + } } else if (data.type === "llm_prompt") { if (data.task_id) { const term = document.getElementById('agent-terminal');