|
124 | 124 | .copy-modal-box textarea{width:100%;height:300px;font-family:inherit;font-size:11px;border:1px solid var(--border);border-radius:4px;padding:8px;background:var(--input-bg);color:var(--text);resize:vertical} |
125 | 125 | .copy-modal-box .modal-btns{display:flex;gap:8px;justify-content:flex-end} |
126 | 126 | .copy-modal-box button{padding:6px 16px;border:1px solid var(--border);border-radius:4px;background:var(--btn-bg);color:var(--btn-text);cursor:pointer;font-size:11px;font-family:inherit} |
| 127 | +.done-banner{position:fixed;top:0;left:0;right:0;background:var(--seg-done);color:#fff;padding:10px 16px;z-index:250;display:flex;align-items:center;gap:10px;font-size:12px;font-weight:500;box-shadow:0 2px 8px rgba(0,0,0,.15);transform:translateY(-100%);transition:transform .3s ease} |
| 128 | +.done-banner.show{transform:translateY(0)} |
| 129 | +.done-banner .banner-text{flex:1} |
| 130 | +.done-banner .banner-close{background:none;border:none;color:#fff;font-size:18px;cursor:pointer;padding:0 4px;line-height:1;opacity:.8} |
| 131 | +.done-banner .banner-close:hover{opacity:1} |
127 | 132 | .session-link{margin-bottom:6px;font-size:11px;display:flex;align-items:center;gap:8px} |
128 | 133 | .session-link a{font-weight:500} |
129 | 134 | .session-link .spacer{flex:1} |
|
181 | 186 | </div><!-- close widget-frame --> |
182 | 187 |
|
183 | 188 | <div id="pop" class="popover"><div class="pop-hdr"></div><div class="pop-body"></div></div> |
| 189 | +<div id="doneBanner" class="done-banner"><span class="banner-text">Task complete — ask Claude to get the results.</span><button class="banner-close" id="closeBanner">×</button></div> |
184 | 190 | <div id="toast" class="toast">Copied!</div> |
185 | 191 | <div id="copyModal" class="copy-modal"><div class="copy-modal-box"><div style="font-weight:600;font-size:13px">Select all and copy (Cmd+C / Ctrl+C)</div><textarea id="copyArea" readonly></textarea><div class="modal-btns"><button id="closeCopyModal">Close</button></div></div></div> |
186 | 192 | <script type="module"> |
|
222 | 228 |
|
223 | 229 | /* ── progress state ── */ |
224 | 230 | let pollUrl=null,pollTimer=null,wasDone=false,pollCursor=null; |
225 | | -let progressMode=false,resultsFetched=false,notifiedClaude=false; |
| 231 | +let progressMode=false,resultsFetched=false; |
226 | 232 | let currentTaskId=null; |
227 | 233 | const aggHistory=[]; /* [{aggregate,micros:[{text,row_index}],ts}] */ |
228 | 234 | let activeTab="activity"; |
|
371 | 377 | progressSection.classList.add("flash"); |
372 | 378 | /* auto-fetch results on completion */ |
373 | 379 | if(!resultsFetched)autoFetchResults(); |
374 | | - /* notify Claude so it can present results in the conversation */ |
375 | | - notifyClaude(d); |
| 380 | + showDoneBanner(); |
376 | 381 | } |
377 | 382 | if(done&&pollTimer){clearInterval(pollTimer);pollTimer=null;} |
378 | 383 | } |
379 | 384 |
|
380 | 385 |
|
381 | | -/* ── notify Claude on completion so it can present results ── */ |
382 | | -async function notifyClaude(d){ |
383 | | - if(notifiedClaude||!currentTaskId)return; |
384 | | - notifiedClaude=true; |
385 | | - try{ |
386 | | - await app.sendMessage({role:"user",content:[{type:"text",text:"The task is now done. Get the results."}]}); |
387 | | - }catch(e){console.error("[notify] sendMessage failed:",e);} |
388 | | -} |
| 386 | +/* ── show completion banner ── */ |
| 387 | +const doneBanner=document.getElementById("doneBanner"); |
| 388 | +document.getElementById("closeBanner").addEventListener("click",()=>doneBanner.classList.remove("show")); |
| 389 | +function showDoneBanner(){doneBanner.classList.add("show");} |
389 | 390 |
|
390 | 391 | /* ── auto-fetch results on completion ── */ |
391 | 392 | async function autoFetchResults(){ |
|
731 | 732 | popHdr.textContent="research."+col.replace(/^research\\./,""); |
732 | 733 | popBody.innerHTML=linkify(text); |
733 | 734 | const rect=td.getBoundingClientRect(); |
734 | | - let left=rect.left,top=rect.bottom+4; |
| 735 | + let left=rect.left,top=rect.bottom-8; |
735 | 736 | pop.classList.add("visible");popVisible=true; |
736 | 737 | const pw=pop.offsetWidth,ph=pop.offsetHeight; |
737 | 738 | if(left+pw>window.innerWidth-8)left=window.innerWidth-pw-8; |
738 | 739 | if(left<8)left=8; |
739 | | - if(top+ph>window.innerHeight-8)top=rect.top-ph-4; |
| 740 | + if(top+ph>window.innerHeight-8)top=rect.top-ph+8; |
740 | 741 | pop.style.left=left+"px";pop.style.top=top+"px"; |
741 | 742 | } |
742 | 743 | function hidePopover(){pop.classList.remove("visible");popVisible=false;popTarget=null;} |
|
750 | 751 | popTarget=td;popTimer=setTimeout(()=>showPopover(td),300); |
751 | 752 | }else{ |
752 | 753 | clearTimeout(popTimer);popTarget=null; |
753 | | - if(popVisible)popTimer=setTimeout(()=>{if(!pop.matches(":hover"))hidePopover();},150); |
| 754 | + if(popVisible)popTimer=setTimeout(()=>{if(!pop.matches(":hover"))hidePopover();},400); |
754 | 755 | } |
755 | 756 | }); |
756 | 757 | pop.addEventListener("mouseleave",()=>{clearTimeout(popTimer);hidePopover();}); |
|
0 commit comments