From 953de34610ad7173072be983667386e273e1f784 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 15:07:43 +0700 Subject: [PATCH 01/18] GUI V58: rebase selected-only WIRE onto merged Packet A physical MAIN cable without touching Guardian --- site/preview-v2/index.html | 127 ++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 67 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index e76e1567b..06b45f47f 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -271,7 +271,7 @@ - + @@ -384,7 +384,7 @@
- +
SELECTED ROUTES & QUICK PATCH
Select a channel for IN / OUT
Mode affects new wires only · View never changes audio · GUI reference, no PCM
@@ -609,7 +609,7 @@ } function wireFor(src,dst){return wireEdges.find(e=>e.enabled&&e.sourceId===src&&e.destId===dst);} function outgoingWires(id){return wireEdges.filter(e=>e.enabled&&e.sourceId===id);} -function wireOutgoingCount(id){return outgoingWires(id).length;} +function wireOutgoingCount(id){return outgoingWires(id).filter(e=>e.destId!==master.id).length;} function wireIsCycle(src,dst){ if(src===dst)return true; const candidate={id:nextWireId,sourceId:src,destId:dst,kind:'send',mode:'send',levelDb:0,enabled:true}; @@ -800,17 +800,18 @@ /* Compact WIRE receives/sends: recomputed on DOM render, never in the audio callback. Count only custom intra-mixer paths; direct MAIN stays in I/O. */ function compactWireActivity(t){ - // CH→MAIN is also an actual graph route, not hidden OUT metadata. + // Folded socket LEDs represent only explicit non-MAIN patch cords. + // Keep CH→MAIN in the canonical graph; never let it color either dot. return { - incoming:wireEdges.filter(e=>e.enabled&&e.destId===t.id).length, - outgoing:wireEdges.filter(e=>e.enabled&&e.sourceId===t.id).length + incoming:wireEdges.filter(e=>e.enabled&&e.destId===t.id&&e.destId!==master.id).length, + outgoing:wireEdges.filter(e=>e.enabled&&e.sourceId===t.id&&e.destId!==master.id).length }; } function compactWireSummary(t){ const {incoming,outgoing}=compactWireActivity(t); - const activeIn=incoming>0,activeOut=outgoing>0,connected=activeIn||activeOut; + const activeIn=t.kind!=='master'&&incoming>0,activeOut=outgoing>0,connected=activeIn||activeOut; const title='Expand WIRE · '+t.name+' · '+incoming+' incoming, '+outgoing+ - ' outgoing canonical edges (including MAIN)'; + ' outgoing custom wires · MAIN uses its focused plug'; // 1:1 physical order with the expanded patch: // solid OUT dot LEFT, larger recessed IN circle RIGHT (with small center dot). // Both muted while unused. A channel-hue indicator lights independently @@ -1148,20 +1149,19 @@ const span=Math.abs(x1-x0),ceiling=Math.max(12,Math.min(100,Number(limit)||72)); const sag=Math.max(10,Math.min(ceiling,Math.min(ceiling-5,28+Math.sqrt(span)*1.55))); const c=sag*4/3,progress=Math.max(0,Math.min(1,elapsedMs/1600)); - // V44 geometric witness: 10.5px produced only 4.17px broad visible jolt - // against the approved >5px gate. 13.4 restores a gentle >5px packet, - // still below the retired 13.8px short/fast impulse; 1600ms remains. - const center=.99-progress*.98,amp=13.4*Math.exp(-progress*3.5); + // Stronger pulse travels from receiver IN all the way to source OUT. + // Attenuate continuously towards OUT, while pinning the physical endpoints. + const center=.97-progress*.92,amp=22*Math.exp(-progress*.72); let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); - // Smooth curve samples; zero displacement at both anchored ends. for(let i=1;i<=56;i++){ const t=i/56,u=1-t; const x=u*u*u*x0+3*u*u*t*x0+3*u*t*t*x1+t*t*t*x1; const y=u*u*u*y0+3*u*u*t*(y0+c)+3*u*t*t*(y1+c)+t*t*t*y1; const dx=6*u*t*(x1-x0),dy=3*u*u*c+6*u*t*(y1-y0)+3*t*t*(-c); - const norm=Math.hypot(dx,dy)||1,delta=t-center; - const pulse=amp*Math.exp(-(delta*delta)/(.30*.30))* - Math.sin(delta*10-progress*6)*Math.sin(Math.PI*t); + const delta=t-center,norm=Math.hypot(dx,dy)||1; + const attenuation=.22+.78*t; + const pinned=Math.max(0,Math.min(1,t/.10,(1-t)/.10)); + const pulse=amp*attenuation*pinned*Math.exp(-(delta*delta)/(.19*.19))*Math.cos(delta*11); d+=' L '+(x-dy/norm*pulse).toFixed(1)+' '+(y+dx/norm*pulse).toFixed(1); } return d; @@ -1577,26 +1577,30 @@ layer.style.setProperty('--main-wire-hue',master.color); } function syncMainWireFragments(){ - const selectedSources=selection().filter(t=>t.kind!=='master'); - const focus=armedWireSource()||(selectedSources.length===1?selectedSources[0]:null); + // Canonical CH→MAIN edge stays intact. The measured local SVG fragments from + // Packet A (#376) are displayed ONLY for the uniquely selected channel. + // Collapsing WIRE removes every physical fragment, including at MAIN. + const chosen=selection().filter(t=>t.kind!=='master'); + const focus=chosen.length===1?chosen[0]:null; const selected=focus&&wireFor(focus.id,master.id); for(const t of tracks){ const edge=wireFor(t.id,master.id); const lane=document.querySelector('.strip[data-id="'+t.id+'"]'); - paintMainWireFragment(lane,edge,false); - for(const el of [lane?.querySelector('.wire-node-out'),lane?.querySelector('.wire-fold-summary')]){ - if(!el)continue; - if(edge)el.setAttribute('data-wire-main-edge',String(edge.id)); - else el.removeAttribute('data-wire-main-edge'); - el.style.setProperty('--main-wire-hue',master.color); - } + paintMainWireFragment(lane,edge&&focus?.id===t.id?edge:null,false); + const node=lane?.querySelector('.wire-node-out'); + if(!node)continue; + if(edge)node.setAttribute('data-wire-main-edge',String(edge.id)); + else node.removeAttribute('data-wire-main-edge'); + if(edge&&focus?.id===t.id)node.setAttribute('data-wire-display-focus','true'); + else node.removeAttribute('data-wire-display-focus'); + node.style.setProperty('--main-wire-hue',master.color); } paintMainWireFragment(masterEl,selected,true); - for(const el of [masterEl.querySelector('.wire-node-in'),masterEl.querySelector('.wire-fold-summary')]){ - if(!el)continue; - if(selected)el.setAttribute('data-wire-main-edge',String(selected.id)); - else el.removeAttribute('data-wire-main-edge'); - el.style.setProperty('--main-wire-hue',master.color); + const node=masterEl.querySelector('.wire-node-in'); + if(node){ + if(selected)node.setAttribute('data-wire-main-edge',String(selected.id)); + else node.removeAttribute('data-wire-main-edge'); + node.style.setProperty('--main-wire-hue',master.color); } } function renderWireRouting(){ @@ -1609,8 +1613,11 @@ // Display focus must NOT depend on an armed OUT. A mixer channel being // inspected always reveals its existing INCOMING and OUTGOING cables. // The separate 'focus' remains the only authority for making new routes. + const selectedChannels=selection().filter(t=>t.kind!=='master'); const source=dragging?wireSourceTrack(wireGesture.sourceId): - (focus||selection().find(t=>t.kind!=='master')||null); + (selectedChannels.length===1?selectedChannels[0]:null); + // Patch controls follow armed intent; cable canvas follows selected CH. + const controlSource=focus||source; const legend=document.getElementById('wireLegend'),main=document.getElementById('wireMaster'); if(legend){ const filter=document.getElementById('viewFilter').value; @@ -1620,7 +1627,7 @@ const markup=focus&&!sourceInBank? ''+ 'Click any IN on this bank': - source?wireLegendHtml(source,routes):'Select a channel for IN / OUT'; + controlSource?wireLegendHtml(controlSource,routes):'Select a channel for IN / OUT'; const picker=focus?'CH'+ String(focus.id).padStart(2,'0')+' OUT →'+ '