From 1d095931420553fe7a142c838d661b35898b4e46 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 16:35:17 +0700 Subject: [PATCH 01/14] GUI V59: select-scoped MAIN fragments and routes; custom OUT excludes default MAIN --- site/preview-v2/index.html | 117 +++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 63 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index e76e1567b..ae19009cf 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}; @@ -803,14 +803,14 @@ // CH→MAIN is also an actual graph route, not hidden OUT metadata. return { incoming:wireEdges.filter(e=>e.enabled&&e.destId===t.id).length, - outgoing:wireEdges.filter(e=>e.enabled&&e.sourceId===t.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 is the default output'; // 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 @@ -1577,26 +1577,28 @@ 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); - const selected=focus&&wireFor(focus.id,master.id); + // Render the physical MAIN fragments for ONE selected channel only. + // A pinned routing source is a patch action, not selection for cable display. + const selectedChannels=selection().filter(t=>t.kind!=='master'); + const focus=selectedChannels.length===1?selectedChannels[0]:null; + const chosenEdge=focus?wireFor(focus.id,master.id):null; + const folded=document.querySelector('.console-body')?.classList.contains('collapsed-send'); 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); + const edge=wireFor(t.id,master.id),lane=document.querySelector('.strip[data-id="'+t.id+'"]'); + paintMainWireFragment(lane,!folded&&focus?.id===t.id?edge:null,false); + const node=lane?.querySelector('.wire-node-out'); + if(node){ + if(edge)node.setAttribute('data-wire-main-edge',String(edge.id)); + else node.removeAttribute('data-wire-main-edge'); + 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); + paintMainWireFragment(masterEl,!folded?chosenEdge:null,true); + const node=masterEl.querySelector('.wire-node-in'); + if(node){ + if(chosenEdge&&!folded)node.setAttribute('data-wire-main-edge',String(chosenEdge.id)); + else node.removeAttribute('data-wire-main-edge'); + node.style.setProperty('--main-wire-hue',master.color); } } function renderWireRouting(){ @@ -1609,8 +1611,10 @@ // 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); + const controlSource=focus||source; const legend=document.getElementById('wireLegend'),main=document.getElementById('wireMaster'); if(legend){ const filter=document.getElementById('viewFilter').value; @@ -1620,7 +1624,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 →'+ '