Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ jobs:
name: arsonmix-gui-baseline-smoke
path: |
pages-wire-main-1680.png
pages-wire-main-*.png
pages-v51-portrait-meter-1680.png
pages-fader-rollback-console-1680.png
pages-fader-rollback-detail-1680.png
Expand Down
49 changes: 28 additions & 21 deletions site/preview-v2/assets/mixer-wire-dots.css
Original file line number Diff line number Diff line change
Expand Up @@ -936,28 +936,35 @@
box-shadow:inset 0 1px 2px #07141c!important;
}

/* WIRE A2: MAIN-color cable stubs. Source and pinned MAIN consume the SAME
data-wire-main-edge identity. Scoped to the existing WIRE CSS owner.
No new layout box, no cross-bank SVG, no hit area or compositor animation. */
/* Position source stub on the actual 12px OUT PIN, not the wider
caption-bearing button: accurate at every density and browser width. */
.console-body.wire-routing-v15 .strip .wire-tray
.wire-node-out[data-wire-main-edge] .wire-pin{position:relative;overflow:visible}
.console-body.wire-routing-v15 .strip .wire-tray
.wire-node-out[data-wire-main-edge] .wire-pin::after,
.console-body.wire-routing-v15 #master .wire-tray
.wire-node-in[data-wire-main-edge]::before{
content:"";position:absolute;left:calc(50% - 1.25px);width:2.5px;
height:12px;background:var(--main-wire-hue,#a04b65);
border-radius:0 0 4px 4px;box-shadow:1px 0 #09121f,0 0 0 1px #111e29;
pointer-events:none;z-index:1;
/* WIRE A2: two measured, local SVG fragments of one accepted MAIN edge.
Existing WIRE component owns material; jack hitboxes and console geometry
stay untouched. A tiny cubic sag replaces the former straight pseudo-stub. */
.console-body.wire-routing-v15 .strip .send-section.wire-section{
position:relative;
}
.console-body.wire-routing-v15 .strip .wire-tray
.wire-node-out[data-wire-main-edge] .wire-pin::after{top:10px;transform:rotate(-8deg);transform-origin:top center}
.console-body.wire-routing-v15 #master .wire-tray
.wire-node-in[data-wire-main-edge]::before{
top:23px;transform:rotate(8deg);transform-origin:top center;
border-radius:4px 4px 0 0;
.console-body.wire-routing-v15 .strip .wire-main-fragment{
position:absolute;inset:0;width:100%;height:100%;
display:block;overflow:hidden;z-index:2;pointer-events:none;
}
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-shadow,
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-jacket,
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-sheen{
fill:none;stroke-linecap:round;stroke-linejoin:round;
}
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-shadow{
stroke:#061019;stroke-width:5.4;
}
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-jacket{
stroke:var(--main-wire-hue,#a04b65);stroke-width:3.4;
}
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-sheen{
stroke:#ffffff45;stroke-width:.8;opacity:.7;
}
.console-body.wire-routing-v15 .strip .wire-main-fragment .wire-main-plug{
fill:#9eabb2;stroke:#152530;stroke-width:1.3;
}
.console-body.wire-routing-v15.collapsed-send .strip .wire-main-fragment{
display:none;
}
/* Folded 23px WIRE retains two discreet color fragments tied to exact graph IDs.
The accepted V52 fader, V51 meter and V54 jack material remain unchanged. */
Expand Down
57 changes: 47 additions & 10 deletions site/preview-v2/assets/wire-graph-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,21 +141,58 @@
const edges=existingEdges.map(e=>({...e})),seen=new Set(edges.map(edgeKey));
nextId=Math.max(nextId,1,...edges.map(e=>e.id+1));
const names=new Map(channels.map(c=>[c.name,c.id]));
if(names.size!==channels.length)return {ok:false,error:'AMBIGUOUS_LEGACY_NAME'};
const add=(src,dst,kind='send',mode='send',levelDb=0)=>{
if(!validId(src)||!validId(dst)||src===dst||seen.has(src+':'+dst))return;
seen.add(src+':'+dst);
if(!validId(src)||!validId(dst)||src===dst)return 'INVALID_LEGACY_ROUTE';
const key=src+':'+dst;
if(seen.has(key))return 'DUPLICATE_LEGACY_ROUTE';
seen.add(key);
edges.push({id:nextId++,sourceId:src,destId:dst,kind,mode,levelDb,enabled:true});
return null;
};
const importSend=(t,slot)=>{
if(!slot||typeof slot!=='object')return 'INVALID_LEGACY_SEND_SLOT';
if(!slot.sendOn)return null;
if(!names.has(slot.send))return 'UNRESOLVED_LEGACY_SEND';
const gain=Number(slot.sendLevel);
if(!Number.isFinite(gain))return 'INVALID_LEGACY_SEND_GAIN';
return add(t.id,names.get(slot.send),'send','send',Math.max(-60,Math.min(6,gain)));
};
for(const t of channels){
const out=t.output==='Master'?mainId:names.get(t.output);
if(out)add(t.id,out,'primary',out===mainId?'postFader':'routeOnly');
if(Array.isArray(t.sendSlots))for(let i=0;i<t.sendSlots.length;i++){
const slot=i===t.activeSend?t:t.sendSlots[i];
if(slot.sendOn&&names.has(slot.send))add(t.id,names.get(slot.send),'send','send',
Math.max(-60,Math.min(6,Number(slot.sendLevel)||0)));
// A legacy patch that points to a deleted/renamed channel must not
// silently disappear on Show/Scene import. Fail before graph publication.
const output=String(t.output||'');
const out=output==='Master'?mainId:names.get(output);
if(!out&&output&&output!=='None'&&output!=='SOURCE ONLY (No Main)')
return {ok:false,error:'UNRESOLVED_LEGACY_OUTPUT'};
if(out){
const error=add(t.id,out,'primary',out===mainId?'postFader':'routeOnly');
if(error)return {ok:false,error};
}
const slots=Array.isArray(t.sendSlots)?t.sendSlots:[];
if(slots.length){
const active=t.activeSend===undefined?0:t.activeSend;
if(!Number.isSafeInteger(active)||active<0||active>=slots.length)
return {ok:false,error:'INVALID_LEGACY_ACTIVE_SEND'};
for(let i=0;i<slots.length;i++){
// Even the currently selected slot must be structurally valid, although
// its live gain/target are projected from the channel fields.
if(!slots[i]||typeof slots[i]!=='object')
return {ok:false,error:'INVALID_LEGACY_SEND_SLOT'};
const error=importSend(t,i===active?t:slots[i]);
if(error)return {ok:false,error};
}
}else{
// Legacy saves may have one live SEND without the modern 16-slot array.
const error=importSend(t,t);
if(error)return {ok:false,error};
}
const split=/^CH(\d+) (PRE|POST)-FX SPLIT$/.exec(String(t.input||''));
if(split)add(Number(split[1]),t.id,'split',split[2]==='PRE'?'splitPre':'splitPost');
const input=String(t.input||'');
const split=/^CH(\d+) (PRE|POST)-FX SPLIT$/.exec(input);
if(split){
const error=add(Number(split[1]),t.id,'split',split[2]==='PRE'?'splitPre':'splitPost');
if(error)return {ok:false,error};
}else if(/\bSPLIT\b/i.test(input))return {ok:false,error:'UNRESOLVED_LEGACY_SPLIT'};
}
const valid=validateCandidateGraph(channels,mainId,edges);
return valid.ok?{ok:true,edges,nextId}:valid;
Expand Down
49 changes: 49 additions & 0 deletions site/preview-v2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1529,20 +1529,69 @@
return (dot||button).getBoundingClientRect?.()||null;
}
/* One pair of short MAIN-colored stubs is a projection of ONE real edgeId. */
/* One accepted CH→MAIN edge is represented by two local cable fragments.
Physical coordinates are measured from actual sockets; never connect strips
with a long SVG crossing banks or alter the audio graph. */
function paintMainWireFragment(strip,edge,isMain){
const section=strip?.querySelector('.send-section.wire-section');
if(!section)return;
let layer=section.querySelector('.wire-main-fragment');
if(!edge||document.querySelector('.console-body')?.classList.contains('collapsed-send')){
layer?.remove();return;
}
// Pointer-motion repaint must not synchronously remeasure every channel.
// Structural render, bank, density and resize remount the section; a
// changed accepted edgeId invalidates this tiny projection automatically.
if(layer?.dataset.edgeId===String(edge.id))return;
const jack=section.querySelector(isMain?'.wire-node-in .wire-arrow':'.wire-node-out .wire-pin');
const sectionRect=section.getBoundingClientRect(),pin=jack?.getBoundingClientRect();
if(!pin||!sectionRect.width||!sectionRect.height)return;
const x=pin.left+pin.width/2-sectionRect.left;
const y=pin.top+pin.height/2-sectionRect.top;
const lower=Math.min(sectionRect.height-2,Math.max(y+5,sectionRect.height-2));
const dx=Math.min(8,Math.max(3,sectionRect.width*.07));
const start=isMain?[x+dx,lower]:[x,y];
const end=isMain?[x,y]:[x+dx,lower];
const c1=isMain?[start[0],start[1]-Math.max(8,(lower-y)*.65)]:
[start[0],start[1]+Math.max(8,(lower-y)*.65)];
const c2=isMain?[end[0]+dx*.65,end[1]+Math.max(4,(lower-y)*.35)]:
[end[0]+dx*.65,end[1]-Math.max(4,(lower-y)*.35)];
const path='M'+start.map(n=>n.toFixed(2)).join(' ')+
' C'+c1.map(n=>n.toFixed(2)).join(' ')+','+
c2.map(n=>n.toFixed(2)).join(' ')+','+
end.map(n=>n.toFixed(2)).join(' ');
const sig=edge.id+':'+sectionRect.width.toFixed(1)+':'+sectionRect.height.toFixed(1)+':'+path;
if(layer?.dataset.geometry===sig)return;
if(!layer){
layer=document.createElementNS('http://www.w3.org/2000/svg','svg');
layer.setAttribute('class','wire-main-fragment');
layer.setAttribute('aria-hidden','true');
section.appendChild(layer);
}
layer.dataset.geometry=sig;layer.dataset.edgeId=String(edge.id);
layer.setAttribute('viewBox','0 0 '+sectionRect.width+' '+sectionRect.height);
const p=(className,d)=>'<path class="'+className+'" d="'+d+'"/>';
layer.innerHTML=p('wire-main-shadow',path)+p('wire-main-jacket',path)+
p('wire-main-sheen',path)+
'<circle class="wire-main-plug" cx="'+x.toFixed(2)+'" cy="'+y.toFixed(2)+'" r="2.3"/>';
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);
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(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));
Expand Down
98 changes: 97 additions & 1 deletion tests/pages_wire_first_canonical_main_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,91 @@ def drag_to(point,escape=False):
page.locator("#wireWsUndo").click()
assert source.get_attribute("data-wire-main-edge")==original,"Retarget Undo did not restore MAIN"


def audit_visual_matrix(browser):
"""Nine real Chromium renders: viewport, density, focus, collapse, plug."""
for width,height in ((1366,768),(1680,900),(1920,1080)):
for density in ("comfort","standard","compact"):
page=browser.new_page(viewport={"width":width,"height":height},
reduced_motion="reduce")
errors=[]
page.on("pageerror",lambda exc: errors.append(str(exc)))
page.goto(PAGE.as_uri())
page.locator("#densitySelect").select_option(density)
body=page.locator(".console-body")
# Narrow/Compact intentionally locks the WIRE bay folded to keep
# 23px physical geometry. It has graph-bound compact contacts,
# not a full cable overlay; the rail refuses expansion by design.
if density=="compact":
assert "collapsed-send" in (body.get_attribute("class") or "")
initial=edge(page,1,"out")
assert initial and page.locator(
'#tracks .strip[data-id="1"] .wire-fold-summary'
).get_attribute("data-wire-main-edge")==initial
assert page.locator(
'#master .wire-fold-summary'
).get_attribute("data-wire-main-edge")==initial
assert page.locator(".wire-main-fragment").count()==0
page.screenshot(path=str(PAGE.parents[2]/
f"pages-wire-main-{width}x{height}-{density}.png"))
assert not errors,(width,height,density,errors)
page.close()
continue
if "collapsed-send" in (body.get_attribute("class") or ""):
page.locator('.section-rail [data-section="send"]').click()
pair=page.evaluate("""() => {
const src=document.querySelector('#tracks .strip[data-id="1"]');
const main=document.querySelector('#master');
const fragment=src?.querySelector('.wire-main-fragment');
const incoming=main?.querySelector('.wire-main-fragment');
const dot=src?.querySelector('.wire-node-out .wire-pin');
const jack=main?.querySelector('.wire-node-in .wire-arrow');
function position(svg,pin){
if(!svg||!pin)return null;
const r=svg.getBoundingClientRect(),p=pin.getBoundingClientRect();
const c=svg.querySelector('.wire-main-plug');
const x=Number(c?.getAttribute('cx')),y=Number(c?.getAttribute('cy'));
if(!Number.isFinite(x)||!Number.isFinite(y))return null;
return {error:Math.hypot(r.left+x-(p.left+p.width/2),
r.top+y-(p.top+p.height/2)),
bounded:x>0&&x<r.width&&y>0&&y<r.height,
cubic:svg.querySelector('.wire-main-jacket')?.getAttribute('d')?.includes(' C'),
width:r.width,height:r.height};
}
const strips=[...document.querySelectorAll('#tracks .strip')];
return {source:fragment?.dataset.edgeId,main:incoming?.dataset.edgeId,
connected:src?.querySelector('.wire-node-out')?.getAttribute('data-wire-main-edge'),
sourceGeometry:position(fragment,dot),mainGeometry:position(incoming,jack),
sources:strips.filter(x=>x.querySelector('.wire-node-out[data-wire-main-edge]')).length,
painted:strips.filter(x=>x.querySelector('.wire-main-fragment')).length};
}""")
assert pair["source"] and pair["source"]==pair["main"]==pair["connected"],(
width,height,density,"MAIN fragments do not share exact graph edge",pair)
assert pair["sources"]==pair["painted"],(
width,height,density,"one physical MAIN fragment per connected source",pair)
for side in ("sourceGeometry","mainGeometry"):
geom=pair[side]
assert geom and geom["bounded"] and geom["cubic"] and geom["error"]<=1.1,(
width,height,density,side,"misaligned or clipped MAIN plug",geom)
# Selecting CH5 changes the MAIN plug edgeId, not other connections.
page.locator('#tracks .strip[data-id="5"] .strip-identity-top').click()
focused=page.locator('#master .wire-main-fragment').get_attribute("data-edge-id")
assert focused==edge(page,5,"out") and focused!=pair["source"],(
width,height,density,"focused MAIN edge selection")
page.locator('.section-rail [data-section="send"]').click()
assert page.locator('.wire-main-fragment').count()==0,(
width,height,density,"collapsed MAIN fragments not retired")
page.locator('.section-rail [data-section="send"]').click()
assert page.locator('#master .wire-main-fragment').get_attribute("data-edge-id")==focused
page.screenshot(path=str(PAGE.parents[2]/
f"pages-wire-main-{width}x{height}-{density}.png"))
assert not errors,(width,height,density,errors)
page.close()

def run():
with sync_playwright() as pw:
browser=pw.chromium.launch(headless=True)
audit_visual_matrix(browser)
for width in (1366,1680,1920):
page=browser.new_page(viewport={"width":width,"height":900})
errors=[]
Expand All @@ -95,6 +177,20 @@ def run():
control=main_button(page,5)
assert page.locator('#master .wire-node-in').get_attribute("data-wire-main-edge")==initial
assert control.get_attribute("aria-pressed")=="true"
if "collapsed-send" in (page.locator(".console-body").get_attribute("class") or ""):
page.locator('.section-rail [data-section="send"]').click()
# One graph edge paints TWO measured local cubic cables, never a
# cross-bank line. Geometry and edge identity survive all widths.
source_stub=page.locator('#tracks .strip[data-id="5"] .wire-main-fragment')
main_stub=page.locator('#master .wire-main-fragment')
assert source_stub.count()==1 and main_stub.count()==1,(
width,"missing paired physical MAIN cables")
assert source_stub.get_attribute("data-edge-id")==initial
assert main_stub.get_attribute("data-edge-id")==initial
assert " C" in source_stub.locator(".wire-main-jacket").get_attribute("d")
assert " C" in main_stub.locator(".wire-main-jacket").get_attribute("d")
assert page.locator('#tracks .strip[data-id="6"] .wire-main-fragment').count()==1

# Distinct disconnect is reversible and only affects this channel.
control.click()
assert edge(page,5,"out") is None,(width,"MAIN disconnect not real")
Expand Down Expand Up @@ -196,7 +292,7 @@ def run():
assert edge(page,5,"out") is None,"Snapshot SAFE overwrote live MAIN route"
page.close()
browser.close()
print("PASS WIRE A: real Chrome MAIN edgeId, physical plug Escape/unplug/replug/Undo, cycle guard, Scene/SAFE, 3 widths")
print("PASS WIRE A: nine Chromium viewport/density cable audits plus exact-edge MAIN gesture, Scene/SAFE, Undo")

if __name__=="__main__":
run()
Loading
Loading