diff --git a/llm_team_ui.py b/llm_team_ui.py index 00cc776..73c57e2 100644 --- a/llm_team_ui.py +++ b/llm_team_ui.py @@ -3538,6 +3538,18 @@ async function toggleDemo() { loadModels(); renderSamplePrompts(); checkDemo(); +// Pick up prompt from optimization "Use This" button +(function(){ + var pending = sessionStorage.getItem('pending-prompt'); + if (pending) { + sessionStorage.removeItem('pending-prompt'); + var el = document.getElementById('prompt'); + if (el) el.value = pending; + // Open composer if in output-focused mode + var ct = document.querySelector('.container'); + if (ct) { ct.classList.remove('output-focused'); ct.classList.add('composer-active'); } + } +})(); // Background grid animation !function(){const c=document.getElementById('bg-grid');if(!c)return;const x=c.getContext('2d');function resize(){c.width=window.innerWidth;c.height=window.innerHeight}resize();window.addEventListener('resize',resize);let t=0;function draw(){x.clearRect(0,0,c.width,c.height);const s=50,ox=(t*0.2)%s,oy=(t*0.1)%s;x.fillStyle='rgba(226,181,90,0.025)';for(let gx=-s+ox;gx0.985){const ly=Math.random()*c.height;x.strokeStyle='rgba(226,181,90,0.012)';x.lineWidth=1;x.beginPath();x.moveTo(0,ly);x.lineTo(c.width,ly);x.stroke()}if(Math.random()>0.995){const lx=Math.random()*c.width;x.strokeStyle='rgba(226,181,90,0.008)';x.lineWidth=40;x.beginPath();x.moveTo(lx,0);x.lineTo(lx,c.height);x.stroke()}t++;requestAnimationFrame(draw)}draw()}(); @@ -6950,8 +6962,7 @@ function _showOptimizeStream(runId, jobId) { useBtn.style.cssText = 'color:var(--accent);border-color:var(--accent);font-size:9px;white-space:nowrap'; useBtn.textContent = 'Use This'; useBtn.onclick = function(){ - var promptEl = document.getElementById('prompt'); - if (promptEl) promptEl.value = r.prompt; + sessionStorage.setItem('pending-prompt', r.prompt); window.location.href = '/'; }; row.appendChild(useBtn);