diff --git a/network-poc/static/index.html b/network-poc/static/index.html index e621fd6..0f32e34 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -2147,7 +2147,7 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, pipelineSteps.push(step); } renderPipelineSteps(); - // Päivitetään agentin avatar tooltip + // Päivitetään agentin avatar tooltip + vilahdus const avatarMap = { manager: 'avatar-kpn', coder: 'avatar-coder', tester: 'avatar-tester', qa: 'avatar-qa', data: 'avatar-data' }; const avatarId = avatarMap[agent]; if (avatarId) { @@ -2155,6 +2155,24 @@ IMPORTANT: Include get_db() dependency for FastAPI` }, if (el) { const truncOut = (output || '').substring(0, 200).replace(/\n/g, ' '); el.title = `${label}\n${status === 'active' ? '⏳ Käsittelee...' : '✓ Valmis'}\n\nInput: ${(input || '').substring(0, 100)}...\nOutput: ${truncOut}...`; + + // Vilahdus: avatar aktiiviseksi vuoron ajaksi + if (status === 'active') { + document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active')); + el.classList.add('active'); + // Gallery-head samoin + const galleryMap = { manager: 'wrap-manager', coder: 'wrap-coder', tester: 'wrap-tester', qa: 'wrap-qa', data: 'wrap-data' }; + document.querySelectorAll('.gallery-head-wrap').forEach(w => w.classList.remove('active')); + const gw = document.getElementById(galleryMap[agent]); + if (gw) gw.classList.add('active'); + } else if (status === 'done') { + // Pidetään aktiivisena vielä sekunnin, sitten pois + setTimeout(() => { + el.classList.remove('active'); + const gw = document.getElementById('wrap-' + agent); + if (gw) gw.classList.remove('active'); + }, 1000); + } } } } @@ -3662,11 +3680,7 @@ ${filesHtml} while (term.children.length > 50 && !term.firstChild.querySelector('.stream-content')) term.removeChild(term.firstChild); term.scrollTop = term.scrollHeight; - // Avatar-aktivointi vain oikeille käyttäjäpyynnöille - if (data.task_id) { - document.querySelectorAll('.avatar-card').forEach(c => c.classList.remove('active')); - document.getElementById('avatar-kpn')?.classList.add('active'); - } + // Avatar-aktivointi hoidetaan pipelineStep()-funktiossa } } else if (isCoder) { // Codelab: erillinen addCodeResult-handler käsittelee (rivi 2364)