From f980d584194658f7991bdb051885c255e5c8b1b4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 7 Nov 2026 19:39:30 +0700 Subject: [PATCH 01/19] Pages GUI: sync tested public compiler scripts/approved_fx_rack_power.py --- scripts/approved_fx_rack_power.py | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 scripts/approved_fx_rack_power.py diff --git a/scripts/approved_fx_rack_power.py b/scripts/approved_fx_rack_power.py new file mode 100644 index 000000000..5bbad92d3 --- /dev/null +++ b/scripts/approved_fx_rack_power.py @@ -0,0 +1,32 @@ +"""Approved single-GUI FX rack power semantics, injected at the ONE Pages build. + +The historical V28 source HTML is immutable. Apply exactly TWO audited +semantic substitutions to its JavaScript when assembling both public /preview/ +and native JUCE WebView2. No additional stylesheet, second state store, or +private fork of the mixer. t.fxOn is rack authority, slotBypass[] is the +preserved per-insert preference. Effective = fxOn && !slotBypass[i]. +""" +def apply_authoritative_fx_power(html: str) -> str: + substitutions = [ + ( + "name==='None'?'is-empty':t.slotBypass[i]?'is-bypassed':'is-active'", + "name==='None'?'is-empty':(!t.fxOn||t.slotBypass[i])?'is-bypassed':'is-active'", + ), + ( + 'aria-pressed="\'+Boolean(!t.slotBypass[i])+\'">', + 'aria-pressed="\'+Boolean(t.fxOn&&!t.slotBypass[i])+\'">', + ), + ( + "title=\"'+(t.slotBypass[i]?'Enable':'Bypass')+' only insert", + "title=\"'+(!t.fxOn?'Rack bypassed, saved '+(t.slotBypass[i]?'OFF':'ON'):t.slotBypass[i]?'Enable':'Bypass')+' only insert", + ), + ( + "aria-label=\"'+(t.slotBypass[i]?'Enable':'Bypass')+' only FX insert", + "aria-label=\"'+(!t.fxOn?'Rack bypassed, saved '+(t.slotBypass[i]?'OFF':'ON'):t.slotBypass[i]?'Enable':'Bypass')+' only FX insert", + ), + ] + for before, after in substitutions: + if html.count(before) != 1: + raise ValueError("FX master semantics anchor missing or ambiguous: " + before[:90]) + html=html.replace(before,after,1) + return html From 905595fd80026e3a6a7f135e6344808708dbd4ef Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 7 Nov 2026 19:39:33 +0700 Subject: [PATCH 02/19] Pages GUI: sync tested public compiler scripts/approved_fx_rack_interaction.js --- scripts/approved_fx_rack_interaction.js | 124 ++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 scripts/approved_fx_rack_interaction.js diff --git a/scripts/approved_fx_rack_interaction.js b/scripts/approved_fx_rack_interaction.js new file mode 100644 index 000000000..6525880aa --- /dev/null +++ b/scripts/approved_fx_rack_interaction.js @@ -0,0 +1,124 @@ +// Shared by the one assembled /preview/ and its native bundle. +// Presentation follows the pointer; only accepted native readback moves DSP. +let fxPointerDrag=null,fxPointerFrame=0,fxPointerSuppressUntil=0,fxTransferUndo=null; +function clearFxPointer(){ + if(fxPointerFrame)cancelAnimationFrame(fxPointerFrame);fxPointerFrame=0; + fxPointerDrag?.ghost?.remove();fxPointerDrag?.marker?.remove(); + document.querySelectorAll('.fx-moving').forEach(e=>e.classList.remove('fx-moving')); + fxPointerDrag=null; +} +function removeFxReference(t,slot){ + ensureFxInsertIds(t); + if(!Number.isInteger(slot)||slot<0||t.fx[slot]==='None')return false; + for(const key of ['fx','slotBypass','fxInsertIds']){ + t[key].splice(slot,1);t[key].push(key==='fx'?'None':key==='slotBypass'?false:null); + } + fxReorderUndo=null;fxTransferUndo=null;refreshStrip(t);return true; +} +function undoFxTransfer(t){ + const u=fxTransferUndo;if(!u||window.__JUCE__?.backend||![u.from.id,u.to.id].includes(t.id))return false; + if(fxOrderSignature(u.from)!==u.afterFrom||fxOrderSignature(u.to)!==u.afterTo)return false; + for(const [track,before] of [[u.from,u.beforeFrom],[u.to,u.beforeTo]]) + for(const key of ['fx','slotBypass','fxInsertIds'])track[key]=before[key]; + fxTransferUndo=null;refreshStrip(u.from);refreshStrip(u.to);return true; +} +function moveFxBetween(from,slot,to,position,token){ + ensureFxInsertIds(from);ensureFxInsertIds(to); + if(from.fxInsertIds[slot]?.id!==token||from.fx[slot]==='None')return false; + if(window.__JUCE__?.backend) + return !!window.ArSonFxRackAuthority?.move?.(from.id,slot,to.id,position,token); + if(from===to)return moveReferenceFx(from,slot,position); + const count=to.fx.filter(x=>x!=='None').length; + if(count>=8||position<0||position>count)return false; + const save=t=>({fx:t.fx.slice(),slotBypass:t.slotBypass.slice(),fxInsertIds:clone(t.fxInsertIds)}); + const beforeFrom=save(from),beforeTo=save(to); + for(const key of ['fx','slotBypass','fxInsertIds']){ + const value=from[key].splice(slot,1)[0];from[key].push(key==='fx'?'None':key==='slotBypass'?false:null); + to[key].splice(position,0,value);to[key].pop(); + } + fxTransferUndo={from,to,beforeFrom,beforeTo,afterFrom:fxOrderSignature(from),afterTo:fxOrderSignature(to)}; + refreshStrip(from);refreshStrip(to);say(from.name+' → '+to.name+' · FX moved');return true; +} +function paintFxPointer(){ + fxPointerFrame=0;const g=fxPointerDrag;if(!g?.active)return; + const hit=document.elementFromPoint(g.x,g.y),rack=hit?.closest?.('.fx-section'),track=rack&&findTrack(rack); + let drop=null,mark=null; + if(track){ + const rows=[...rack.querySelectorAll('.fxslot-row:not(.is-empty)')]; + const rect=rack.getBoundingClientRect();let position=rows.length,y=rows.at(-1)?.getBoundingClientRect().bottom||rect.top+25; + for(let i=0;ig.slot?position-1:position; + if(rows.length<8||track.id===g.sourceId){drop={id:track.id,position:final};mark={left:rect.left+3,top:y,width:rect.width-6};} + const list=rack.querySelector('.fxslot-list'),box=list?.getBoundingClientRect(); + if(list&&box&&list.scrollHeight>list.clientHeight) + list.scrollTop+=g.ybox.bottom-18?4:0; + } + g.drop=drop;g.ghost.style.transform='translate3d('+(g.x-g.offsetX)+'px,'+(g.y-g.offsetY)+'px,0)'; + g.ghost.classList.toggle('fx-drop-invalid',!drop); + g.marker.hidden=!mark; + if(mark){g.marker.style.left=mark.left+'px';g.marker.style.top=mark.top+'px';g.marker.style.width=mark.width+'px';} + fxPointerFrame=requestAnimationFrame(paintFxPointer); +} +document.addEventListener('pointerdown',e=>{ + if(e.button!==0)return; + // A fresh gesture must never inherit suppression of the previous drag's click. + fxPointerSuppressUntil=0; + const row=e.target.closest?.('.fxslot-row:not(.is-empty)'); + // POWER and DELETE are never drag initiators, even on touch devices. + if(!row||e.target.closest?.('[data-action="slotPower"],[data-action="removeFx"]'))return; + const t=findTrack(row); + if(!row||!t)return;ensureFxInsertIds(t); + const slot=Number(row.dataset.slot),token=t.fxInsertIds[slot]?.id;if(!token)return; + clearFxPointer();const r=row.getBoundingClientRect(); + fxPointerDrag={pointer:e.pointerId,sourceId:t.id,slot,token,row,x:e.clientX,y:e.clientY,startX:e.clientX,startY:e.clientY, + offsetX:e.clientX-r.left,offsetY:e.clientY-r.top,width:r.width,active:false}; +},true); +window.addEventListener('pointermove',e=>{ + const g=fxPointerDrag;if(!g||e.pointerId!==g.pointer)return; + g.x=e.clientX;g.y=e.clientY; + if(!g.active&&Math.hypot(g.x-g.startX,g.y-g.startY)>=5){ + g.active=true;g.row.classList.add('fx-moving'); + g.ghost=g.row.cloneNode(true);g.ghost.classList.remove('fx-moving');g.ghost.classList.add('fx-drag-ghost');g.ghost.style.width=g.width+'px'; + const originals=[g.row,...g.row.querySelectorAll('*')],copies=[g.ghost,...g.ghost.querySelectorAll('*')]; + for(let i=0;i{n.tabIndex=-1;n.removeAttribute('draggable');}); + g.marker=document.createElement('div');g.marker.className='fx-drop-marker';g.marker.hidden=true; + document.body.append(g.ghost,g.marker);fxPointerFrame=requestAnimationFrame(paintFxPointer); + } + if(g.active)e.preventDefault(); +},true); +window.addEventListener('pointerup',e=>{ + const g=fxPointerDrag;if(!g||e.pointerId!==g.pointer)return; + if(g.active){ + // Resolve the release point even when pointerup preceded the next RAF. + g.x=e.clientX;g.y=e.clientY; + if(fxPointerFrame)cancelAnimationFrame(fxPointerFrame);fxPointerFrame=0;paintFxPointer(); + fxPointerSuppressUntil=performance.now()+350; + const from=tracks.concat(master).find(t=>t.id===g.sourceId),to=tracks.concat(master).find(t=>t.id===g.drop?.id); + if(from&&to)moveFxBetween(from,g.slot,to,g.drop.position,g.token); + e.preventDefault(); + } + clearFxPointer(); +},true); +window.addEventListener('pointercancel',clearFxPointer,true); +window.addEventListener('blur',clearFxPointer); +document.addEventListener('dragstart',e=>{ + if(e.target.closest?.('.fxslot-row:not(.is-empty)')){e.preventDefault();e.stopImmediatePropagation();} +},true); +document.addEventListener('click',e=>{ + if(e.detail!==0&&performance.now(){ + if(e.key==='Escape'&&fxPointerDrag){clearFxPointer();e.preventDefault();e.stopPropagation();} +},true); From 07b417efba6c8cdb3fd85eac06f190cc823253c0 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 7 Nov 2026 19:39:36 +0700 Subject: [PATCH 03/19] Pages GUI: sync tested public compiler scripts/approved_fx_rack_interaction.py --- scripts/approved_fx_rack_interaction.py | 82 +++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 scripts/approved_fx_rack_interaction.py diff --git a/scripts/approved_fx_rack_interaction.py b/scripts/approved_fx_rack_interaction.py new file mode 100644 index 000000000..a6541a5da --- /dev/null +++ b/scripts/approved_fx_rack_interaction.py @@ -0,0 +1,82 @@ +"""Single official /preview/ FX interaction composer; historical V28 stays immutable.""" +from pathlib import Path +ROOT=Path(__file__).resolve().parent + +def once(source, before, after, label): + if source.count(before)!=1: + raise ValueError("FX composer anchor drift: "+label) + return source.replace(before,after,1) + +def apply_fx_rack_interaction(html, assets=None): + start=html.index('function paintMainWireFragment(strip,edge,isMain){') + end=html.index('\nfunction syncMainWireFragments()',start) + html=html[:start]+'''function paintMainWireFragment(strip,edge,isMain){ + strip?.querySelectorAll('.wire-main-fragment').forEach(layer=>layer.remove()); +}'''+html[end:] + anchor='function moveReferenceFx(t,from,to){\n' + html=once(html,anchor,anchor+''' if(window.__JUCE__?.backend){ + ensureFxInsertIds(t); + return !!window.ArSonFxRackAuthority?.move?.(t.id,from,t.id,to,t.fxInsertIds[from]?.id); + } +''',"native MOVE_INSERT bridge") + html=once(html, + "document.querySelector('.strip[data-id=\"'+t.id+'\"] .fx-grip[data-insert-id=\"'+id+'\"]')?.focus();", + "document.querySelector('.strip[data-id=\"'+t.id+'\"] .fxslot-row[data-insert-id=\"'+id+'\"] .fx-pick')?.focus({preventScroll:true});", + "preserve keyboard focus after handle-free reorder") + html=once(html,'Ctrl+Z on grip to undo','Ctrl+Z on FX name to undo', + "retire grip keyboard tooltip") + anchor='function undoReferenceFx(t){\n' + html=once(html,anchor,anchor+' if(undoFxTransfer(t))return true;\n',"transfer undo") + before="const i=Number(btn.dataset.slot);t.fx[i]='None';t.slotBypass[i]=false;if(t.fxInsertIds)t.fxInsertIds[i]=null;fxReorderUndo=null;refreshStrip(t);" + html=once(html,before,"const i=Number(btn.dataset.slot);removeFxReference(t,i);","remove compactly") + + # The whole occupied FX slot is the drag surface. Power and Delete keep + # their native click semantics; there is no extra grab handle or DnD owner. + grip_start="if(name!=='None')out+='':''; + plugEl('fastResults').innerHTML=builtin+'
VST3 PLUGINS
'+(list.length?list.map(p=>""" +PICKER_END=""").join(''):'
No matching effects
';""" +PICKER_END_NEW=""").join(''):'
No matching effects
');""" +PICKER_CLICK=" const btn=e.target.closest('[data-fast-id]');if(btn)insertCatalogPlugin(btn.dataset.fastId);" +PICKER_CLICK_NEW=""" if(e.target.closest('[data-fast-native-eq]')){insertChosenNativeEq();return;} + const btn=e.target.closest('[data-fast-id]');if(btn)insertCatalogPlugin(btn.dataset.fastId);""" +PICKER_ENTER="if(b){e.preventDefault();insertCatalogPlugin(b.dataset.fastId);}" +PICKER_ENTER_NEW="if(b){e.preventDefault();if(b.hasAttribute('data-fast-native-eq'))insertChosenNativeEq();else insertCatalogPlugin(b.dataset.fastId);}" +OPEN=" if(a==='openPlugin'){openFastPicker(t,Number(btn.dataset.slot),btn);return;}" +OPEN_NEW=""" if(a==='openPlugin'){ + const index=Number(btn.dataset.slot); + if(t.fx[index]==='Parametric EQ'){ + window.ArSonMixNativeEq?.open(t,index);return; + } + openFastPicker(t,index,btn);return; + }""" +def apply_native_peq(html: str)->str: + anchors=((PICKER_HEAD,PICKER_FN), + (PICKER_RENDER,PICKER_RENDER_NEW), + (PICKER_END,PICKER_END_NEW), + (PICKER_CLICK,PICKER_CLICK_NEW), + (PICKER_ENTER,PICKER_ENTER_NEW), + (OPEN,OPEN_NEW)) + if html.count('')!=1 or html.count('')!=1 or \ + SCRIPT in html or 'insertChosenNativeEq' in html: + raise ValueError("Parametric EQ requires one pristine approved compiled GUI") + for before,after in anchors: + if html.count(before)!=1: + raise ValueError('Ambiguous approved picker/editor anchor: '+before[:90]) + html=html.replace(before,after,1) + html=html.replace('',SCRIPT+'\n',1) + return html From b7a7e19b92af72a70423a8330601b026712d2ed9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 7 Nov 2026 19:39:42 +0700 Subject: [PATCH 05/19] Pages GUI: sync tested public compiler scripts/compose_operator_ux.py --- scripts/compose_operator_ux.py | 294 +++++++++++++++++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 scripts/compose_operator_ux.py diff --git a/scripts/compose_operator_ux.py b/scripts/compose_operator_ux.py new file mode 100644 index 000000000..a6b8e1242 --- /dev/null +++ b/scripts/compose_operator_ux.py @@ -0,0 +1,294 @@ +"""ArSonMix V29 operator UX composition for the ONE approved public/native console. + +The V28 historical source is byte locked. Apply this intentional, audited +product evolution once to the deployed copy BEFORE Stage C CSS compilation. +This is not an alternate renderer or an extra late stylesheet. +""" +from __future__ import annotations +from pathlib import Path +import re + +CLOSE_ICON = ('') + +SPLIT_BOOTSTRAP = """ +// One console layout authority. CSS percent flex tracks were resolving against +// differing ancestors during WebView2 first show, causing 48:52 and clipped +// faders. Measure the real console once at boot and on actual size/fold changes. +// No timer, PCM access, animation loop, or per-meter layout work. +(function installConsoleSplit(){ + const root=document.querySelector('.console-body'); + if(!root || root.__armixBalancedSplitInstalled)return; + root.__armixBalancedSplitInstalled=true; + let scheduled=false,previous=''; + function update(){ + scheduled=false; + const rail=root.querySelector('.section-rail'); + if(!rail)return; + const h=root.getBoundingClientRect().height; + if(!(h>0))return; + const height=selector=>rail.querySelector(selector)?.getBoundingClientRect().height||0; + const pan=height('.rail-cell.pan'), + switches=height('.rail-cell.switch'), + footer=height('.rail-cell.footer'), + identity=height('.rail-cell.identity'), + route=height('.rail-cell.route'), + send=height('.rail-cell.send'); + // Panels remain equal halves when upper racks are expanded. If all upper + // modules fold, the existing flex fader may use the deliberately freed bay. + const half=Math.round(h/2); + const fader=Math.max(130,Math.round(half-pan-switches-footer)); + const fx=Math.max(125,Math.round(half-identity-route-send)); + const signature=fader+':'+fx; + if(signature===previous)return; + previous=signature; + root.style.setProperty('--v13-fader-h',fader+'px','important'); + root.style.setProperty('--ux-fx-balanced-h',fx+'px','important'); + } + function queue(){ + if(scheduled)return; + scheduled=true;requestAnimationFrame(update); + } + update(); // before first paint, not after operator starts using the mixer + if(window.ResizeObserver)new ResizeObserver(queue).observe(root); + new MutationObserver(queue).observe(root,{attributes:true,attributeFilter:['class']}); + window.addEventListener('resize',queue,{passive:true}); +})(); +""" + +OPERATOR_CSS = """ +/* V29 adaptive 50/50 console, authored for the same rail/strip/Master tokens. + At very short heights preserve minimum usable controls and scroll vertically. */ +.console-pane{overflow-y:auto!important;overflow-x:hidden!important} +.console-body{min-height:610px!important; + --v13-fader-h:max(130px,calc(50% - var(--pan-h) - var(--switch-h) - var(--footer-h)))!important; + --ux-fx-balanced-h:max(125px,calc(50% - var(--identity-h) - var(--route-h) - var(--send-h))); +} +.console-body:not(.collapsed-send):not(.collapsed-fx){min-height:680px!important} +.console-body.collapsed-route{--route-h:23px!important} +.console-body:not(.collapsed-fx) .strip .fx-section, +.console-body:not(.collapsed-fx) .section-rail>.rail-cell.fx{ + height:var(--ux-fx-balanced-h)!important;min-height:var(--ux-fx-balanced-h)!important; + max-height:var(--ux-fx-balanced-h)!important;flex:0 0 var(--ux-fx-balanced-h)!important; +} +.mixer-title{display:none!important} +.window-title{gap:12px!important;overflow:hidden!important} +.window-title .file-name{min-width:0;overflow:hidden;text-overflow:ellipsis} +.window-title .right{margin-left:auto;min-width:0;max-width:48%;overflow:hidden; + text-overflow:ellipsis;white-space:nowrap;color:#90b6c8;font-size:10px;font-weight:400} +.command-bar .mixer-file-tool{display:inline-flex;align-items:center;gap:5px} +.command-bar .mixer-file-tool img{display:block;flex:none;pointer-events:none} +.command-bar #densitySelect,.command-bar [for="densitySelect"],.command-bar #mode{display:none!important} +/* Every console floating editor uses one square Material close key. */ +:is(#pluginClose,#identityClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose){ + box-sizing:border-box!important;flex:0 0 29px!important;width:29px!important; + height:29px!important;min-width:29px!important;min-height:29px!important; + max-width:29px!important;max-height:29px!important;padding:0!important; + display:inline-flex!important;align-items:center!important;justify-content:center!important; + background:#253944!important;border:1px solid #57717f!important;border-radius:3px!important; + color:#d7e6eb!important;line-height:1!important;cursor:pointer!important; +} +:is(#pluginClose,#identityClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose):hover{ + background:#355161!important;color:#fff!important} +:is(#pluginClose,#identityClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose):active{ + background:#962f38!important;border-color:#e6505d!important;color:#fff!important} +:is(#pluginClose,#identityClose,#fastClose,#wireConfigClose,#wireWsClose,#routeChoiceClose) svg{ + width:20px;height:20px;display:block;pointer-events:none} +@media(max-width:1050px){ + .window-title .file-name{max-width:25vw} + .window-title .right{max-width:57%;font-size:9px} +} +@media(max-width:680px){ + .window-title .file-name{display:none!important} + .window-title .right{max-width:72%} +} +""" + +def once(source: str, before: str, after: str, label: str) -> str: + if source.count(before) != 1: + raise ValueError("Operator UX anchor drift: " + label) + return source.replace(before, after, 1) + +def apply_operator_ux(html: str, assets: Path) -> str: + """Evolve only the deployed HTML and two existing CSS owners, fail-closed.""" + html = once(html, + '
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
', + '
Mixer · Reference Session10 audio · 1 bus · master
', + "compact title status") + old_title = re.compile(r'(?m)^
.*id="trackCount".*
\n') + html, count = old_title.subn("", html) + if count != 1: + raise ValueError("Operator UX old mixer status bar drift") + html = once(html, + '