← Commit history

Publish 1.9.257

John Lauer ·e2d0c71367 ·1mo ago ·parent 78cac46
3 files changed +18−17
.release-page-head+1−1
@@ -1 +1 @@-26193027f45ad94e0c4e9c8cbe65b5cc199413d6\ No newline at end of file+78cac468bbc51bc551c2a054a81c4d886b5a8789\ No newline at end of file
dashboard/ui/quick-actions.html+10−6
@@ -67,8 +67,8 @@ input[type=text]{font:inherit;color:var(--text);background:var(--surface);border .live-head{display:flex;align-items:center;gap:8px;font:11px var(--mono);color:var(--text-2);margin-bottom:6px;letter-spacing:.04em;text-transform:uppercase} .live-led{width:8px;height:8px;border-radius:50%;background:var(--text-2)}.live-led.on{background:var(--red);box-shadow:0 0 6px var(--red);animation:blink 1s steps(2) infinite} @keyframes blink{50%{opacity:.35}}-.live img[hidden]{display:none}-.live img{display:block;width:100%;height:auto;border-radius:6px;min-height:120px;background:#111}+.live canvas[hidden]{display:none}+.live canvas{display:block;width:100%;height:auto;border-radius:6px;background:#111} .toggle{background:none;border:none;padding:2px;cursor:pointer;flex-shrink:0;transition:transform .06s ease} .toggle-track{display:block;width:32px;height:18px;background:var(--overlay);border:1px solid var(--border);border-radius:9px;position:relative;transition:background .15s ease,border-color .15s ease} .toggle:hover .toggle-track{border-color:var(--accent)}.toggle:active{transform:translateY(1px) scale(.97)}@@ -169,7 +169,7 @@ input[type=text]{font:inherit;color:var(--text);background:var(--surface);border     </div>     <div class="live" id="live" hidden>       <div class="live-head"><span class="live-led" id="liveLed"></span><span id="liveLabel">live · Fusion on this machine</span><span class="mini" id="liveTick"></span></div>-      <img id="liveImg" alt="latest live frame of the Fusion window" hidden>+      <canvas id="liveImg" hidden></canvas>       <div class="mini" id="liveNote"></div>     </div>     <div class="prog" id="prog"><div></div></div>@@ -260,8 +260,12 @@ function frameSrc(f){var src=f.thumbnailDataUrl||f.dataUrl;if(src)return Promise function renderFrames(ev){var g=$('gallery');g.innerHTML='';(ev||[]).forEach(function(f,i){var id='shot'+i;var h='<div class="shot" id="'+id+'"><div class="cap" style="padding:18px 8px">'+(f.ok===false?'REFUSED: '+esc(f.error||'not evidence'):'loading frame...')+'</div><div class="cap"><span><span class="tag '+(f.kind==='proof'?'proof':'feed')+'">'+esc(f.kind||'frame')+'</span> '+esc(f.step||f.view||'')+(f.width?' '+f.width+'x'+f.height:'')+'</span><span>'+esc(f.part||'')+'</span></div></div>';g.insertAdjacentHTML('beforeend',h);if(f.ok===false)return;frameSrc(f).then(function(src){var el=document.getElementById(id);if(!el)return;if(src){el.firstElementChild.outerHTML='<img src="'+src+'" alt="'+esc(f.step||f.view||'frame')+'">'}else{el.firstElementChild.textContent='frame could not be fetched from the box: '+((f.screenshot||'').split('/').pop())}})})} // ---- the 1 fps live view: a slow movie of the Fusion window while the run works ------ var live={timer:null,since:0,on:false};-function liveStart(){if(live.on)return;live.on=true;live.since=0;$('live').hidden=false;$('liveImg').hidden=true;$('liveImg').removeAttribute('src');$('liveLabel').textContent='live · Fusion on this machine';$('liveLed').className='live-led';$('liveTick').textContent='';$('liveNote').textContent='starting the 1 fps capture on this machine...';cmd('fusion_live_feed',{action:'start',intervalSec:1,maxSec:1500}).then(function(){liveTick()}).catch(function(e){$('liveNote').textContent='feed could not start: '+e.message})}-function liveTick(){if(!live.on)return;cmd('fusion_live_feed',{action:'frames',since:live.since},{timeoutMs:20000}).then(function(d){var fr=(d.frames||[]).filter(function(f){return f.kind==='main'});if(d.healthy===false&&!fr.length){$('liveLed').className='live-led';$('liveNote').textContent=(d.noHwnd&&!d.captured)?'waiting for the Fusion window (Fusion is launching)':(d._honesty||'feed is not capturing');}if(fr.length){var f=fr[fr.length-1];live.since=Math.max(live.since,f.tick);return frameSrc(f).then(function(src){if(src&&live.on){$('liveImg').src=src;$('liveImg').hidden=false;$('liveLed').className='live-led on';$('liveTick').textContent='frame '+f.tick+' · '+(f.popups?f.popups+' dialog(s) over it':'no dialogs');$('liveNote').textContent=f.title||''}})}}).catch(function(e){$('liveNote').textContent='feed: '+e.message}).then(function(){if(live.on)live.timer=setTimeout(liveTick,1500)})}+function liveStart(){if(live.on)return;live.on=true;live.since=0;$('live').hidden=false;$('liveImg').hidden=true;$('liveLabel').textContent='live · Fusion on this machine';$('liveLed').className='live-led';$('liveTick').textContent='';$('liveNote').textContent='starting the 1 fps capture on this machine...';cmd('fusion_live_feed',{action:'start',intervalSec:1,maxSec:1500}).then(function(){liveTick()}).catch(function(e){$('liveNote').textContent='feed could not start: '+e.message})}+function loadImg(src){return new Promise(function(res){if(!src)return res(null);var im=new Image();im.onload=function(){res(im)};im.onerror=function(){res(null)};im.src=src})}+// Composite what the user's screen shows: the main window plus every owned popup (the Adom+// banner, Fusion's Browser and comment panels, any dialog) at their real screen positions.+function drawLive(main,popups){var cv=$('liveImg');return loadImg(main.src).then(function(mi){if(!mi)return false;var r=main.rect||{};var W=r.width||mi.naturalWidth,H=r.height||mi.naturalHeight;cv.width=mi.naturalWidth;cv.height=mi.naturalHeight;var sx=cv.width/W,sy=cv.height/H;var ctx=cv.getContext('2d');ctx.drawImage(mi,0,0);return Promise.all(popups.map(function(p){return loadImg(p.src).then(function(pi){if(!pi)return;var pr=p.rect||{};var x=(pr.x!=null?pr.x:(pr.left||0))-(r.left||0),y=(pr.y!=null?pr.y:(pr.top||0))-(r.top||0),w=pr.w||pr.width||pi.naturalWidth,h=pr.h||pr.height||pi.naturalHeight;if(w<3||h<3)return;ctx.drawImage(pi,x*sx,y*sy,w*sx,h*sy);ctx.strokeStyle='rgba(0,184,177,.6)';ctx.lineWidth=2;ctx.strokeRect(x*sx,y*sy,w*sx,h*sy)})})).then(function(){return true})})}+function liveTick(){if(!live.on)return;cmd('fusion_live_feed',{action:'frames',since:live.since},{timeoutMs:20000}).then(function(d){var all=d.frames||[];var fr=all.filter(function(f){return f.kind==='main'});if(d.healthy===false&&!fr.length){$('liveLed').className='live-led';$('liveNote').textContent=(d.noHwnd&&!d.captured)?'waiting for the Fusion window (Fusion is launching)':(d._honesty||'feed is not capturing');}if(fr.length){var f=fr[fr.length-1];var pops=all.filter(function(p){return p.kind==='popup'&&p.tick===f.tick});live.since=Math.max(live.since,f.tick);return frameSrc(f).then(function(src){if(!src||!live.on)return;return Promise.all(pops.map(function(p){return frameSrc(p).then(function(ps){return{src:ps,rect:p.rect,title:p.title}})})).then(function(ps){return drawLive({src:src,rect:f.rect},ps.filter(function(p){return p.src}))}).then(function(ok){if(ok&&live.on){$('liveImg').hidden=false;$('liveLed').className='live-led on';var names=pops.map(function(p){return p.title}).filter(function(t){return t&&!/MessageTray/.test(t)});$('liveTick').textContent='frame '+f.tick+' · '+(names.length?names.length+' panel(s)/dialog(s) over it':'no dialogs');$('liveNote').textContent=f.title||''}})})}}).catch(function(e){$('liveNote').textContent='feed: '+e.message}).then(function(){if(live.on)live.timer=setTimeout(liveTick,1500)})} function liveStop(why){if(!live.on)return;live.on=false;clearTimeout(live.timer);$('liveLed').className='live-led';$('liveLabel').textContent='live view ended · '+(why||'');cmd('fusion_live_feed',{action:'stop'}).catch(function(){})} function poll(id){runId=id;clearTimeout(pollTimer);var tick=0;liveStart();(function loop(){tick++;cmd('fusion_prove_result',{runId:id}).then(function(d){var r=d.result||d;var pct=typeof r.percent==='number'?r.percent:null;if(r.stage==='failed'){liveStop('failed');setProg(100,'fail');status($('importStatus'),r.errorCode==='bridge_restarted_mid_run'?'bridge restarted mid-run':'failed','bad');renderFrames(r.evidence);if(r.errorCode==='bridge_restarted_mid_run'){showRestartedMidRun(r);return}setStage('<b>failed</b> '+esc(r.error||(r.bind&&r.bind.error)||r.errorCode||''));toast('Import failed: '+(r.error||(r.bind&&r.bind.error)||'see the log'),'err');return}if(r.stage==='done'){liveStop('done');setProg(100,'done');var pv=r.prove||{};setStage('<b>done</b> verdict: '+esc(r.verdict||(pv.proven?'proven':'not proven'))+' · '+(pv.partsProven||0)+'/'+(pv.partsTotal||r.partsTotal||0)+' parts proven · '+(r.evidenceCount||0)+' frames');status($('importStatus'),r.verdict==='proven'||pv.proven?'proven':'finished, not proven',r.verdict==='proven'||pv.proven?'ok':'warn');if(r.partMetadata)renderLint(r.partMetadata);toast('Library created in Fusion: '+(pv.partsProven||0)+'/'+(pv.partsTotal||0)+' parts proven','ok');return cmd('fusion_prove_result',{runId:id,inlineFrames:true},{timeoutMs:120000}).then(function(d2){var r2=d2.result||d2;renderFrames(r2.evidence||r.evidence)}).catch(function(){renderFrames(r.evidence)})}if(pct!==null)setProg(pct);setStage('<b>'+esc(r.stage||'working')+'</b>'+(r.stageLabel?' · '+esc(r.stageLabel):'')+(pct!==null?' · '+Math.round(pct)+'%':'')+(typeof r.etaSec==='number'?' · ~'+Math.round(r.etaSec)+'s left':''));if(r.evidence&&r.evidence.length)renderFrames(r.evidence);if(r.errorCode==='addin_restart_required'){if(!document.querySelector('[data-ask]'))showAsk(r);liveStop('waiting for your answer')}pollTimer=setTimeout(loop,tick<3?5000:10000)}).catch(function(e){var notYet=e.code==='run_not_found'||e.code==='unknown_run_id'||/no prove run/i.test(e.message||'');var transient=notYet||/error sending request|unreachable|HTTP 0|HTTP 5\d\d|timed out|main_thread_busy/i.test(e.message||'');if(transient&&tick<12){setStage('<b>'+(notYet?'starting (the run is not on file yet)':'bridge not answering, retrying')+'</b> · '+esc((e.message||'').slice(0,90))+' (try '+tick+' of 12)');pollTimer=setTimeout(loop,8000);return}liveStop('poll failed');setProg(100,'fail');setStage('<b>poll failed</b> '+esc(e.message));status($('importStatus'),'poll failed','bad')})})()} function showRestartedMidRun(r){$('stage').innerHTML='<b>the bridge restarted under this run</b> '+esc(r.error||'')+' <button class="btn" data-action="start_again" style="min-height:32px;padding:4px 10px;margin-left:8px">Start again</button>';$('stage').querySelector('[data-action=start_again]').onclick=importBundle;toast('The bridge restarted mid-run (an update or a crash). Press Start again.','err')}@@ -285,7 +289,7 @@ function renderCatalog(){var f=$('catFilter').value.toLowerCase();$('catalog').i // ---- wire up --------------------------------------------------------------------------------- $('btnConnect').onclick=connect;$('btnResolve').onclick=function(){delete $('partRef').dataset.multiStart;resolvePart()};$('tglNoModel').onclick=function(){skipModel=!skipModel;this.className='toggle'+(skipModel?' active':'');this.setAttribute('aria-checked',String(skipModel));if(part)resolvePart()};$('btnShuffle').onclick=shuffle;$('partRef').addEventListener('keydown',function(e){if(e.key==='Enter')resolvePart()}); $('btnFusion').onclick=fusionState;$('btnPlan').onclick=plan;$('btnImport').onclick=importBundle;$('btnAttach').onclick=attachRun;-$('btnFeed').onclick=function(){feed('status')};$('btnFeedStart').onclick=function(){feed('start')};$('btnFeedStop').onclick=function(){feed('stop')};+$('btnFeed').onclick=function(){feed('status')};$('btnFeedStart').onclick=function(){feed('start').then(function(){liveStart()})};$('btnFeedStop').onclick=function(){liveStop('stopped by you');feed('stop')}; $('btnBannerShow').onclick=function(){banner(true)};$('btnBannerHide').onclick=function(){banner(false)}; $('btnDescribe').onclick=describe;$('catFilter').addEventListener('input',renderCatalog); $('btnClear').onclick=function(){$('log').innerHTML='';calls=0;$('logStatus').textContent='0 calls'};
page.json+7−10
@@ -11,10 +11,6 @@     "uninstall": "./uninstall.sh"   },   "tags": [-    "ab",-    "bridge",-    "fusion",-    "desktop-app",     "fusion360",     "autodesk",     "cad",@@ -79,10 +75,7 @@     "build a basic parts library",     "add a 3d model to a component",     "make a fusion 360 library with 3d",-    "set up the fusion bridge",-    "fusion dashboard",-    "fusion status page",-    "open the fusion launch page"+    "set up the fusion bridge"   ],   "discovery_pitch": "Use the Adom Bridge Fusion 360 bridge when the user wants to DRIVE Autodesk Fusion 360 from the cloud: open/search their team's Fusion cloud designs, lay out a PCB or do electronics, export STEP/IGES/STL/Gerbers/BOM, or build a component library with real rendering 3D. It runs Fusion on the user's own machine via Adom Bridge. NOT for web/browser/login/form-filling (that's the native-browser extension) and NOT for KiCad (that's the kicad bridge).",   "brief": "Drive Autodesk Fusion 360 from the cloud via Adom Bridge: component libraries, IPC package generation, board layout, exports (STEP/Gerbers/BOM/CPL), fast APS cloud search, and parametric modeling.",@@ -111,5 +104,9 @@       "label": "Part volume",       "prompt": "How much material does each printed part in this assembly use?"     }-  ]-}+  ],+  "author": {+    "name": "John Lauer",+    "email": "[email protected]"+  }+}\ No newline at end of file