From 67ad8bd948af4255c83b0b610b2568b0ccfc51ef Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:20:21 +0700 Subject: [PATCH 01/19] refactor(gui): consolidate exact PNG-approved GUI into sole site/preview source --- site/preview-buttons/README.md | 10 - site/preview-buttons/build.json | 66 - site/preview-v2/assets/knob-ICON.svg | 12 - site/preview-v2/assets/mixer-control-keys.css | 358 - site/preview-v2/assets/mixer-control-keys.js | 129 - site/preview-v2/build.json | 70 - site/preview-v2/index.html | 2890 -------- site/preview-v33/build.json | 28 - site/preview-v33/index.html | 5646 --------------- site/preview-v34/assets/knob-ICON.svg | 12 - .../assets/mute-solo-pfl-56x37.png | Bin 11846 -> 0 bytes site/preview-v34/build.json | 30 - site/preview-v34/index.html | 6066 ----------------- .../assets/delete-forever.svg | 0 .../assets/format-hardware-25x15-2x1.png | Bin .../assets/inter-embedded.css | 0 .../assets/micro-hardware-17x17-2x4.png | Bin .../assets/mixer-channel-grid.css | 0 .../assets/mixer-chrome-material.css | 0 .../assets/mixer-console-foundation.css | 0 .../assets/mixer-contextual-buttons.css | 0 .../assets/mixer-contextual-buttons.js | 0 .../assets/mixer-control-keys.css | 0 .../assets/mixer-control-keys.js | 0 .../assets/mixer-fader-assembly.css | 0 .../assets/mixer-fx-rack.css | 0 .../assets/mixer-hardware-artwork.css | 0 .../assets/mixer-meter-display.css | 0 .../assets/mixer-pan-controls.css | 0 .../assets/mixer-plugin-browser.css | 0 .../assets/mixer-section-controls.css | 0 .../assets/mixer-section-layout.css | 0 .../assets/mixer-utility-controls.css | 0 .../assets/mixer-v3-layout-contract.css | 0 .../assets/mixer-wire-dots.css | 0 .../assets/mixer-wire-out-align-v48.css | 0 .../assets/mute-solo-pfl-56x37.png | Bin .../assets/wire-graph-model.js | 0 site/preview/candidate.json | 12 - site/preview/index.html | 2914 +++++++- site/preview/mixer.html | 5302 -------------- site/preview/perf.html | 33 - 42 files changed, 2886 insertions(+), 20692 deletions(-) delete mode 100644 site/preview-buttons/README.md delete mode 100644 site/preview-buttons/build.json delete mode 100644 site/preview-v2/assets/knob-ICON.svg delete mode 100644 site/preview-v2/assets/mixer-control-keys.css delete mode 100644 site/preview-v2/assets/mixer-control-keys.js delete mode 100644 site/preview-v2/build.json delete mode 100644 site/preview-v2/index.html delete mode 100644 site/preview-v33/build.json delete mode 100644 site/preview-v33/index.html delete mode 100644 site/preview-v34/assets/knob-ICON.svg delete mode 100644 site/preview-v34/assets/mute-solo-pfl-56x37.png delete mode 100644 site/preview-v34/build.json delete mode 100644 site/preview-v34/index.html rename site/{preview-v2 => preview}/assets/delete-forever.svg (100%) rename site/{preview-v2 => preview}/assets/format-hardware-25x15-2x1.png (100%) rename site/{preview-v2 => preview}/assets/inter-embedded.css (100%) rename site/{preview-v2 => preview}/assets/micro-hardware-17x17-2x4.png (100%) rename site/{preview-v2 => preview}/assets/mixer-channel-grid.css (100%) rename site/{preview-v2 => preview}/assets/mixer-chrome-material.css (100%) rename site/{preview-v2 => preview}/assets/mixer-console-foundation.css (100%) rename site/{preview-v2 => preview}/assets/mixer-contextual-buttons.css (100%) rename site/{preview-v2 => preview}/assets/mixer-contextual-buttons.js (100%) rename site/{preview-buttons => preview}/assets/mixer-control-keys.css (100%) rename site/{preview-buttons => preview}/assets/mixer-control-keys.js (100%) rename site/{preview-v2 => preview}/assets/mixer-fader-assembly.css (100%) rename site/{preview-v2 => preview}/assets/mixer-fx-rack.css (100%) rename site/{preview-v2 => preview}/assets/mixer-hardware-artwork.css (100%) rename site/{preview-v2 => preview}/assets/mixer-meter-display.css (100%) rename site/{preview-v2 => preview}/assets/mixer-pan-controls.css (100%) rename site/{preview-v2 => preview}/assets/mixer-plugin-browser.css (100%) rename site/{preview-v2 => preview}/assets/mixer-section-controls.css (100%) rename site/{preview-v2 => preview}/assets/mixer-section-layout.css (100%) rename site/{preview-v2 => preview}/assets/mixer-utility-controls.css (100%) rename site/{preview-v2 => preview}/assets/mixer-v3-layout-contract.css (100%) rename site/{preview-v2 => preview}/assets/mixer-wire-dots.css (100%) rename site/{preview-v2 => preview}/assets/mixer-wire-out-align-v48.css (100%) rename site/{preview-buttons => preview}/assets/mute-solo-pfl-56x37.png (100%) rename site/{preview-v2 => preview}/assets/wire-graph-model.js (100%) delete mode 100644 site/preview/candidate.json delete mode 100644 site/preview/mixer.html delete mode 100644 site/preview/perf.html diff --git a/site/preview-buttons/README.md b/site/preview-buttons/README.md deleted file mode 100644 index 097325673..000000000 --- a/site/preview-buttons/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Approved PNG hardware keys — internal build dependency - -This directory owns **only** the approved MUTE/SOLO/PFL assets: -- `assets/mute-solo-pfl-56x37.png` -- `assets/mixer-control-keys.css` -- `assets/mixer-control-keys.js` - -**The only approved product GUI URL is https://masarray.github.io/arsonmix/preview/**. This directory is NOT a second published preview. `scripts/build_pages.py` assembles the current internal mixer source with these PNG-button assets to create **one** `/preview/` page. Legacy `/preview-buttons/` and bare `/preview-v2/` URLs redirect there, never render a different GUI. Do not freeze another HTML copy or replace approved button material with bare-v2 CSS. - -Native Windows WebView2 must embed precisely the same assembled /preview/ GUI. See root AGENTS.md, P0 #389, and `tests/single_preview_publication_contract_test.py`. diff --git a/site/preview-buttons/build.json b/site/preview-buttons/build.json deleted file mode 100644 index e847e7717..000000000 --- a/site/preview-buttons/build.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version": "preview-v45-channel-socket-context-responsive-captions", - "kind": "GUI_REFERENCE_ONLY", - "live_audio": false, - "source_pr": 285, - "baseline_pr": 278, - "source_sha": "ca538ab0c8cd7a99fb9eb068a1139a98e0229fc6", - "source_content_sha": "eb2c7ce417bff987dd746c6dd906ff56af2847b0", - "qa_run": 41472102273, - "qa_conclusion": "success", - "route": "/preview-v2/", - "includes": [ - "FIND across mixer banks", - "ROUTES incoming/outgoing", - "route inspector gain/tap", - "cross-bank source/target", - "destination-first BUS explicit serial/parallel", - "MATRIX", - "WIRE-only Undo", - "Original user SVG knob: dark-gray idle, destination color when plugged", - "V36 visible 3.8px single-cable motion", - "V5 backlit MUTE/SOLO/PFL — semantic LED via single SVG mask", - "V5 cue, phase, FX and SEND toggles (UI reference, no audio)", - "V40 OUT approach light, transient WIRE arm, dark-grey idle IN", - "V40 all-channel click selection including wire-tray, subtle transparent rim", - "V42 one graphite OUT dot turns colored on approach; NO outer glowing circle", - "V42 colored pointer-follower dot on new wires and replug; active magnetic IN socket restored", - "V43 selected channel always shows accepted incoming cables without WIRE arming", - "V43 original dot visibly enlarges only during drag", - "V43 36-frame socket-originated wave travels along accepted wire, one edge only", - "V43 /preview/ publication copies tested WIRE CSS owner, no missing asset", - "V44 docked plug vanishes, dots share rendered wire hue and alpha, captions right, stronger impact and 27px folded row", - "V45 only rendered incoming routes color receiving socket ring by destination channel; idle socket graphite; collision-free caption lanes on dense mixer" - ], - "preserved": "V39 utility controls and Inter, WIRE V36/V37, existing routes/FX/faders/meters; no native audio changes", - "limitations": "Static WIRE GUI reference only; not native PCM/ASIO/VST3 routing", - "routes": [ - "/preview/", - "/preview-v2/", - "/preview-v34/" - ], - "feature_pr": 285, - "source_branch": "design/v34-smart-wire-multipage-20261102", - "ci_run": 41472102273, - "ci_conclusion": "success", - "archive_v33": "/preview-v33/", - "quality_gate": "full PR285 multi-viewport Chromium V15–V34 PASS; main UI-smoke gating before Pages", - "published_from": "Identical V34 HTML content pinned to tested PR #285 source; V33 archived verbatim.", - "svg_asset_sha": "ef56513c68273ef2de351acb413257af7ec45e12", - "wire_motion": "3.8px initial sag, 20-frame gentle settle, only changed cable, no idle RAF", - "wire_knob_fix": "The exact supplied SVG is embedded as data:image/svg+xml;base64 CSS alpha mask so the WIRE knob paints in /preview/, /preview-v2/, offline and CI file:// contexts; physical sizing and audio model unchanged.", - "button_material": "V6 refactored 29px hardware keys: readable ice-white OFF cutouts, context red/yellow/cyan ON", - "button_source": "GUI PR #271 / merged button PR #286", - "preview_qa": "V43 includes generated /preview/ CSS and cross-channel incoming + impact test; engine PCM unchanged", - "css_ownership": "FX rack: mixer-fx-rack.css; Plugin Manager: mixer-plugin-browser.css; controls: V6/V7 owners; Inter: embedded", - "button_control_validation": "Chromium M/S/PFL cross-bank geometry and no fallback CSS interference", - "font": "Embedded Inter variable WOFF2 for all GUI text, including SVG legends and offline Pages", - "utility_controls": "17px FX power/insert, 15px phase and M/ST, 13px FX remove; semantic color by function; no hover animations", - "css_refactor": { - "fx_rack_rules": 61, - "plugin_manager_rules": 26, - "inline_bytes_removed": 9057, - "inline_important_relocated": 118, - "preserved": "WIRE V40 source, routing, plugin behavior and audio contract unchanged" - } -} diff --git a/site/preview-v2/assets/knob-ICON.svg b/site/preview-v2/assets/knob-ICON.svg deleted file mode 100644 index ef56513c6..000000000 --- a/site/preview-v2/assets/knob-ICON.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/site/preview-v2/assets/mixer-control-keys.css b/site/preview-v2/assets/mixer-control-keys.css deleted file mode 100644 index 8dd084432..000000000 --- a/site/preview-v2/assets/mixer-control-keys.css +++ /dev/null @@ -1,358 +0,0 @@ -/* V30 PHYSICAL BUTTON CORRECTION — owner screenshot 2026-11-02. - UI research: Dan Andersson's 3D Buttons CodePen (praktikdan/jbqBWm), - based on Mikael Eidenberg's synth-button concept. Adapted material and - raised-vs-recessed behavior for small mixer strips, not the demo's - mutually exclusive jQuery toggle. Original on/off model is unchanged. - - Core correction from V29: a #333 key ON dark #142832 chassis was too close - in luminance to its bezel; remove tiny black-on-black keycap and glowing - text illusion. Brighter GRAPHITE SATIN cap rests physically ABOVE a static - dark switchplate; latched buttons sit INSIDE the same opening. Narrow - LED seams are IN the depressed face — no diffuse shadow or filter. */ - -/* One stationary shared key well for all three MUTE/SOLO/PFL caps. This - plate and each .hw-switch-socket's overlaid lip NEVER move on click. */ -.console-body .strip .switch-section{ - background:#0b1a22!important; - border-top:1px solid #040e14!important; - border-bottom:1px solid #415764!important; - box-shadow:inset 0 1px #02090d,inset 0 -1px #2c424e!important; -} - - - -/* This one shared satin-material token also styles toolbar and ordinary - rectangular push controls, but never faders, sockets for patch cables, - VU meter or pan thumb. No layered waves or bright-dark-bright cycles. */ -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -){ - --am-key30-led:#6acadd; - position:relative!important; - z-index:2!important; - box-sizing:border-box!important; - border:1px solid #7b929d!important; - border-top-color:#b4c7cf!important; - border-right-color:#263842!important; - border-bottom-color:#1a282f!important; - border-radius:2px!important; - background:linear-gradient(180deg,var(--am-key30-top) 0%,var(--am-key30-bottom) 100%)!important; - color:#f3f8fa!important; - text-shadow:0 -1px 0 #0e1c24!important; - box-shadow:inset 1px 0 0 #d6eff92f,inset 0 1px 0 #ffffff31, - 0 1px 0 #17252d,0 2px 0 #060c10!important; - transform:translateY(0)!important; - filter:none!important;backdrop-filter:none!important; - -webkit-backdrop-filter:none!important; - transition:none!important; -} -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -)::before{ - content:""!important;display:block!important;position:absolute!important; - left:2px!important;right:2px!important;top:0!important;bottom:auto!important; - width:auto!important;height:2px!important; - background:var(--am-key30-hairline)!important; - border:0!important;box-shadow:none!important;pointer-events:none!important; -} -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -)::after{ - content:""!important;display:block!important;position:absolute!important; - left:2px!important;right:2px!important;bottom:0!important;top:auto!important; - width:auto!important;height:1px!important; - background:var(--am-key30-lowline)!important; - border:0!important;box-shadow:none!important;pointer-events:none!important; -} -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -):hover:not(:disabled):not(.on):not(.active):not([aria-pressed="true"]):not([aria-expanded="true"]){ - background:linear-gradient(180deg,var(--am-key30-hover-top),var(--am-key30-hover-bottom))!important; - box-shadow:inset 1px 0 0 #e6f5fa36,inset 0 1px 0 #ffffff39, - 0 1px 0 #17252d,0 2px 0 #060c10!important; -} -/* One color-variable controls the pair of LED seams; keep label readable - even when no accent LED is illuminated. Never use text-shadow glow. */ -:is( - .console-body .strip .switch-section .hw-switch-socket>.switch.on, - .command-bar button.tool.active,.command-bar button.tool[aria-pressed="true"], - .command-bar summary.tool[aria-expanded="true"], - .more-tools[open] summary.tool,.more-tools-panel button.tool.active, - button.hw-key[aria-pressed="true"] -){ - --am-key30-led:#6acadd; - background:linear-gradient(180deg,var(--am-key30-down-top),var(--am-key30-down-bottom))!important; - border:1px solid #09151b!important; - border-top-color:#0a1319!important; - border-left-color:#08121a!important; - border-right-color:#081219!important; - border-bottom-color:#263944!important; - color:#edf8fb!important; - box-shadow:inset 0 2px 1px #000b,inset 1px 0 0 #eaf6ff0d, - inset 0 -1px 0 #b8d8e328!important; - text-shadow:0 1px 0 #000!important; - transform:translateY(1px)!important; -} -:is( - .console-body .strip .switch-section .hw-switch-socket>.switch.on, - .command-bar button.tool.active,.command-bar button.tool[aria-pressed="true"], - .command-bar summary.tool[aria-expanded="true"], - .more-tools[open] summary.tool,.more-tools-panel button.tool.active, - button.hw-key[aria-pressed="true"] -)::before{ - left:0!important;right:auto!important;top:3px!important;bottom:3px!important; - width:2px!important;height:auto!important; - background:linear-gradient(180deg,transparent,var(--am-key30-led) 38%, - var(--am-key30-led) 62%,transparent)!important; -} -:is( - .console-body .strip .switch-section .hw-switch-socket>.switch.on, - .command-bar button.tool.active,.command-bar button.tool[aria-pressed="true"], - .command-bar summary.tool[aria-expanded="true"], - .more-tools[open] summary.tool,.more-tools-panel button.tool.active, - button.hw-key[aria-pressed="true"] -)::after{ - left:auto!important;right:0!important;top:3px!important;bottom:3px!important; - width:2px!important;height:auto!important; - background:linear-gradient(180deg,transparent,var(--am-key30-led) 38%, - var(--am-key30-led) 62%,transparent)!important; -} - - - -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -):active:not(:disabled){ - transform:translateY(1px)!important; - box-shadow:inset 0 2px 1px #000a,inset 0 -1px 0 #cce5f116!important; -} -:is( - .command-bar button.tool,.command-bar summary.tool,.more-tools-panel button.tool, - .console-body .strip .switch-section .hw-switch-socket>.switch, - .identity-actions button.console-control,.plugin-footer button, - .route-choice-head button,.route-choice-option,button.hw-key -):focus-visible{outline:2px solid #80d5ed!important;outline-offset:2px!important} -.command-bar{align-items:center!important;gap:5px!important} -.command-bar .tool,.command-bar .toolbar-select{white-space:nowrap;text-overflow:ellipsis} -.command-bar .toolbar-label{letter-spacing:.04em} -@media(max-width:1400px){.command-bar{gap:3px!important}.command-bar .tool{padding-inline:6px!important}} -@media(prefers-reduced-motion:reduce){ - .console-body.wire-routing-v15 .strip .wire-tray .wire-pot::before{transition:none!important} -} -@media(max-width:1000px){.mixer-title .wire-v34-tool{min-width:30px;padding:0 3px!important}.wire-workspace{right:3px}} - - - -/* ArSonMix mixer hardware keys v6 — SINGLE STYLE OWNER for MUTE / SOLO / PFL. - Standalone device V5 material adapted for 40–48px strip controls. - Only .mx-hw-* elements belong here; NO legacy .switch, .button or - .hw-switch-socket dependencies. No hover paints or CSS filters. - Do not introduce another later inline override. */ -.app .console-body .strip .switch-section.mx-hw-row{ - display:grid!important; - grid-template-columns:repeat(3,minmax(0,1fr))!important; - align-items:center!important; - justify-content:stretch!important; - gap:4px!important; - height:var(--switch-h)!important; - min-height:var(--switch-h)!important; - padding:4px 5px!important; - background:#1a2d38!important; - border-top:1px solid #0a1b24!important; - border-bottom:1px solid #415463!important; - box-shadow:inset 0 1px 0 #ffffff0a!important; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key{ - --mx-hw-led:209,224,231; - position:relative; - display:block; - width:100%; - min-width:0; - max-width:100%; - height:29px; - min-height:29px; - max-height:29px; - box-sizing:border-box; - float:none; - flex:none; - padding:2px; - margin:0; - border:1px solid #0b1a22; - border-radius:6px; - color:transparent; - background:linear-gradient(#09151b,#1f303a); - box-shadow:inset 0 2px 3px rgba(0,0,0,.46),0 1px 0 #61788630; - overflow:hidden; - text-align:center; - text-shadow:none; - letter-spacing:0; - font:inherit; - line-height:normal; - isolation:isolate; - cursor:pointer; - -webkit-tap-highlight-color:transparent; - transition:none; - filter:none; - transform:none; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"]{--mx-hw-led:255,78,90} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="solo"]{--mx-hw-led:255,207,68} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="cue"]{--mx-hw-led:101,210,236} -/* Occluded light escape: partial bottom + weak short sides, no neon perimeter. */ -.app .console-body .strip .mx-hw-row>button.mx-hw-key::before{ - content:""; - display:block; - position:absolute; - inset:1px; - border:0; - border-radius:5px; - box-shadow:none; - width:auto;height:auto; - pointer-events:none; - z-index:2; - opacity:0; - background: - linear-gradient(90deg,transparent 0%, - rgba(var(--mx-hw-led),.02) 20%, - rgba(var(--mx-hw-led),.42) 53%, - rgba(var(--mx-hw-led),.15) 77%,transparent 100%) - center bottom / calc(100% - 12px) 2px no-repeat, - linear-gradient(180deg,transparent 30%,rgba(var(--mx-hw-led),.04) 53%, - rgba(var(--mx-hw-led),.19) 80%,transparent 100%) - left bottom / 1px 100% no-repeat, - linear-gradient(180deg,transparent 46%,rgba(var(--mx-hw-led),.12) 83%, - transparent 100%) - right bottom / 1px 100% no-repeat; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key::after{content:none;display:none} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[aria-pressed="true"]::before{opacity:1} -.app .console-body .strip .mx-hw-row>button.mx-hw-key>.mx-hw-face{ - position:absolute; - inset:2px; - display:block; - width:calc(100% - 4px); - height:calc(100% - 4px); - min-width:0; - max-width:none; - max-height:none; - z-index:1; - pointer-events:none; - overflow:hidden; - transform:none; - transition:none; - filter:none; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key svg .mx-hw-lamp{opacity:0} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp{opacity:1} -.app .console-body .strip .mx-hw-row>button.mx-hw-key:active:not(:disabled)>.mx-hw-face{ - transform:translateY(1px); -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key:focus-visible{ - outline:2px solid #9eddec; - outline-offset:2px; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key:disabled{ - opacity:.45; - cursor:not-allowed; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key:disabled::before, -.app .console-body .strip .mx-hw-row>button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0} -.app .console-body .strip .mx-hw-row>button.mx-hw-key .mx-hw-fallback{ - position:absolute; - inset:0; - display:flex; - align-items:center; - justify-content:center; - color:#d7e3e8; - font:600 10px/1 'ArSonMix Inter',sans-serif; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key .mx-hw-screen-reader{ - position:absolute; - height:1px; - width:1px; - margin:-1px; - padding:0; - overflow:hidden; - clip-path:inset(50%); - white-space:nowrap; -} -@media (prefers-reduced-motion:reduce){ - .app .console-body .strip .mx-hw-row>button.mx-hw-key, - .app .console-body .strip .mx-hw-row>button.mx-hw-key>.mx-hw-face{transition:none} -} - -/* MUTE is rendered entirely from CSS/HTML, NOT owner PNG assets. - The reference 56:37 proportions fit the unchanged 29px click target; - state comes exclusively from aria-pressed, not a JS paint loop. */ -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"]{ - position:relative;display:block;container-type:inline-size; - background:none;border:0;border-radius:0;box-shadow:none; - padding:0;overflow:visible; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"]::before{content:none;display:none} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"]>.mx-mute-face{ - position:absolute;top:50%;left:0;width:100%;aspect-ratio:56 / 37; - transform:translateY(-50%);display:block;isolation:isolate;pointer-events:none; -} -/* OFF silver cap, fine metallic edge and dark recessed lower cavity. */ -.app .console-body .strip .mx-hw-row .mx-mute-face::before{ - content:"";position:absolute;z-index:1; - left:5.35%;right:5.35%;top:5.4%;height:77.5%; - border-radius:13% 13% 8% 8% / 22% 22% 15% 15%; - border:1px solid #777c7e; - background:linear-gradient(180deg,#c4c5c5 0%,#b4b6b7 9%,#aaaeb0 22%,#a3a6a8 74%,#a5a7a9 91%,#888d90 100%); - box-shadow:inset 0 1px 0 #f4f5f58a,inset 1px 0 1px #ffffff42, - inset -1px 0 1px #00000022,inset 0 -2px 2px #12141632, - 0 2px 0 #202123,0 4px 3px #050506b3; -} -.app .console-body .strip .mx-hw-row .mx-mute-legend{ - position:absolute;z-index:3;top:26%;left:0;right:0; - text-align:center;font-size:25cqw;font-weight:600;line-height:1; - letter-spacing:-.04em;color:#29292a;white-space:nowrap; - text-shadow:0 1px 0 #e1e2e282,0 -1px 0 #13151615; -} -/* OFF inset red stripe beneath the dark MUTE legend. */ -.app .console-body .strip .mx-hw-row .mx-mute-lamp{ - position:absolute;z-index:3;left:18%;right:18%;top:67%;height:11%; - border-radius:1px; - background:linear-gradient(180deg,#8d282a 0%,#a63235 22%,#b3393c 52%,#a13132 100%); - box-shadow:0 -1px 0 #5b2427,0 1px 1px #eeeeee9c, - inset 0 1px 1px #4f17196e; -} -/* ON under-face white glint is separate from the red cap's bottom bevel. */ -.app .console-body .strip .mx-hw-row .mx-mute-face::after{ - content:"";position:absolute;left:3%;right:3%;bottom:1px;height:2px; - border-radius:1px;opacity:0; - background:linear-gradient(90deg,#ffffff99 0%,#fff 12%,#fff 88%,#ffffff99 100%); - box-shadow:0 1px 0 #ffffff77; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"][aria-pressed="true"] .mx-mute-face::before{ - background:linear-gradient(180deg,#c94b4b 0%,#be393b 13%,#b73435 35%,#b53434 70%,#b83737 84%,#d04e50 96%,#b33a3a 100%); - border-color:#842727; - box-shadow:inset 0 1px 0 #f38e8d78,inset 1px 0 1px #fa797962, - inset -1px 0 1px #671c1b50,inset 0 -2px 2px #ec78784a, - 0 2px 0 #230607,0 4px 3px #000000bd; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"][aria-pressed="true"] .mx-mute-legend{ - color:#f2e7e7;text-shadow:0 1px 0 #842525,0 -1px 0 #ffffff44; -} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"][aria-pressed="true"] .mx-mute-lamp{display:none} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"][aria-pressed="true"] .mx-mute-face::after{opacity:1} -.app .console-body .strip .mx-hw-row>button.mx-hw-key[data-hw-kind="mute"]:active:not(:disabled)>.mx-mute-face{ - transform:translateY(calc(-50% + 1px)); -} diff --git a/site/preview-v2/assets/mixer-control-keys.js b/site/preview-v2/assets/mixer-control-keys.js deleted file mode 100644 index 4db54dfeb..000000000 --- a/site/preview-v2/assets/mixer-control-keys.js +++ /dev/null @@ -1,129 +0,0 @@ -/* ArSonMix V6 reference mixer tactile keys. One renderer; one CSS owner. - Presentation only: [data-action] and existing mixer state remain authoritative. - No polling, no canvas, no hover animations and no DSP or WIRE changes. */ -(()=>{ - 'use strict'; - const SELECTOR='.console-body .mx-hw-row>button.mx-hw-key'; - const COLORS=Object.freeze({ - mute:'255,78,90',solo:'255,207,68',cue:'101,210,236' - }); - const records=new WeakMap(); - const escapeXml=value=>String(value).replace(/[&<>"']/g,ch=>({ - '&':'&','<':'<','>':'>','"':'"',"'":''' - })[ch]); - let count=0; - const resize=typeof ResizeObserver==='function' - ?new ResizeObserver(entries=>{for(const entry of entries)render(entry.target);}) - :null; - const round=value=>Number(value.toFixed(2)); - function face(legend,w,h,id,color){ - // Viewbox matches physical pixels; NEVER stretch glyphs horizontally. - const rx=Math.min(6,Math.max(3,h*.16)); - const size=Math.max(9.4,Math.min(11.5,h*.49,(w-8)/(.66*legend.length))); - const x=round(w/2),y=round(h*.625),safe=escapeXml(legend); - const width=round(w),height=round(h),radius=round(rx); - const shineL=round(Math.max(4,w*.07)),shineR=round(w-shineL); - return ''; - } - function render(button){ - if(!button.isConnected)return; - const state=records.get(button); - if(!state)return; - const rect=button.getBoundingClientRect(); - if(rect.width<20||rect.height<15)return; - const w=round(rect.width-4),h=round(rect.height-4); - const signature=w+'x'+h+'/'+state.legend; - if(signature===state.signature&&button.querySelector(':scope > svg.mx-hw-face'))return; - state.signature=signature; - button.innerHTML=''+escapeXml(state.legend)+''+ - face(state.legend,w,h,state.id,COLORS[state.semantic]); - } - function upgrade(button){ - if(!(button instanceof HTMLButtonElement))return; - if(!button.matches(SELECTOR))return; - if(records.has(button)){if(button.dataset.hwKind!=='mute')render(button);return;} - const semantic=button.dataset.hwKind; - if(!Object.hasOwn(COLORS,semantic))return; - const legend=({mute:'MUTE',solo:'SOLO',cue:'PFL'})[semantic]; - if(!button.hasAttribute('aria-label'))button.setAttribute('aria-label',legend); - // MUTE uses lightweight DOM + CSS; no SVG, image asset, or resize redraw. - if(semantic==='mute'){ - records.set(button,{semantic,legend}); - button.innerHTML=''+legend+''+ - ''; - return; - } - records.set(button,{id:++count,semantic,legend,signature:null}); - resize?.observe(button); - render(button); - } - function scan(node){ - if(!node||node.nodeType!==1)return; - if(node.matches?.(SELECTOR))upgrade(node); - node.querySelectorAll?.(SELECTOR).forEach(upgrade); - } - const queue=new Set(); - let queued=false; - function update(){ - queued=false; - for(const node of queue)scan(node); - queue.clear(); - } - function install(){ - scan(document.body); - new MutationObserver(entries=>{ - for(const entry of entries){ - for(const node of entry.removedNodes){ - if(node.nodeType!==1)continue; - if(node.matches?.(SELECTOR))resize?.unobserve(node); - node.querySelectorAll?.(SELECTOR).forEach(x=>resize?.unobserve(x)); - } - for(const node of entry.addedNodes){ - if(node.nodeType!==1)continue; - if(!node.matches?.(SELECTOR)&&!node.querySelector?.(SELECTOR))continue; - queue.add(node); - } - } - if(queue.size&&!queued){queued=true;queueMicrotask(update);} - }).observe(document.body,{childList:true,subtree:true}); - } - window.ArSonMixHardwareKeys=Object.freeze({install}); - if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true}); - else install(); -})(); diff --git a/site/preview-v2/build.json b/site/preview-v2/build.json deleted file mode 100644 index 306d9b33c..000000000 --- a/site/preview-v2/build.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": "preview-m1-precision-gain-and-dbfs-meter", - "kind": "GUI_REFERENCE_ONLY", - "live_audio": false, - "source_pr": 285, - "baseline_pr": 278, - "source_sha": "ca538ab0c8cd7a99fb9eb068a1139a98e0229fc6", - "source_content_sha": "eb2c7ce417bff987dd746c6dd906ff56af2847b0", - "qa_run": 41472102273, - "qa_conclusion": "success", - "route": "/preview-v2/", - "includes": [ - "FIND across mixer banks", - "ROUTES incoming/outgoing", - "route inspector gain/tap", - "cross-bank source/target", - "destination-first BUS explicit serial/parallel", - "MATRIX", - "WIRE-only Undo", - "Original user SVG knob: dark-gray idle, destination color when plugged", - "V36 visible 3.8px single-cable motion", - "V5 backlit MUTE/SOLO/PFL — semantic LED via single SVG mask", - "V5 cue, phase, FX and SEND toggles (UI reference, no audio)", - "V40 OUT approach light, transient WIRE arm, dark-grey idle IN", - "V40 all-channel click selection including wire-tray, subtle transparent rim", - "V42 one graphite OUT dot turns colored on approach; NO outer glowing circle", - "V42 colored pointer-follower dot on new wires and replug; active magnetic IN socket restored", - "V43 selected channel always shows accepted incoming cables without WIRE arming", - "V43 original dot visibly enlarges only during drag", - "V43 36-frame socket-originated wave travels along accepted wire, one edge only", - "V43 /preview/ publication copies tested WIRE CSS owner, no missing asset", - "V44 docked plug vanishes, dots share rendered wire hue and alpha, captions right, stronger impact and 27px folded row", - "V45 only rendered incoming routes color receiving socket ring by destination channel; idle socket graphite; collision-free caption lanes on dense mixer", - "V46 exact cable anchor on source pin and centered IN dot, LVL caption and destination-color lit center", - "V47 OUT dot and caption inset together 4px within the OUT grid lane; dot anchor remains physical", - "V48 OUT dot+caption +3px inside same button (4px inset unchanged), caption line-box centered to 12px physical dot", - "M1 shared linear dB calibration for gain, dBFS rulers and simulated meter; 0 dB prominent, major/minor typography polished, PCM engine unchanged" - ], - "preserved": "V39 utility controls and Inter, WIRE V36/V37, existing routes/FX/faders/meters; no native audio changes", - "limitations": "Static WIRE GUI reference only; not native PCM/ASIO/VST3 routing", - "routes": [ - "/preview/", - "/preview-v2/", - "/preview-v34/" - ], - "feature_pr": 285, - "source_branch": "design/v34-smart-wire-multipage-20261102", - "ci_run": 41472102273, - "ci_conclusion": "success", - "archive_v33": "/preview-v33/", - "quality_gate": "full PR285 multi-viewport Chromium V15–V34 PASS; main UI-smoke gating before Pages", - "published_from": "Identical V34 HTML content pinned to tested PR #285 source; V33 archived verbatim.", - "svg_asset_sha": "ef56513c68273ef2de351acb413257af7ec45e12", - "wire_motion": "3.8px initial sag, 20-frame gentle settle, only changed cable, no idle RAF", - "wire_knob_fix": "The exact supplied SVG is embedded as data:image/svg+xml;base64 CSS alpha mask so the WIRE knob paints in /preview/, /preview-v2/, offline and CI file:// contexts; physical sizing and audio model unchanged.", - "button_material": "V6 refactored 29px hardware keys: readable ice-white OFF cutouts, context red/yellow/cyan ON", - "button_source": "GUI PR #271 / merged button PR #286", - "preview_qa": "V43 includes generated /preview/ CSS and cross-channel incoming + impact test; engine PCM unchanged", - "css_ownership": "FX rack: mixer-fx-rack.css; Plugin Manager: mixer-plugin-browser.css; controls: V6/V7 owners; Inter: embedded", - "button_control_validation": "Chromium M/S/PFL cross-bank geometry and no fallback CSS interference", - "font": "Embedded Inter variable WOFF2 for all GUI text, including SVG legends and offline Pages", - "utility_controls": "17px FX power/insert, 15px phase and M/ST, 13px FX remove; semantic color by function; no hover animations", - "css_refactor": { - "fx_rack_rules": 61, - "plugin_manager_rules": 26, - "inline_bytes_removed": 9057, - "inline_important_relocated": 118, - "preserved": "WIRE V40 source, routing, plugin behavior and audio contract unchanged" - } -} diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html deleted file mode 100644 index 7be436edb..000000000 --- a/site/preview-v2/index.html +++ /dev/null @@ -1,2890 +0,0 @@ - - - - - - -ArSonMix — Live Console Reference - - - - - - - - - - - - - - - - - - - - - -
-
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
- -
-
Live Mixer10 audio tracks · 1 bus · master
-
- -
-
-
- - - - - - - - - -
-
StoppedInteractive visual reference. Changes are local to this mockup.SIMULATED METERS · NO REAL AUDIO
-
- - - - - - \ No newline at end of file diff --git a/site/preview-v33/build.json b/site/preview-v33/build.json deleted file mode 100644 index 19f27df3a..000000000 --- a/site/preview-v33/build.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "preview-v33-archived-quiet-wire-any-bank-picker", - "kind": "GUI_REFERENCE_ONLY", - "live_audio": false, - "source_pr": 278, - "source_branch": "design/audition-mixer-reference-isolated-20261101", - "source_sha": "8f903b74078520902221950c23162056da59ca95", - "source_content_sha": "0f259af00566bef9c57a1bdf687cb6e669ff07f5", - "routes": [ - "/preview-v33/" - ], - "ci_run": 41449889699, - "ci_conclusion": "success", - "milestone": "V33: single new cable 1.7px monotonic soft settle, universal keyboard-accessible PATCH TO any bank, explicit persistent source OUT, no hidden-bank fabricated wires, 22x24px steady-size 3D send gain knob.", - "operator_acceptance": "PR278 Chromium run 41449889699 SUCCESS: V15/V18/V19/V22/V26/V29/V30/V31/V32+V33 checks, per-edge animation isolation, CH05→Bus A universal remote picker, 1366/1680/1920 px.", - "owner_geometry": "WIRE collapses to 23px, expands to 160px; FX/PAN/FADER hierarchy preserved", - "hardware_key": "V30 raised satin-steel graphite keycap #738692→#354750 with readable face and crisp 2px sidewall, recessed ON face #27353d→#151e25 with color-specific sharp LED side lines, stationary socket overlaid lip, 1px cap travel; no blur/glow", - "limitations": "GUI-only preview: no native ASIO, PCM or VST3 routing.", - "led_meter": "6px x 9px portrait LED; 2px dark divider, continuous green/yellow/amber/red", - "verification": "Pinned source 8f903b740785, exact HTML blob 0f259af00566, reference CI #41449889699 SUCCESS; standalone HTML GUI only", - "design_reference_pr": 278, - "design_reference_sha": "2a889af659def8b5cbf5511ed24ffb6fe9c583d7", - "wire_visual": "Only newly created per-key SVG path settles with monotonic 1.7px damped sag; settled cables do not move. Source OUT remains pinned, hidden-bank destinations available by PATCH TO, remote endpoints represented by named portal without imaginary cable coordinates.", - "layout_visual": "compact BANK/VIEW/SOF/SNAPSHOT toolbar at 1244px; no label/button overlap; 1px selected border and previous V25 hardware controls preserved", - "fader": "Unified adaptive fader clamp(160px, 100dvh - 584px, 530px): +28px travel area versus V25/V27 across normal viewport range, original chrome thumb retained", - "archive_of": "Former /preview-v2/ V33, preserved at identical HTML blob so V34 publication cannot destroy earlier progress", - "current": false -} diff --git a/site/preview-v33/index.html b/site/preview-v33/index.html deleted file mode 100644 index 0f259af00..000000000 --- a/site/preview-v33/index.html +++ /dev/null @@ -1,5646 +0,0 @@ - - - - - - -ArSonMix — Live Console Reference - - - -
-
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
- -
-
Live MixerCH01 · click destination arrows10 audio tracks · 1 bus · master
-
- -
-
-
- - - - -
-
StoppedInteractive visual reference. Changes are local to this mockup.SIMULATED METERS · NO REAL AUDIO
-
- - - \ No newline at end of file diff --git a/site/preview-v34/assets/knob-ICON.svg b/site/preview-v34/assets/knob-ICON.svg deleted file mode 100644 index ef56513c6..000000000 --- a/site/preview-v34/assets/knob-ICON.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/site/preview-v34/assets/mute-solo-pfl-56x37.png b/site/preview-v34/assets/mute-solo-pfl-56x37.png deleted file mode 100644 index 584fd93a571b61ed7ba05c96619222cbdc7c90c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11846 zcmV-MF1gW(P)zUb|cg6wC zc$gi(X1un?5%1ctjKO$K5+X@pERYb&C?j3ns~b9;?o(C!#|eG9Z}$yCc!b6IeEQSp zRMkoKJoVI*>URX;mdRw&N~zTJV~#Op&tuP?JqRH%#&9HW(KAk)HjPv&#hyKTgk@P? zu~;mHP13+pU^XCaApr1?@b{|U>YiHz+kh1UAe~NM0enkJ+3tCs21H9s3sOo%cw+Q_ zDEq-NK((w9V_7EfV7lYb4IwGjsLz)ygG6{%DzC4~6Bl=67b^K{S5nexgjuVlf3YV z-ur;B3YccV%*kfOO*3b5Qfn(|%ZfWrG-14k%s2)Cni1cOqbz37#C1wa@$%3R-`%l; zt%ZUKiMSiM)fPgeEz9bzR4UAzIg`)ca*LTdbt;vLk0mWE+Y0_Ii4dSQK__d2@B4UC zAcaIoi6sRhB$N!xgYyJJ2&9zpLuzBd7?cW$X*60JjMgY^&{|_mP^YxPXcg20Qc7&w z37EsSaU6$p&N-L4bLVo$9e1#2_ih}==~hamfnfQX(x2 z%d&#~kl|{6$+D<@@;||xkw}l3RO^62ll#%Jsxog>mi*U=^JZnUENN@wvuoF~rBFaZ ztA@O7+qN;r2!Km2T`s!2yT#zZ0Ir(?E8qho4F(IT4blQ>1X3G}C6PuVg+>?)V?Y{- z(H2GujMRV?5H)fXcO!ktx(z|Uf!orC@^{QWR@>q z&OhIC4}h?3+X#>*930p8^e`=z68k+5M@nQ>EP)VJ5tiJaXjwCHTql0(%aX_S`x+Rm zRG5-VaYIj!`F}TTzyvZt+OF$TEEYveOAGVn&7)K*VOcgp2HYg5`xnHVRy~%;@IUy8 z;N`;oxPuZLDuf6|lMtAod2pVIt_i|OgwWM{MM{eh!DNtl7R$CMl}gN;H=mZ47K+89 z$Ye4Ugg_fZT1rlAZ6&W%F!vdQj;ePOhbYn!pgdiY*4)Vid! z0zy(dTCGr{BfP0)No>nP2w8Jk%d#*g&|sw$2w{Uz2oXH64(CCI#%P0Og~LsR3>0#X z_VpNgdjoqa{AoZ&e2}y&lagpOyDh2@=hBAll5Iw_DI3)%o+;v0op|;d0?M&C&jjPL zQmLRl4=F8DX&1+K!ch@)e6dtQV6bh6bUIDBT&AQHsZ^R&%8ef=pU-2A!F5w8?N7rn`5K>m#*K4;@Rz+v{tfr9&tsfyHxK=A#+uC^SkwpqC*c?=E?a{KMKqm<%X-})90Km0J?`ObIf>gvLE10t8pWrl`^Sh{o>*I$1mnQn0PT5b-;Wg<0mxh~ z=vbvtrBcw|b)j5FS1PeMmbqMTjZ!HfVmb|>k_ce54%%vssZ`?Y8l~blky^*sY-Zdi z=0G#%2#mD4d_Irsx@_9GkxHcuLSR`I8(w{t-rim;%c4^8aU2J&6hlKpsL)^zm{m|H z6k^-2r>BRdOP7*Pr&+aX6P}H=}*~t&pp`f?dYK)TFyL^`M2GMlTNeu>8IIp z`|TY2r+>=qkAIx4-~Kkc@3{v%lR~Y7Wml5K8ELc z+;r2QFr#M%0|SE$3=ANp#C2V6xbdS*n>G#4^C%Pw^!4?HV$K{E4N$l)c55r9R3d%K zDTr(qw8m&n+o`9LnmQHf`;=W5Uu(4M;$*XE*NrtqUkI$0mOunM4%=UQjV=G@|6mu3 zoO<4Q*i!PsbI(y!isHI;v`UGU%OSE^UU=>~@(bWR8t4LbKGyo@m*ahTDJ8{HiJ8Y9OIK$X>(;Hsab4D} zTZd&?9Dn@r6bc2Tw8rVc4+L4{N31eR)vp+JY^74+>tFjS|K-d7iQB$#D^EZ56fL=2 zsL*i8gsk^?xTzGo)~=;uS+t&fGXBsI>G|`?%$mjS7hVWlZ=rHgXR_8@PY8jpHB&Mf zPVMeyQAY<>_&#&n+BkL6B#zDH0*x|sJI$Xmg(W>bESWizIh~z>k~9k8CQQJ9*)*wC zisOzyo>$keXJ~McS6*4i>^XCoG^rck_p4fQQj0V7Qd~^P-z0=!@#4jtb=Fy&ea<=b z^z@*V;;@=-S|c+V)RrxjdVA?S^GuXdbe?t^zSbOg=_TA;4qdNRHVdbPvAd#Dl%i28 z1ZAx$Dn(iASo?Kso73;OgHwL?GtT(ee`V@>-%Dk15HSuZV^3_V2s|ze7cS)S#~)?g zy0vWIzMZSDz6RU2Lv=so%xGT_&x6%ygdWvIN_t|9G1#`vN3Oq~sne$6mC6hc4Kgq^ zgp?MlnVR0r_Nw=DCd(`fC!c5Ui!U;7=~C?OZrYYCq4(8Sarf@U*mh`!CR_~(ZMOcp zk&P)6ZA7A+gm>k4t5=gB97MLYA+~J`6qv|V8AYUxpMWAT);-T-&fK}AQfcnL@0SQ6 zShQ#np67)G3S3xIr%ol6O0j^tQh4Pu-IKeSK7Bgt)~(}& z6HcIK=1jJ1*@D&zFcb=TPCxTZ7A{=KQ%^m`;NT$Br%z|~>eUpBMXtH#8nW3O0|N)c zIn%_!+oV6%gwgg=sl-oy{39IKrBo_0XU-fhyy#+l&l|TEYMRV_$+~EY*td2qQO&Ye4B&9$qu6UVmkN~J>!oirezB_%1#Lb@(u=S~K;Z)d@hC2U%= z2DNDua^XT;+r|=tR5r`56)WgmvxbwFEu-y@J1FknP4`)6VKNz>`SFj*4Gtn&TcKPA zz;zr{XzL~CPsg@NrPG}7AN~Uri`bbA2VQ=eUElxy2uH*rjX+CU3=a>pY}rzlUwSEp zVu}6x_jB20mvikk??EY_{{DVu^z`uUZ+{!54drr~vR|gPt&N*+{xd%DiBBQ~IF5s5 zN&5Qw<2g_%jpI0c{Ttr^1BGIda=DBlnEU?gfBT!7Xo)t4QnARvfq^i7_{Qx(DJ4V2 zB0G9}DJq3iEV5J}Snekj8)XcWY@0=?)QDK1Ed;~9Z$A3_-;1JB!%~PF?eU7Bz3bNT)DM1uKQt70 z^6TPure-vVdT)4r{1sCd-!mo|B{cCV$;ts*)_h$yroc)g-{bmdBB&6+(f#cMpC7y(oOFEoq=;2A?H3^&QJQ}cDk zvo?lO!U;{NHHx}uoB;}q3{vYvc{2mujNyr~lQK4*QyOq?OR>PQxz^C5VB*}BsBPq1 zj`CqhhSvh0%ZL~vLIk5QjtWKUclGrnLPpn`Zd-Vs*N`e^0?zD4$Mu~i8iz(loIhF^ zxrs~~)1_g?V7w6oG{#V=RH`zo?#eSJPeGL{SV|$2aX3@=PY`@149q6EF0zeGk~M{? z3FryK$N*nBx_v3wlgZH5-d=NkMD_N*Uul^9`^U5;Nn=M!MX^|9_wLA9#S_d?A?c;v|S#gH7bpTeOCNLBv<{^ixkUcivn&+B?u%RkcuQp=ZqC zj4yr>+qP>Gb%hYf__&%*D8rP)WO{xwu{ZcdNxngjsL|D=qo7__%e29u@hgh{gZ&f= z#Xvg<37pO5IN0CEQ!Ag0qu5HTIMh?pnpcL0dH3YW^p(rlquE$*QcB^dVsi|I%h#GV z*X7CKVM+-5ZkzH&rz1^CO!aM@&#C z6zJ{krBEnD_Y7T)!bGERd$Guu*01NrnKM}wCdkI=^R?M`t#!$^?fu4>NufC>^Z7hOLql(=$vq)0v@u2qA$pZk zrM9-Vt;55^y;|#*Bt1$K2}2!0n+ZpYlyYBNTiaIK^E}VC?Jod#1CszPgb;z7>@D?T zaij-00Nm<%o>wZBdau9!`tSepm%qHFQmLeb5EEKF@Mfm_nnRRX~`uqEr0t_y!W}1$^uZVYyTCzX%p<<< z7ov9pc<{joop-+Touad|Qy+u^}+c@e#4g|SKThFAe zVBw6JxO!nGs)dO0&P9#aaMZ;nQg1Hm+7F!N`(h|gRjXuu zW2N2>6b*bafkN*78gzOS`uT`;G`eDCXLFmrmAV#y#afw015bCw-1pObcweITN;uwGaJ zV+uQLXGw%*Aw_@#AY=pt5&3X6MyX(Zzf!?|^z;3=T>E}l=U40Fg5>kpGt<4R8{2&JcN%(%B{LoyEnUWE&_m*%SSzY5F$tE$1$7NiuL(x2wx*L?1;e^217I2u3>3IeSSnY6`{6FV5nSFkNnJD-NV zCK%^p8FM()#_?S~lB~8R7|vH%a$-A~v_-L`kn$)1IS{d{O^|Y`$y8dKn)QEi+)<1g zQF_zdFOBXSjlgQ?4ID?tneKw40OX)Pf!1g+@fvFrNAr(lH-#a1W+MnzF()L)xIqqT zE|>s3Xxb>e&d3y-a9%akCZC9UYMU4&VFFRnQQ18T9&2L|T2wjz5T(wW?q3qgr56Ta zM%v|LgB;Wp1>z?LI|y?*EvuR!qqT_xxl+oojY0@Jwgm&tG*CiDtlCF}+NTN4jxb-c z;)g&4Bo_5eY)&#E@w72WVG;sI)MY=KI+kwCp3PdAQR*6Bqqc3$dc$x4XcI`F+APBH zfE*;a*RgFJ$E8>*AcQ27&XCDusg%pHyw2uw_`VkV<;2~!Sx&`$W5x^ z1)!D2wjENg#n8|oe#OTCnM|6B@8gxc+HRQu$br!&Ty<;ErkWZVF^LX^iXFP~wE?9K zLRN{ZHAn$g+{WOCWzp?q_)J=dXi#U33`VyY!@#QannQ7CeQwaeDlv22^%l-qsJoMm0y!_G{4jec@TU$FPopd4> zTy!yAon4el#c`!Gj08ETP1Fja+F??Z0owx05)2mtc5od-CIv;$5cOLoE%3@vC`|K&^lnCmTW-8awT96LsBiNPA3h3e#R$%EX(3o z4?MsVk3Yu3MT?j-XAUb?tl-#Lvq-1YXk&QnvB&uCJ@k(xUS1H&pgALHEZbW z>*IqT{9wGs-SfN}44G&h;NZ{@|M(C8z)LT^#GE;EShj2#8#iv`*T4QXn>TOf-+%1m zw70k8dF3%Du10AXkq8wv9uIIVIB-z&^WS)^emPH}SZ3BSY0h1e=H2II!GLYUW2-7W z_FRdLTZd8FF!$INET?aqT#Dw5ki)yb^shH@E%3`Vc(!u~$Pzdljs zckA-(J5Zvt&E?dSTDanTm+9RWUO5=`$$VE6ONa@s4~$msc%H|mO&gii-OZo<*`G6S z{(Ro|{ttxno~FOQpZ|UT{YcB=)1UbaS6+D~mXtjH_~ZQT-~KK4-+w>nop&DH-QBT! zEjfs^)?~9;{`dX&vv%#voPPT0{Ks2wrM<0#d?C+W-@KC*D^{>_<&#`>)zy?Hu(YgJ zCYh1ic9@I$-CyMS)#LrlpVQ6a6X)^hlN;!o)XkNyjnO53^+cI}{K-K)&*PML%qQjA zta@Q1&%Zp(>sPmP-Q`(~HuN4Crd+WxW(t^K1(neO1N09VzWUFDtbXYr)2DWD^5R8o z*u0w`-M5#QUTx=#A8TdWWQ!<8cZ5zd(FLB-YTHaUOM80<+qP}x*=L`@ab0q`7D}Ze z0>Q4GJL&7|WB&a4EL(OyufP5}0PlR~Su9?>m}j4TmQ9;BF=NJz*b7rH?#ksdTefV* zvTQEC_+4Z&S+;E5O84Y$F1YYQR;^mawr$(OWoQ!R>xrv&rZ&&nn7~LL9QJwP<%4vz zTHJo~Ni1F<+5Eu;*m@7>*Lb}be)_8c%3gub{K-<@cWFBU#jjUR=d0g(l>hbc0Ou@8 z(bX2}-y#BvG_fg=as&Z9JX>Z49>KaMjgUVObVG{NWGz`@g@7m)5L_y&!`_gOo}orcIlU@B8t( zgmSseMRT-w^Q6uk;B{{9vE_pRZW>{I0I9Uugob_n+N7MVADGRw~?Fx>kb z1N)xmf>ZW$(!y!%J5Xf(R*mDB$a7b98ekAYQz*f@%?b=$e$iB>x4y`}-D_yKS98Th zU8G!_wVTQe7eLC9&l(+1jDRK(p+kd%ELwCTU-`?w zFpnPL3ra$ZG;qi_ys6ez=YT+yd zbd)HS$~aCA&oi`V^JFs)`wrwOm;KPpse4vq4s8S)g2kEnLV?MXr}CxSZsQZ5_#|3u z9)08yip9W@oXKR^y=M=;^20eU(5?6F+ebE=rK_upC=#~x+(u3faW(zQf?h`{2#xk0pf}cTS+ZMXApT#p?6a-hc;lz^Z4&~{{vH}PiJON58JnIXWzbkTzKJy zq*5s?+vWrBe?NELc_;sT&poVq?m1l7<;53Yq*AHy(HlR?j2ScN?d=VNlpf#y_CJwM zrzsQ*ESP^BS6zK|tgJlu+;jZR-~2b`&705m9oyNuWebZJFXmnEdRG7_6fRw!=m@ON zeN}h6Eun8fv*UG} z!um}^w6{4doZo?0-V?%Z+BmkvmZ0sx#!I`Jla6cUv8Q(M=rcu@9G_$AB*DIZ`0Z19 z^7#@A7tE$5s~OG*idquz&X_~cLJQM4zs5A^7?*Iei_eK+;i`KT5`esIB#Z(4_u;HzO0*-znjOCt6rhEuZxBA z(rn&Q=B4!qSa`xbu6=hmq4qL?x%&6Uef=b6>7vEqdi?X8`B z;-hEt{(tA=S2p4)!)0d=(b0J&_dT?cbzAqNm0`hxdHg?@9LELk*h4-)h?F)ht&^Z= zczJUW6U`SDmfMD=OwQWDUw!Ume)`}{o>{$_6~8Od*4n~#?>m_fEN`bf^%BLB2(-|I zq#&`HYhokN1jMRTD(v398`n(*00yC7&T(ukX~meB2M!#-4!`AKNkM^p?Dqr_FW87; zazV<3iua{uQ7)I+vnLQmfuB%OE(fb}r6otgT}^lbXa zlaV{f5AHzeAgf?_XgBAcFw8lN=Th<)1@1O$2wQDnaIhaKZPIDUKmN^mAZ%oWY>bUj z2T+A|R1D;--*NK?X7MNQISq}Az$a(#r8x8gg;EIb8GBJpor8P?0mr8Z9C-Z|R?SSXMX|bOnYV4@{vE`eF(x zprR!G`!{3BjR+Btre9e|=>)-AQ%k&>z+gQA#|v_>Z`)5ecL~hunH;1fm?#D=Mp7qq zAqZo_RnXCz`6ya1LV$GYpeUki5yZZTqUMpqS+M(ck9!|GG?0TDwOrJe3qV*7;Kob9 zEvt^$Mh6NC=_-Rsuxe~Hfg#-_N^Rn>m1Q|3VIYEgQHSh4B28_i5;IcLFU{1tgNthXrO1N@Qx4&TwmQwb=D~nSZ`_U;Ieg93>zJIvj;tcb2&MD_i*Fb<=pq!WL5L zkg+U@v?P`l?%NV+1z|F22T52_dECa5NGo7eY02;_G$9IMv@}2kl0zwj@x!$s$^>A2 zzCkO4@>P&|?gv@wMro8ENFU_~QmIf>Jo3x{-}%{Iw(az)Nlr%{$U#6v^Tn@jBa;r+ za+sP?C>jmKs)j}rg}RXf)+E2P(eN5E0_#SfQihUO2XY{ea*%^!>8-i`^KFoWF+dK) zxC;-9QaMq@=xvaLw?Ph$R0HX4kb}2D4&I8}Q3rBhhojGbi}};)p8F^TIe=WGp{J#6 zij~$>p*WmG7h>GHk}`%;^{Y6-a5RD(z%&EKoqW8QwDd1X_nd)rGKtQVO>NIcPK!~A z(u~k!d`rHTF{>G9x>BUHa}@_xe2wz{S0lXm-N3E35F%|^R(GXRVdl)4eD;=GOf!&! zAiaX1lXdX574HuWa$rK6&$fe48CYTT|D1EqW$xU$+;PVp?Ag5=$8oxqQfXjVLQVtj z!zL_pe7ntA_j^Kga>dC^*)2?q_k@ zdqib$57Krp!U{E@+E}D$;P7lz*4!~VsvD*npES*mO`T^(p$i9b+K!>?yj#rPUwkqO zp&tbx2VweQT1qlKr=z_ggtUV6ccZIW-li%7M~@kr!=*Pim&zmN`~cQPdqZSqoJQKR zC@F;$M*+w|>}nGNVW$Fl72Ew_jI8OnfS|e>EdE2dV5mBgMk;r@W?$HDjfdrr9^{~2 zL5SjvBD%WJP4tXEteFwqS2d}Kg4bfKw8G{f2T5RqI4#eN)ToRQ@iO5k2Sl_F(}!7NIeN zLcBbzc0?!VB@vg^x2?ZM^1NCCHLp)DPYXn-3{_Q;m;yoqjtO#LVkc^REJJgl3OOQB z;pajlGeT=a#e}9v;#;u3?hf`>mo>3WA_#Y&Yuae$7Z6C&)qEDaHii z%9zAgW(+EX9+5)Vi;cKW073?MGeP!dxE#8!oeV{DbUad41Ps%tKE7t00%@wt^vnc7 z4wP0%t9hH@;bCt5kAG1!!X{6i%%#hhbK!*-GBh;Ar#|(`hUfmvzx2KGj`ofTDtu`7hU|uG;TAVMx(|Eo4k~WJ6IcC z#|zc-IXX~aU*1kzx_bV_f47U*2UYDo#*J6n zWDY!>6Yp2Q_BC?37Vf|QJ|24TK_33~uWJZ+_uY3hY0{(`5qji@aO&n9OEA0J=F3-g z(Vmsu``o~&+@Cz(X#cQB=MH<=J(Wtabm>wadhkI81_o;8y!r^jze(uOnC4}Tl%hoY zb3gYmgZVOle)S1_eEEDna#oIepFJ4Ypa1#au=7A6zDB0!N+SFF;V;aN_rG{=FAuypOykc%9>F41O39QdQ(3-z zITu`b0fl^F#2i?4X#ZPyJ3>c=nRtlrkuS}uIsWc%wt+}DzE?SaSf4p|vY0oKfM5Ii z*Xio)ifzG0Cgzdp^{Aa8YNVd2*Rl<-?aOn|L!0CO};J=ir~5N z{(UbDbKB4Nzu_#6F$rkN(G$~JT3Yz;|MYEyl-LbCHm$9#{Pd?kjlClE-~_F$t$hCn zKfoBmGz%5G(nhSXJpz=NH&&l;%a-$pMX4FL2u%iYYt0B#TVE5^u06M2BaNcm$$)S0 zX_CZ;$dmU?1aO;9AQRlQ8eN?B=M{5r`~?8%X^X;T*v;w}A}qIQeND$_yKp*Z9u5MI zuM_sJTgQL>&CUSWRLCHFnpm1EMx+ST5~`+7B-hu+U!$yT815$tFHD&ZcQ2p5<|1az znlmN`k4sq+k`XIbYpx;59J9FAhI}LS_4ep^o^Lb)ju+(M@1D0|`USLg&PK*usDsdl z2;k@fr*Kdfgh`S&*VWKVa+!64a8a5?!~M_^t%i5<)XE^C@m72Or#Asj0Du$U5 zfdL(1nL*W{j{B}|d2x~{;(b$FAD`ch>#YV(2Xp8k2W8PkYSMg!w1^ULgh+z6S~X?C ze$qE(jTEh+O%`}q1TkEKs78c^43Y0;koqUuj>YRe6p(`ko{jpEP}8xAG=#XVXfkp{ z^O045?uhfn*rRh4LXR8dpl#Yrd{IFYCr3vbdsASqnQq@{<9s>#Ceq$ zID7eJ69zdj#$fy+(Ds%lp7Dz{Ab;ZqIk+ZQ{s04QlqY4`7FJL$dn z`F$g_$?@5P=1mww<5Q@Os$iu%DeZoUlGd@}_s0)%km#mGKGwRLN?&c`hwZ}lOc;FO5YZ<_r9A+TUOK6N%dds z6yqFuc{@kW&yOyAjcF{9jcFJv6o9Wao~{Eq;3x+=6n - - - - - -ArSonMix — Live Console Reference - - - -
-
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
- -
-
Live MixerCH01 · click destination arrows10 audio tracks · 1 bus · master
-
- -
-
-
- - - - - - -
-
StoppedInteractive visual reference. Changes are local to this mockup.SIMULATED METERS · NO REAL AUDIO
-
- - - \ No newline at end of file diff --git a/site/preview-v2/assets/delete-forever.svg b/site/preview/assets/delete-forever.svg similarity index 100% rename from site/preview-v2/assets/delete-forever.svg rename to site/preview/assets/delete-forever.svg diff --git a/site/preview-v2/assets/format-hardware-25x15-2x1.png b/site/preview/assets/format-hardware-25x15-2x1.png similarity index 100% rename from site/preview-v2/assets/format-hardware-25x15-2x1.png rename to site/preview/assets/format-hardware-25x15-2x1.png diff --git a/site/preview-v2/assets/inter-embedded.css b/site/preview/assets/inter-embedded.css similarity index 100% rename from site/preview-v2/assets/inter-embedded.css rename to site/preview/assets/inter-embedded.css diff --git a/site/preview-v2/assets/micro-hardware-17x17-2x4.png b/site/preview/assets/micro-hardware-17x17-2x4.png similarity index 100% rename from site/preview-v2/assets/micro-hardware-17x17-2x4.png rename to site/preview/assets/micro-hardware-17x17-2x4.png diff --git a/site/preview-v2/assets/mixer-channel-grid.css b/site/preview/assets/mixer-channel-grid.css similarity index 100% rename from site/preview-v2/assets/mixer-channel-grid.css rename to site/preview/assets/mixer-channel-grid.css diff --git a/site/preview-v2/assets/mixer-chrome-material.css b/site/preview/assets/mixer-chrome-material.css similarity index 100% rename from site/preview-v2/assets/mixer-chrome-material.css rename to site/preview/assets/mixer-chrome-material.css diff --git a/site/preview-v2/assets/mixer-console-foundation.css b/site/preview/assets/mixer-console-foundation.css similarity index 100% rename from site/preview-v2/assets/mixer-console-foundation.css rename to site/preview/assets/mixer-console-foundation.css diff --git a/site/preview-v2/assets/mixer-contextual-buttons.css b/site/preview/assets/mixer-contextual-buttons.css similarity index 100% rename from site/preview-v2/assets/mixer-contextual-buttons.css rename to site/preview/assets/mixer-contextual-buttons.css diff --git a/site/preview-v2/assets/mixer-contextual-buttons.js b/site/preview/assets/mixer-contextual-buttons.js similarity index 100% rename from site/preview-v2/assets/mixer-contextual-buttons.js rename to site/preview/assets/mixer-contextual-buttons.js diff --git a/site/preview-buttons/assets/mixer-control-keys.css b/site/preview/assets/mixer-control-keys.css similarity index 100% rename from site/preview-buttons/assets/mixer-control-keys.css rename to site/preview/assets/mixer-control-keys.css diff --git a/site/preview-buttons/assets/mixer-control-keys.js b/site/preview/assets/mixer-control-keys.js similarity index 100% rename from site/preview-buttons/assets/mixer-control-keys.js rename to site/preview/assets/mixer-control-keys.js diff --git a/site/preview-v2/assets/mixer-fader-assembly.css b/site/preview/assets/mixer-fader-assembly.css similarity index 100% rename from site/preview-v2/assets/mixer-fader-assembly.css rename to site/preview/assets/mixer-fader-assembly.css diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview/assets/mixer-fx-rack.css similarity index 100% rename from site/preview-v2/assets/mixer-fx-rack.css rename to site/preview/assets/mixer-fx-rack.css diff --git a/site/preview-v2/assets/mixer-hardware-artwork.css b/site/preview/assets/mixer-hardware-artwork.css similarity index 100% rename from site/preview-v2/assets/mixer-hardware-artwork.css rename to site/preview/assets/mixer-hardware-artwork.css diff --git a/site/preview-v2/assets/mixer-meter-display.css b/site/preview/assets/mixer-meter-display.css similarity index 100% rename from site/preview-v2/assets/mixer-meter-display.css rename to site/preview/assets/mixer-meter-display.css diff --git a/site/preview-v2/assets/mixer-pan-controls.css b/site/preview/assets/mixer-pan-controls.css similarity index 100% rename from site/preview-v2/assets/mixer-pan-controls.css rename to site/preview/assets/mixer-pan-controls.css diff --git a/site/preview-v2/assets/mixer-plugin-browser.css b/site/preview/assets/mixer-plugin-browser.css similarity index 100% rename from site/preview-v2/assets/mixer-plugin-browser.css rename to site/preview/assets/mixer-plugin-browser.css diff --git a/site/preview-v2/assets/mixer-section-controls.css b/site/preview/assets/mixer-section-controls.css similarity index 100% rename from site/preview-v2/assets/mixer-section-controls.css rename to site/preview/assets/mixer-section-controls.css diff --git a/site/preview-v2/assets/mixer-section-layout.css b/site/preview/assets/mixer-section-layout.css similarity index 100% rename from site/preview-v2/assets/mixer-section-layout.css rename to site/preview/assets/mixer-section-layout.css diff --git a/site/preview-v2/assets/mixer-utility-controls.css b/site/preview/assets/mixer-utility-controls.css similarity index 100% rename from site/preview-v2/assets/mixer-utility-controls.css rename to site/preview/assets/mixer-utility-controls.css diff --git a/site/preview-v2/assets/mixer-v3-layout-contract.css b/site/preview/assets/mixer-v3-layout-contract.css similarity index 100% rename from site/preview-v2/assets/mixer-v3-layout-contract.css rename to site/preview/assets/mixer-v3-layout-contract.css diff --git a/site/preview-v2/assets/mixer-wire-dots.css b/site/preview/assets/mixer-wire-dots.css similarity index 100% rename from site/preview-v2/assets/mixer-wire-dots.css rename to site/preview/assets/mixer-wire-dots.css diff --git a/site/preview-v2/assets/mixer-wire-out-align-v48.css b/site/preview/assets/mixer-wire-out-align-v48.css similarity index 100% rename from site/preview-v2/assets/mixer-wire-out-align-v48.css rename to site/preview/assets/mixer-wire-out-align-v48.css diff --git a/site/preview-buttons/assets/mute-solo-pfl-56x37.png b/site/preview/assets/mute-solo-pfl-56x37.png similarity index 100% rename from site/preview-buttons/assets/mute-solo-pfl-56x37.png rename to site/preview/assets/mute-solo-pfl-56x37.png diff --git a/site/preview-v2/assets/wire-graph-model.js b/site/preview/assets/wire-graph-model.js similarity index 100% rename from site/preview-v2/assets/wire-graph-model.js rename to site/preview/assets/wire-graph-model.js diff --git a/site/preview/candidate.json b/site/preview/candidate.json deleted file mode 100644 index 51fa4acaa..000000000 --- a/site/preview/candidate.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "kind": "REFERENCE_WORKFLOW_QA_ONLY", - "source_pr": 278, - "source_branch": "main/site/preview-v2", - "source_sha": "bea579a5c5cdc13b8891a7eeff17a27515bde8c8", - "source_blob_sha": "b61273756c2091406125c315ad5b7f27520e969b", - "ci_run": 41459741941, - "ci_conclusion": "success", - "live_audio": false, - "note": "PR285 V34 Smart WIRE is active Pages candidate based on PR278. V33 immutable archive at /preview-v33/. GUI reference ONLY, no native PCM.", - "feature_pr": 285 -} diff --git a/site/preview/index.html b/site/preview/index.html index 4d741972b..7be436edb 100644 --- a/site/preview/index.html +++ b/site/preview/index.html @@ -1,32 +1,2890 @@ - -ArSonMix — Live GUI Preview - - - - + + + + + +ArSonMix — Live Console Reference + + + + + + + + + + + + + + + + + + + + + +
+
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
+ +
+
Live Mixer10 audio tracks · 1 bus · master
+
+ +
+
+
+ + + + + + + + + +
+
StoppedInteractive visual reference. Changes are local to this mockup.SIMULATED METERS · NO REAL AUDIO
+
+ \ No newline at end of file + const raw=window.localStorage?.getItem(PLUGIN_PREFS_KEY);if(!raw)return; + const prefs=JSON.parse(raw),fav=new Set(prefs.favorites||[]),hidden=new Set(prefs.hidden||[]); + pluginCatalog.forEach(p=>{p.favorite=fav.has(p.id);p.hidden=hidden.has(p.id);}); + pluginRecent=Array.isArray(prefs.recent)?prefs.recent.filter(id=>typeof id==='string').slice(0,20):[]; + }catch(error){/* Private browsing / file previews can block storage. */} +} +function savePluginPreferences(){ + try{window.localStorage?.setItem(PLUGIN_PREFS_KEY,JSON.stringify({ + favorites:pluginCatalog.filter(p=>p.favorite).map(p=>p.id), + hidden:pluginCatalog.filter(p=>p.hidden).map(p=>p.id), + recent:pluginRecent + }));}catch(error){/* Manager still works without browser storage. */} +} +const tracksEl=document.getElementById('tracks'),masterEl=document.getElementById('master'),info=document.getElementById('info'); +let nextId=1,nextGroup=1,tracks=[],master,preview=false,meterFrame=0,lastTick=0,clipboard=null,scenes=[],sofEnabled=false,sofTarget="Bus A",wireSourceId=1,wireEdges=[],nextWireId=1,selectedWireEdgeId=null,wireMode='send',wireAnchorId=null,wireHoverId=null,wireGesture=null,wireSuppressClick=false,pendingBusRoute=null,wireView='focus',wireSourcePinned=false,wireIntent=false; +const clone=x=>JSON.parse(JSON.stringify(x)); +const selection=()=>tracks.concat(master).filter(t=>t.selected); +const make=(name,kind,color)=>{ + const id=nextId++; + return {id,name,kind,color,icon:kind==='master'?'◎':kind==='bus'?'⊞':kind==='fx'?'◉':'♩',group:null,safe:false,format:'stereo',input:'None',output:kind==='master'?'Default Output':'Master',fx:Array(8).fill('None'),slotBypass:Array(8).fill(false),fxOn:true,send:'None',sendOn:false,pre:false,sendLevel:-6,sendPan:0,activeSend:0,sendSlots:Array.from({length:16},()=>({send:'None',sendOn:false,pre:false,sendLevel:-6,sendPan:0})),eq:true,pan:0,trim:0,mute:false,solo:false,cue:false,mon:false,phase:false,level:0,meterL:0,meterR:0,clip:false,selected:false}; +}; +function init(){meterPeakHolds.clear();wireWsOpen=false;wireWsDestinationId=null;wireWsInspect=null;wireWsRemoveConfirm=null;wireWsHistory=[];wireWsPendingBefore=null;wireWsEditBefore=null;const ws=document.getElementById('wireWorkspace');if(ws)ws.hidden=true;const cfg=document.getElementById('wireConfigWindow');if(cfg)cfg.hidden=true;document.getElementById('wireConfigToggle').setAttribute('aria-expanded','false');document.getElementById('wireMode').value='send';nextId=1;nextGroup=1;nextDemoFxId=1;fxDrag=null;fxReorderUndo=null;wireSourceId=1;wireEdges=[];selectedWireEdgeId=null;nextWireId=1;wireMode='send';wireView='focus';wireSourcePinned=false;wireIntent=false;document.getElementById('wireView').value='focus';wireAnchorId=null;wireHoverId=null;wireGesture=null;wireSuppressClick=false;pendingBusRoute=null;const choice=document.getElementById('routeChoice');if(choice)choice.hidden=true;document.getElementById('wireMode').value='send';tracks=INIT.map((name,i)=>{const channel=make(name,'audio',COLORS[i]);channel.icon=DEFAULT_ICONS[i]||'♩';if(/^(Host|Interview|Vocal|Guitar)/.test(name)){channel.format='mono';}return channel;});tracks.push(make('Bus A','bus','#7140b5'));master=make('Master','master','#a04b65');tracks[0].fx[0]='Parametric Equalizer';tracks[1].fx[0]='Dynamics Processing';tracks[3].fx[0]='Studio Reverb';const migrated=ArSonWireGraph.migrateLegacy(tracks,master.id); +if(!migrated.ok)throw Error('Invalid initial graph: '+migrated.error); +wireEdges=migrated.edges;nextWireId=migrated.nextId;tracks[0].selected=true;render();} +const escapeHtml=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); +/* Google Material Icons SVG paths, Apache-2.0. Inline/zero font or network requests. */ +const MATERIAL_PATH=Object.freeze({ + // Self-contained Google Material Icons paths (no font/network dependency). + delete:'M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z', + // Exact Google Material "delete_forever" path supplied by the user; no redrawing. + delete_forever:'M9.4,16.5L12,13.9l2.6,2.6L16,15.1l-2.6-2.6L16,9.9L14.6,8.5L12,11.1L9.4,8.5L8,9.9l2.6,2.6L8,15.1l1.4,1.4ZM7,21q-0.82,0-1.41-0.59T5,19V6H4V4H9V3h6V4h5V6H19V19q0,0.82-0.59,1.41T17,21H7ZM17,6H7V19H17V6ZM7,6V19V6Z', + swap_horiz:'M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z', + power_settings_new:'M13 3h-2v10h2V3zm4.83 2.17-1.42 1.42C17.99 7.88 19 9.82 19 12c0 3.87-3.13 7-7 7s-7-3.13-7-7c0-2.18 1.01-4.12 2.59-5.41L6.17 5.17C4.23 6.82 3 9.27 3 12c0 4.97 4.03 9 9 9s9-4.03 9-9c0-2.73-1.23-5.18-3.17-6.83z', + close:'M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z', + drag_indicator:'M11 5h2v2h-2zm0 6h2v2h-2zm0 6h2v2h-2zM5 5h2v2H5zm0 6h2v2H5zm0 6h2v2H5z', + view_quilt:'M3 5v14h18V5H3zm8 12H5V7h6v10zm8 0h-6v-4h6v4zm0-6h-6V7h6v4z', + play_arrow:'M8 5v14l11-7z', + radio_button_checked:'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm0-13a5 5 0 1 0 0 10 5 5 0 0 0 0-10z', + call_split:'M14 4v3.46l3.88 3.88-1.42 1.42L13 9.3V4h1zm-4 0v5.3l-3.46 3.46-1.42-1.42L9 7.46V4h1zm1 5h2v11h-2V9z', + star:'m12 17.27 5.18 3.13-1.64-7.03L21 8.64l-7.19-.61L12 1.5 10.19 8.03 3 8.64l5.46 4.73-1.64 7.03z', + visibility_off:'M2 4.27 3.28 3l18 18-1.28 1.27-3.22-3.22A11.9 11.9 0 0 1 12 20C7 20 2.73 16.89 1 12c.73-2.08 2.02-3.89 3.7-5.28L2 4.27zM12 6c5 0 9.27 3.11 11 8a12.08 12.08 0 0 1-3.11 4.57l-2.09-2.09a6 6 0 0 0-8.28-8.28L7.43 6.11A11.7 11.7 0 0 1 12 6z', + visibility:'M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zm0 12.5a5 5 0 1 1 0-10 5 5 0 0 1 0 10zm0-2a3 3 0 1 0 0-6 3 3 0 0 0 0 6z' +}); +const materialIcon=(name)=>''; +const option=(values,selected)=>values.map(x=>'').join(''); +// DEMO mult is a source binding, not a Group sum or copied JS audio engine. +// Production must supply stable native ChannelId/TapPoint admission + ACK. +const splitSourceLabel=(id,tap)=>'CH'+String(id).padStart(2,'0')+' '+tap+'-FX SPLIT'; +function parseSplitSource(value){ + const match=/^CH(\d+) (PRE|POST)-FX SPLIT$/.exec(String(value||'')); + return match?{sourceId:Number(match[1]),tap:match[2]}:null; +} +function splitWouldCycle(target,sourceId){ + const seen=new Set([target.id]); + let id=sourceId; + while(Number.isInteger(id)){ + if(seen.has(id))return true; + seen.add(id); + const upstream=tracks.find(x=>x.id===id&&x.kind==='audio'); + if(!upstream)return true; + const link=parseSplitSource(upstream.input); + if(!link)return false; + id=link.sourceId; + } + return true; +} +function splitFanout(t){ + return tracks.filter(x=>x.id!==t.id&&parseSplitSource(x.input)?.sourceId===t.id).length; +} +const channelOptions=(t,type)=>{ + if(type==='input')return t.kind==='audio' + ?['None','Input 1 (Mono)','Input 2 (Mono)','Input 1 + 2 (Stereo)','CABLE Output L','CABLE Output R','CABLE Output L/R (Stereo)', + ...tracks.filter(x=>x.kind==='audio'&&x.id!==t.id).flatMap(x=> + [splitSourceLabel(x.id,'PRE'),splitSourceLabel(x.id,'POST')])] + :['None']; + if(type==='output')return t.kind==='master'?['Default Output','Output 1 + 2','Speakers (Realtek)','Virtual Cable']:[...(t.kind==='audio'?['SOURCE ONLY (No Main)']:[]),master.name,...tracks.filter(x=>x.kind==='bus'&&x.id!==t.id).map(x=>x.name),'Output 1 + 2']; + return ['None',...tracks.filter(x=>(x.kind==='bus'||x.kind==='fx')&&x.id!==t.id).map(x=>x.name)]; +}; +/* V53: demo-only insert identity, one reversible transaction per real move. + Native WebView2 FX order requires graphRevision/requestId/deviceEpoch ACK instead. */ +let nextDemoFxId=1,fxDrag=null,fxReorderUndo=null; +function ensureFxInsertIds(t){ + if(!Array.isArray(t.fxInsertIds))t.fxInsertIds=Array(t.fx.length).fill(null); + for(let i=0;i=t.fx.length||to>=t.fx.length|| + t.fx[from]==='None'||t.fx[to]==='None')return false; + const before={fx:t.fx.slice(),slotBypass:t.slotBypass.slice(),fxInsertIds:clone(t.fxInsertIds)}; + const id=t.fxInsertIds[from].id; + for(const key of ['fx','slotBypass','fxInsertIds']){ + const entry=t[key].splice(from,1)[0];t[key].splice(to,0,entry); + } + fxReorderUndo={channelId:t.id,before,after:fxOrderSignature(t)}; + refreshStrip(t); + document.querySelector('.strip[data-id="'+t.id+'"] .fx-grip[data-insert-id="'+id+'"]')?.focus(); + say(t.name+' · FX order '+(from+1)+' → '+(to+1)+' · GUI reference (Ctrl+Z on grip to undo)'); + return true; +} +function undoReferenceFx(t){ + if(!fxReorderUndo||fxReorderUndo.channelId!==t.id|| + fxOrderSignature(t)!==fxReorderUndo.after)return false; + const previous=fxReorderUndo.before; + t.fx=previous.fx;t.slotBypass=previous.slotBypass;t.fxInsertIds=previous.fxInsertIds; + fxReorderUndo=null; + refreshStrip(t); + say(t.name+' · FX reorder undone · GUI reference'); + return true; +} +function sectionFx(t){ + ensureFxInsertIds(t); + const used=t.fx.map((name,i)=>({name,i})).filter(x=>x.name!=='None'); + const first=t.fx.findIndex(x=>x==='None'); + const rows=used.concat(first<0?[]:[{name:'None',i:first}]); + let out='
fxFX '+used.length+'
'; + for(const {name,i} of rows){ + out+='
'+ + (name==='None'?'': + ''); + out+=''; + if(name!=='None')out+=''; + out+='
'; + } + return out+'
'; +} + +/* ONE deterministic reference graph. OUTPUT is a compatibility projection, + not an independent PCM route. Native owns actual graph ACK and audio. */ +function syncWireOutputProjection(){ + for(const t of tracks){ + const primary=wireEdges.find(e=>e.enabled&&e.sourceId===t.id&&e.kind==='primary'); + const dest=primary&&tracks.concat(master).find(x=>x.id===primary.destId); + t.output=dest?dest.kind==='master'?'Master':dest.name:'SOURCE ONLY (No Main)'; + } +} +function wireGraphCommit(ops,{record=true}={}){ + const before=record?wireWsSnapshot():null; + const result=ArSonWireGraph.applyWireTransaction({ + channels:tracks,mainId:master.id,edges:wireEdges,nextId:nextWireId + },ops); + if(!result.ok){say('ROUTING GUARDIAN: '+result.error+' · graph unchanged');return false;} + wireEdges=result.edges;nextWireId=result.nextId; + if(selectedWireEdgeId!==null&&!wireEdges.some(e=>e.id===selectedWireEdgeId))selectedWireEdgeId=null; + syncWireOutputProjection(); + if(record)wireWsRecord(before); + return true; +} +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).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}; + const result=ArSonWireGraph.validateCandidateGraph(tracks,master.id, + [...wireEdges.filter(e=>e.sourceId!==src||e.destId!==dst),candidate]); + return !result.ok&&result.error==='FEEDBACK_CYCLE'; +} +function hasLegacySendTo(){return false;} // old slots migrated, never a second graph +function wireSourceTrack(id){return tracks.find(t=>t.id===id&&t.kind!=='master');} +// Transient WIRE source focus is separate from mixer-channel selection. + // Clearing this tool never alters a committed route or native audio state. +function clearWireIntent(){ + if(!wireIntent&&!wireSourcePinned)return; + wireIntent=false;wireSourcePinned=false;wireSourceId=null; + wireAnchorId=null;wireHoverId=null; + refreshWireRoutingNodes(); +} +function selectWireSource(t){ + if(!t||t.kind==='master')return false; + wireSourceId=t.id;wireSourcePinned=true;wireIntent=true;wireAnchorId=null;wireHoverId=null; + tracks.forEach(x=>x.selected=x.id===t.id);master.selected=false; + render();say('SOURCE '+t.name+' · drag solid OUT → hollow IN, or click an IN jack · GUI DEMO'); + return true; +} +function closeRouteChoice(){pendingBusRoute=null;wireWsPendingBefore=null;const p=document.getElementById('routeChoice');if(p)p.hidden=true;} +function showRouteChoice(source,dest,anchor){ + if(!source||!dest||dest.kind!=='bus')return false; + if(hasLegacySendTo(source,dest)){say('BUS ROUTE BLOCKED: hidden legacy SEND to '+dest.name+' · migrate legacy path first');return false;} + if(wireIsCycle(source.id,dest.id)){say('BUS ROUTE REJECTED: feedback path');return false;} + pendingBusRoute={sourceId:source.id,destId:dest.id}; + const p=document.getElementById('routeChoice');if(!p)return false; + document.getElementById('routeChoiceTitle').textContent='ROUTE '+source.name+' → '+dest.name; + document.getElementById('routeChoiceDescription').textContent='Choose a serial route through '+dest.name+' only, or keep your current primary output plus a parallel send.'; + p.hidden=false; + const a=anchor?.getBoundingClientRect?.(),r=document.querySelector('.console-pane')?.getBoundingClientRect?.(); + if(a&&r&&p.style?.setProperty){ + p.style.setProperty('left',Math.max(8,Math.min(r.width-292,a.left-r.left-100))+'px'); + p.style.setProperty('top',Math.max(8,Math.min(r.height-205,a.top-r.top-191))+'px'); + } + say('Bus routing choice required · no graph change until VIA BUS ONLY or PARALLEL is selected'); + return true; +} +function commitRouteChoice(kind){ + const p=pendingBusRoute,source=p&&wireSourceTrack(p.sourceId),dest=p&&tracks.find(t=>t.id===p.destId); + if(!source||!dest){closeRouteChoice();return false;} + const type=kind==='only'?'ROUTE_ONLY':kind==='parallel'?'CONNECT':null; + if(!type)return false; + const ok=wireGraphCommit([{type,sourceId:source.id,destId:dest.id}]); + closeRouteChoice();if(!ok)return false; + render();kickWireSpring(source.id,dest.id); + say(source.name+' → '+dest.name+' · '+(kind==='only'?'ROUTE ONLY':'PARALLEL SEND')+' · reference only'); + return true; +} +function requestWireConnection(source,dest,anchor){ + if(!source||!dest||source.id===dest.id)return false; + const existing=wireFor(source.id,dest.id); + if(existing){selectWireEdge(existing);return true;} + if(dest.kind==='master'){ + if(!wireGraphCommit([{type:'CONNECT',sourceId:source.id,destId:master.id}]))return false; + render();say(source.name+' → MAIN connected · reference only');return true; + } + if(dest.kind==='bus')return showRouteChoice(source,dest,anchor); + return wireConnect(source,dest); +} +function wireConnect(source,dest){ + if(!source||source.kind==='master'||!dest||dest.kind==='master'||source.id===dest.id)return false; + const old=wireFor(source.id,dest.id); + if(old){selectWireEdge(old);return true;} + if(!wireGraphCommit([{type:'CONNECT',sourceId:source.id,destId:dest.id,mode:wireMode}]))return false; + render();kickWireSpring(source.id,dest.id); + say('WIRE '+source.name+' → '+dest.name+' · reference graph, no JS PCM');return true; +} + +/* Atomic V18 wire replug: preserve the same edge id, gain, mode, and tap. + Existing graph is untouched on illegal destinations or canceled gestures. */ +function replugWireEdge(sourceId,oldDestId,nextDestId){ + const edge=wireFor(sourceId,oldDestId); + if(!edge||!wireSourceTrack(sourceId)){say('WIRE REPLUG: stale edge; graph kept');return false;} + if(nextDestId===oldDestId)return true; + const op=nextDestId===null?{type:'REMOVE',sourceId,edgeId:edge.id}: + {type:'RETARGET',sourceId,edgeId:edge.id,destId:nextDestId}; + if(!wireGraphCommit([op],{record:false}))return false; + wireAnchorId=nextDestId;render(); + if(nextDestId!==null&&nextDestId!==master.id)kickWireSpring(sourceId,nextDestId); + say('WIRE '+(nextDestId===null?'unplugged':'replugged')+' · edge '+edge.id+' · reference only'); + return true; +} +function wireConnectRange(source,anchorId,finalId){ + const page=Number(document.getElementById('bankSelect').value)||0; + const filter=document.getElementById('viewFilter').value; + const shown=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)) + .slice(page*bankCapacity(),(page+1)*bankCapacity()); + const a=shown.findIndex(x=>x.id===anchorId),b=shown.findIndex(x=>x.id===finalId); + if(a<0||b<0){say('WIRE RANGE: same bank only');return false;} + const targets=shown.slice(Math.min(a,b),Math.max(a,b)+1) + .filter(t=>t.id!==source.id&&!wireFor(source.id,t.id)); + if(!targets.length)return false; + if(!wireGraphCommit(targets.map(t=>({type:'CONNECT',sourceId:source.id,destId:t.id}))))return false; + render();say('WIRE RANGE · '+targets.length+' accepted edges · reference only');return true; +} +function wireDbText(db){return db<=-60?'−∞':(db>0?'+':'')+Number(db).toFixed(1)+' dB';} +function wireGainValue(db){return Math.round(Math.max(-60,Math.min(6,Number(db)||0))*10)/10;} +function armedWireSource(){return wireIntent&&wireSourcePinned?wireSourceTrack(wireSourceId):null;} +function wireGainPercent(db){return Math.max(0,Math.min(100,(Number(db)+60)/66*100));} +/* OUT is a solid physical jack, IN is an empty receiving jack. + Every non-MAIN strip can originate a wire. Coordinates never assume x1>x0. */ +/* V49: one committed edge identity owns selection, drag and gain. + A visual cable is a control; an SVG path is never the routing graph. */ +function incomingWireEdges(id){return wireEdges.filter(e=>e.enabled&&e.destId===id);} +function selectedWireEdge(){return wireEdges.find(e=>e.enabled&&e.id===selectedWireEdgeId)||null;} +function selectWireEdge(edge,inspect=false){ + if(!edge||!edge.enabled||!wireEdges.some(e=>e.id===edge.id))return; + selectedWireEdgeId=edge.id; + if(inspect){ + const ws=document.getElementById('wireWorkspace'); + wireWsOpen=true;wireWsMode='routes';if(ws)ws.hidden=false; + wireWsInspect={src:edge.sourceId,dst:edge.destId};wireWsRemoveConfirm=null; + renderWireWorkspace();renderWireWsInspector(); + } + render(); + say('WIRE '+wireWsLabel(edge.sourceId)+' → '+wireWsLabel(edge.destId)+ + ' selected · '+wireDbText(edge.levelDb)+' · GUI DEMO'); +} +function wireTray(t){ + const isMain=t.kind==='master'; + const focus=selection().filter(x=>x.kind!=='master'); + const source=armedWireSource()||(isMain&&focus.length===1?focus[0]:null); + const isSource=!!source&&source.id===t.id; + const direct=isMain&&source?wireFor(source.id,master.id):null; + const incoming=isMain?(direct?[direct]:[]):incomingWireEdges(t.id); + const armedEdge=source?wireFor(source.id,t.id):null; + const selected=incoming.find(e=>e.id===selectedWireEdgeId); + const incomingCount=isMain?incomingWireEdges(master.id).length:incoming.length; + const edge=selected||(incoming.length===1?incoming[0]:armedEdge)||null; + const connected=incoming.length>0,hasAnyArrival=incomingCount>0; + const legacy=false; + const linked=isMain?!!direct:connected; + const sourceLinked=!!armedEdge; + const canWire=!!(source&&!isSource)||(!isMain&&hasAnyArrival); + const label=isMain?(linked?'MAIN ON':'MAIN OFF'): + incomingCount>1?incomingCount+' incoming wires · inspect routes': + hasAnyArrival&&!source?'IN connected · inspect route': + !source?'NO SOURCE':isSource?'SOURCE': + linked?'CONNECTED':'CONNECT'; + const sender=edge?wireSourceTrack(edge.sourceId):null; + const modeLabel=edge?(isMain?'Focused CH→MAIN · drag this exact plug to replug or unplug': + edge.mode==='routeOnly'?'Route Only · drag IN to replug / unplug': + edge.mode==='send'?'Post-fader Send · drag IN to replug / unplug': + 'Pre FX Mult · drag IN to replug / unplug'): + hasAnyArrival?'Select one incoming route to inspect': + legacy?'Existing SEND slot · managed in legacy routing': + 'Choose OUT then click IN, or drag an OUT jack here'; + const from=''; + const to=''; + let controls=from+to; + if(edge&&!isMain){ + const pct=wireGainPercent(edge.levelDb); + controls+=''; + }else{ + controls+=''; + } + return '
'+controls+'
'; +} +/* V13: WIRE PATCH BAY is the ONLY always-visible SEND/BUS section. + Source input patch, 16 legacy SEND slots and snapshots remain in data model. + No duplicate destination dropdown / S1–S16 / horizontal gain slider. + Operator routes with socket and adjusts gain using the inline metal knob. */ +/* V13: uncluttered middle wire canvas. Only source and active destinations + carry tiny engraved text, leaving empty receiver channels optically quiet. */ +/* 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. + return { + incoming:wireEdges.filter(e=>e.enabled&&e.destId===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=t.kind!=='master'&&incoming>0,activeOut=outgoing>0,connected=activeIn||activeOut; + const title='Expand WIRE · '+t.name+' · '+incoming+' incoming, '+outgoing+ + ' 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 + // for its outgoing and incoming routes, with zero text or animated graphics. + const shape=''; + return ''; +} +function sectionSend(t){ + const source=armedWireSource(); + const isSource=!!source&&source.id===t.id; + const edge=source&&t.kind!=='master'?wireFor(source.id,t.id):null; + const legacy=source&&t.kind!=='master'&&hasLegacySendTo(source,t); + let label='',status=''; + if(isSource){label='SOURCE';status='⇢ '+wireOutgoingCount(t.id)+' OUT';} + else if(t.kind==='master'){label='MAIN';status=source&&wireFor(source.id,master.id)?'DIRECT ON':'DIRECT OFF';} + else if(edge){label='IN ← CH'+String(source.id).padStart(2,'0');status=edge.mode==='split'?'PRE FX':'POST FADER';} + else if(legacy){label='LEGACY';status='SEND ACTIVE';} + else if(t.kind==='bus')label='BUS'; + else if(t.kind==='fx')label='FX RETURN'; + return '
'+ + ''+wireTray(t)+compactWireSummary(t)+'
'; +} +function formatDb(n){return n<=-60?'-∞':(n>0?'+':'')+Number(n).toFixed(1);} +function panLabel(n){return Number(n)===0?'C':n<0?'L'+Math.abs(n):'R'+n;} +function panStyle(n){const left=Math.min(50,50+n/2),right=Math.max(50,50+n/2);return '--pan-start:'+left+'%;--pan-end:'+right+'%';} +/* M1: one calibrated linear-dB position model for gain, ruler ticks and + UI-only dBFS preview. Physical fader travel and actual DSP are untouched. */ +const METER_DBFS_MIN=-60, METER_DBFS_MAX=0; +function rangePct(v,min,max){return Math.max(0,Math.min(100,100*(Number(v)-min)/(max-min)));} +function scaleTopPct(db,min,max){return 100-rangePct(db,min,max);} +function faderPercent(value,isSend){return rangePct(value,-60,isSend?6:10);} +function meterDbfsPercent(dbfs){return rangePct(dbfs,METER_DBFS_MIN,METER_DBFS_MAX);} +function demoMeterDbfs(faderDb,modulation){ + // Simulated acoustic envelope in dBFS, NOT the signal-processing engine. + // One decibel of preview gain changes the displayed signal by one dB. + return Math.max(METER_DBFS_MIN,Math.min(METER_DBFS_MAX,-51+54*modulation+Number(faderDb))); +} +/* V51 portrait stepped meter — UI visual adapter, NEVER an audio engine. + Keep one cached height per live meter node; browser ResizeObserver updates + it only when a channel rail changes height, not on every 12 Hz tick. */ +const METER_STEP_PX=14,METER_HOLD_MS=850,METER_RELEASE_STEP_MS=120; +let meterGeometry=new WeakMap(); +const meterPeakHolds=new Map(); +const meterObserver=typeof ResizeObserver==='function'?new ResizeObserver(entries=>{ + for(const entry of entries){ + const height=Math.max(1,entry.contentRect.height); + meterGeometry.set(entry.target,{height,rows:Math.max(1,Math.floor(height/METER_STEP_PX))}); + } +}):null; +function displayMeterDbfs(fill,dbfs,ts,key){ + if(!fill)return; + const lane=fill.parentElement; + if(!lane)return; + let geometry=meterGeometry.get(lane); + if(!geometry){ + const height=Math.max(1,lane.clientHeight); + geometry={height,rows:Math.max(1,Math.floor(height/METER_STEP_PX))}; + meterGeometry.set(lane,geometry); + meterObserver?.observe(lane); + } + const steps=Math.max(0,Math.min(geometry.rows, + Math.round(meterDbfsPercent(dbfs)*geometry.rows/100))); + const litPx=Math.min(geometry.height,steps*METER_STEP_PX); + fill.style.setProperty('--lit',(100*litPx/geometry.height)+'%'); + let peak=meterPeakHolds.get(key); + if(!peak||steps>peak.steps){ + peak={steps,holdUntil:ts+METER_HOLD_MS,lastRelease:ts}; + meterPeakHolds.set(key,peak); + }else if(ts>peak.holdUntil&&ts-peak.lastRelease>=METER_RELEASE_STEP_MS){ + const elapsed=Math.floor((ts-Math.max(peak.holdUntil,peak.lastRelease))/METER_RELEASE_STEP_MS); + if(elapsed>0){ + peak.steps=Math.max(steps,peak.steps-elapsed); + peak.lastRelease=ts; + } + } + const marker=lane.querySelector('.meter-peak-hold'); + if(marker){ + marker.style.opacity=peak.steps>0?'1':'0'; + // A full 6x12 portrait LED, one grid cell beyond the live level. + // Clip the SAME full-height gradient (no recomputed peak color). + const markerRow=Math.min(geometry.rows-1,Math.max(0,peak.steps)); + const extent=(markerRow+1)*METER_STEP_PX-2; + marker.style.setProperty('--peak-extent',extent+'px'); + } +} +/* Safe read-only calibration probe: exposes pure scale math and a tiny demo + snapshot for browser QA, never mutable audio state or DSP controls. */ +window.ArSonMixMeterCalibration=Object.freeze({ + scaleTopPct,faderPercent,meterDbfsPercent,demoMeterDbfs, + readDemo:()=>({frame:meterFrame,gain:tracks[0]?.level??0,running:preview}) +}); +function sectionFader(t){ + const isSend=sofEnabled&&t.kind==='audio',value=isSend?getSofLevel(t):t.level,percent=faderPercent(value,isSend),gainMax=isSend?6:10; + const vuTicks=[0,-6,-12,-18,-24,-36,-48,-60],gainTicks=[gainMax,0,-6,-12,-24,-36,-48,-60]; + // Keep mathematically exact scale positions; suppress only intermediate + // numerals that crowd the compact rails. Minor tick marks remain visible. + const vuScale=vuTicks.map(v=>{ + const major=v%12===0; + return ''+(major?v:'')+''; + }).join(''); + const gainScale=gainTicks.map(v=>{ + const major=v!==-6; + return ''+(major?(v>0?'+'+v:v):'')+''; + }).join(''); + return '
'+(isSend?'SEND ':'')+formatDb(value)+' dB
' + +'
' + +'
'+(t.format==='mono'?'':'
')+'
'+vuScale+'
' + +'
' + +'
'+gainScale+'
'; +} +function strip(t){ + let code='
'; + code+=''; + code+='
'+(t.kind==='audio'?'▥':t.kind==='bus'?'↪':t.kind==='fx'?'∿':'➜')+''+(t.safe?'SAFE':'')+(t.group?''+escapeHtml(t.group)+'':'')+(t.kind==='audio'?'':'')+(t.kind!=='master'&&wireOutgoingCount(t.id)?'⇢'+wireOutgoingCount(t.id)+'':'')+'
'; + if(t.kind==='audio')code+='
IN
'; + else if(t.kind==='bus'||t.kind==='fx')code+='
IN'+(t.kind==='bus'?'GROUP':'FX RETURN')+'
'; + else code+='
INSUM BUS
'; + code+='
OUT
'; + code+=sectionFx(t)+sectionSend(t); + code+='
PAN'+panLabel(t.pan)+'
'; + + code+='
' + +'' + +'' + +'
'; + code+=sectionFader(t); + code+='
'+(sofEnabled&&t.kind==='audio'?'S ': '')+formatDb(sofEnabled&&t.kind==='audio'?getSofLevel(t):t.level)+'
'; + return code; +} +const DENSITY_WIDTH=Object.freeze({comfort:150,standard:134,compact:130}); +function bankGeometry(){ + const body=document.querySelector('.console-body'); + const panel=Number(body?.clientWidth)||0; + // One budget for the section rail, source strips and pinned MAIN. + // Floating Plugin Manager must never consume a mixer bank. + const rail=Number(document.querySelector('.section-rail')?.clientWidth)||32; + return {panel,usable:Math.max(0,panel-rail)}; +} +function bankCapacity(){ + const {panel,usable}=bankGeometry(); + const mode=document.querySelector('.console-body')?.dataset.density||'comfort'; + const minimum=DENSITY_WIDTH[mode]||DENSITY_WIDTH.comfort; + // 2px subpixel grace prevents 1680px banks from losing a whole channel at 149.82px. + return panel?Math.max(1,Math.min(10,Math.floor((usable+2)/minimum)-1)):10; +} +function render(pageOverride){ + const filter=document.getElementById('viewFilter').value; + const visible=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)); + const selector=document.getElementById('bankSelect'),previous=Number(selector.value)||0; + const capacity=bankCapacity(),count=Math.max(1,Math.ceil(visible.length/capacity)); + const page=Math.max(0,Math.min(Number.isInteger(pageOverride)?pageOverride:previous,count-1)); + selector.innerHTML=Array.from({length:count},(_,i)=>'').join(''); + selector.value=String(page); + const bankTracks=visible.slice(page*capacity,(page+1)*capacity); + const root=document.querySelector('.console-body'); + if(root.style?.setProperty){ + root.style.setProperty('--bank-capacity',String(capacity)); + const {panel,usable}=bankGeometry(); + if(panel){ + const unit=(usable/(capacity+1)).toFixed(3)+'px'; + root.style.setProperty('--channel-w',unit); + const pane=document.querySelector('.console-pane'); + if(pane?.style?.setProperty)pane.style.setProperty('--master-w',unit); + } + } + if(tracksEl.style?.setProperty)tracksEl.style.setProperty('--bank-columns',String(capacity)); + // Release observers for detached bank DOM; never accumulate orphan lanes. + meterObserver?.disconnect();meterGeometry=new WeakMap(); + tracksEl.innerHTML=bankTracks.map(strip).join(''); + updateSofTargets(); + masterEl.innerHTML=strip(master); + document.getElementById('viewport').scrollLeft=0; + document.getElementById('bankPrev').disabled=count<=1; + document.getElementById('bankNext').disabled=count<=1; + document.getElementById('trackCount').textContent=tracks.filter(t=>t.kind==='audio').length+' audio · '+tracks.filter(t=>t.kind==='bus').length+' bus · '+tracks.filter(t=>t.kind==='fx').length+' FX return · master'; + renderWireRouting(); +} +function say(s){info.textContent=s;} +function syncFaderVisual(t,element){ + const root=element||document.querySelector('.strip[data-id="'+t.id+'"]'); + if(!root)return; + const isSend=sofEnabled&&t.kind==='audio',v=isSend?getSofLevel(t):t.level; + const value=formatDb(v); + const readout=root.querySelector('.fader-readout'); + if(readout)readout.textContent=(isSend?'SEND ':'')+value+' dB'; + const box=root.querySelector('.fader-box'); + if(box?.style?.setProperty){box.style.setProperty('--fader-fill',faderPercent(v,isSend)+'%');box.style.setProperty('--fader-lit',String(faderPercent(v,isSend)/100));box.style.setProperty('--fader-frac',String(faderPercent(v,isSend)/100));box.style.setProperty('--fader-y',(100-faderPercent(v,isSend))+'%');} + const db=root.querySelector('.db-value'); + if(db)db.textContent=(isSend?'S ':'')+value; +} +function setDensity(mode){ + const density=['comfort','standard','compact'].includes(mode)?mode:'comfort'; + const root=document.querySelector('.console-body'),compact=density==='compact'; + const filter=document.getElementById('viewFilter').value; + const visible=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)); + const oldIndex=(Number(document.getElementById('bankSelect').value)||0)*bankCapacity(); + const anchor=visible[oldIndex]; + root.dataset.density=density; + root.classList.toggle('narrow',compact); + document.getElementById('densitySelect').value=density; + // Preserve the first visible channel when density changes page capacity. + const anchorIndex=anchor?visible.findIndex(t=>t.id===anchor.id):0; + render(Math.floor(Math.max(0,anchorIndex)/bankCapacity())); + const btn=document.getElementById('mode'); + btn.classList.toggle('active',compact);btn.setAttribute('aria-pressed',String(compact)); + return density; +} +function updateSofTargets(){ + const el=document.getElementById('sofTarget'),choices=tracks.filter(t=>t.kind==='bus'||t.kind==='fx').map(t=>t.name); + const target=choices.includes(sofTarget)?sofTarget:choices[0]||''; + sofTarget=target; + const html=choices.map(name=>'').join(''); + if(el.innerHTML!==html)el.innerHTML=html;el.value=sofTarget; +} +function getSofIndex(t){return t.sendSlots.findIndex((slot,i)=>(i===t.activeSend?t.send:slot.send)===sofTarget);} +function getSofLevel(t){const dest=tracks.find(x=>x.name===sofTarget); + const edge=dest&&wireFor(t.id,dest.id);return edge?edge.levelDb:-60;} +function setSofLevel(t,newLevel){ + const dest=tracks.find(x=>x.name===sofTarget&&x.id!==t.id); + if(!dest||t.kind==='master')return false; + const level=Math.round(Math.max(-60,Math.min(6,newLevel))*10)/10; + const edge=wireFor(t.id,dest.id); + if(!edge&&level<=-60)return true; + const ops=level<=-60?[{type:'REMOVE',sourceId:t.id,edgeId:edge.id}]: + edge?[{type:'GAIN',sourceId:t.id,edgeId:edge.id,levelDb:level}]: + [{type:'CONNECT',sourceId:t.id,destId:dest.id}, + {type:'GAIN',sourceId:t.id,edgeId:nextWireId,levelDb:level}]; + return wireGraphCommit(ops,{record:false}); +} +function toggleSof(force){ + sofEnabled=typeof force==='boolean'?force:!sofEnabled; + if(sofEnabled&&!sofTarget){sofEnabled=false;say('Create a Bus or FX Return to use Sends on Faders');return;} + const btn=document.getElementById('sofToggle');btn.classList.toggle('active',sofEnabled); + btn.setAttribute('aria-pressed',String(sofEnabled));document.querySelector('.console-body').classList.toggle('sends-mode',sofEnabled); + render();say(sofEnabled?'SENDS ON FADERS: adjusting '+sofTarget+' send levels · main faders protected':'MAIN MIX: faders control primary channel level'); +} +function revealTrack(t){ + // Do not select a channel hidden on a different fixed bank. + const filter=document.getElementById('viewFilter'); + if(filter.value!=='all'&&filter.value!==t.kind)filter.value='all'; + const visible=tracks.filter(x=>filter.value==='all'||x.kind===filter.value); + const index=visible.findIndex(x=>x.id===t.id); + selectTrack(t); + render(Math.floor(Math.max(0,index)/bankCapacity())); +} +function visibleBankCount(){ + const filter=document.getElementById('viewFilter').value; + const total=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)).length; + return Math.ceil(total/bankCapacity()); +} +function setSnapshotSafe(){ + const list=selection();if(!list.length){say('Select channels to set Snapshot Safe');return;} + const protect=list.some(t=>!t.safe);list.forEach(t=>t.safe=protect); + render();say(list.length+' channels '+(protect?'protected from':'released for')+' snapshot recall'); +} +function findTrack(el){const strip=el.closest('.strip');if(!strip)return null;const id=Number(strip.dataset.id);return id===master.id?master:tracks.find(t=>t.id===id);} +function refreshStrip(t){ + const old=document.querySelector('.strip[data-id="'+t.id+'"]');if(!old)return; + const oldRack=old.querySelector('.fxslot-list'),scroll=oldRack?oldRack.scrollTop:0; + const temp=document.createElement('div');temp.innerHTML=strip(t); + const updated=temp.firstElementChild; + old.replaceWith(updated); + const newRack=updated.querySelector('.fxslot-list');if(newRack)newRack.scrollTop=scroll; +} +function selectTrack(t,add=false){ + const previousSelection=selection().map(x=>x.id).join(','); + // V43: channel inspection reveals committed incoming/outgoing routes, but + // MUST NOT arm or retarget an OUT patch. + // Explicitly pinned OUT survives mixer selection and bank navigation. + if(!add){tracks.forEach(x=>x.selected=false);master.selected=false;t.selected=true;} + else t.selected=!t.selected; + document.querySelectorAll('.strip').forEach(el=>{ + const item=tracks.concat(master).find(x=>x.id===Number(el.dataset.id)); + el.classList.toggle('selected',!!item&&item.selected); + }); + const count=selection().length; + if(count>1)say(count+' channels selected · Copy/Paste will apply to selection'); + // No cable work on fader ticks or repeated selection, only genuine focus + // changes. Routing still commits exclusively through accepted WIRE actions. + if(selection().map(x=>x.id).join(',')!==previousSelection)renderWireRouting(); +} +function refreshWireRoutingNodes(){ + document.querySelectorAll('.strip').forEach(el=>{ + const t=tracks.concat(master).find(x=>x.id===Number(el.dataset.id)); + const tray=el.querySelector('.wire-tray'); + if(t&&tray)tray.outerHTML=wireTray(t); + }); + renderWireRouting(); +} +/* V31 suspended signal cables: catenary-inspired cubic, not the old sky arch. + A vertical DOWN tangent at OUT and an UP tangent at IN create the natural U + in either direction, independent of color or route model. + Limit depth to available cable stage so the curve never falls into PAN. */ +function wireSagClearance(rect,section){ + return section?Math.max(18,section.bottom-(rect.top+rect.height*.5)-7):72; +} +function wirePathData(x0,y0,x1,y1,sagLimit,spring=0){ + const span=Math.abs(x1-x0); + const ceiling=Math.max(12,Math.min(100,Number(sagLimit)||72)); + const sag=Math.max(10,Math.min(ceiling,Math.min(ceiling-5,28+Math.sqrt(span)*1.55)+spring)); + const control=(sag*4/3); + return 'M '+x0.toFixed(1)+' '+y0.toFixed(1)+ + ' C '+x0.toFixed(1)+' '+(y0+control).toFixed(1)+ + ', '+x1.toFixed(1)+' '+(y1+control).toFixed(1)+ + ', '+x1.toFixed(1)+' '+y1.toFixed(1); +} +/* V32: short soft settling on ONLY the newly accepted source/destination + cable. A per-edge geometry cache and SVG path attribute update mean other + cables and the full mixer DOM are not rebuilt on animation frames. + A new connection invalidates the prior motion token. */ +let wireMotion={key:null,offset:0,token:0},wireMotionGeometry=new Map(); +function wireCableKey(edge){return edge.sourceId+'-'+edge.destId;} +function wirePathFor(edge,x0,y0,x1,y1,limit){ + const key=wireCableKey(edge); + wireMotionGeometry.set(key,[x0,y0,x1,y1,limit]); + return wirePathData(x0,y0,x1,y1,limit,wireMotion.key===key?wireMotion.offset:0); +} +/* Socket impact travels backwards along the SAME accepted cable. + The two endpoints remain physically pinned; only the accepted SVG path + changes for 36 frames. No CSS keyframes, idle RAF or all-cables remount. */ +/* One low-frequency impact travels from receiver toward source, then + loses energy. Elapsed time makes 60/120 Hz render the same physical motion. */ +function wireImpactPathData(x0,y0,x1,y1,limit,elapsedMs){ + 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); + 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); + d+=' L '+(x-dy/norm*pulse).toFixed(1)+' '+(y+dx/norm*pulse).toFixed(1); + } + return d; +} +function kickWireSpring(sourceId,destId){ + if(!sourceId||!destId)return; + const key=sourceId+'-'+destId,geometry=wireMotionGeometry.get(key); + if(!geometry||document.hidden||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches)return; + const token=++wireMotion.token; + wireMotion.key=key;wireMotion.offset=0; + let paths=[...document.querySelectorAll('#wireLayer path[data-cable-key="'+key+'"]')]; + if(!paths.length){wireMotion.key=null;return;} + function paint(d){ + if(paths.every(path=>!path.isConnected)) + paths=[...document.querySelectorAll('#wireLayer path[data-cable-key="'+key+'"]')]; + for(const path of paths)if(path.isConnected&&path.getAttribute('d')!==d)path.setAttribute('d',d); + } + let began=null; + function step(now){ + if(token!==wireMotion.token)return; + if(document.hidden||window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches){ + paint(wirePathData(...geometry,0));wireMotion.key=null;return; + } + if(began===null)began=now; + const elapsed=Math.max(0,now-began); + paint(elapsed<1600?wireImpactPathData(...geometry,elapsed):wirePathData(...geometry,0)); + if(elapsed<1600)requestAnimationFrame(step); + else{wireMotion.offset=0;wireMotion.key=null;} + } + paint(wireImpactPathData(...geometry,0)); + requestAnimationFrame(step); +} +/* V23 Smart Wire: visible lit socket means preview is center-snapped and + mouseup accepts that exact candidate. Moving away releases attraction; + the underlying graph changes ONLY on mouseup. No whole-bay snap. */ +const WIRE_MAGNET=Object.freeze({preview:22,release:22,retained:24,origin:31}); +function wireSnapTarget(point,sourceId,originDestId=null,phase='preview'){ + if(!wireSourceTrack(sourceId)||!point|| + !Number.isFinite(point.x)||!Number.isFinite(point.y))return null; + const held=wireGesture?.snapId??null; // same acceptance for lit preview and final pointerup + let best=null,distance=Infinity; + for(const input of document.querySelectorAll?.('.wire-node-in')||[]){ + const track=findTrack(input); + if(!track||track.id===sourceId)continue; + const r=input.getBoundingClientRect?.(); + if(!r||!r.width||!r.height)continue; + const dist=Math.hypot(r.left+r.width*.5-point.x,r.top+r.height*.5-point.y); + // Easy to snap back to the old socket; deliberate pull beyond 31px unplugs. + const limit=track.id===originDestId?WIRE_MAGNET.origin: + (track.id===held?WIRE_MAGNET.retained:WIRE_MAGNET.preview); + if(dist>limit)continue; + if(dist + out.classList.toggle('is-snap-locked',id!==null)); +} +/* V26 Focus Signal Flow — one read-only display graph for both directions. + Keep legacy Send, Split and Bus primary paths visible without changing the + underlying audio topology or introducing duplicate wire edges. */ + +/* V34 Smart WIRE Navigator / Matrix. + View-only channel/bank discovery and existing route admission are separate. + No new route graph or global SVG animation loop is created. */ +let wireWsOpen=false,wireWsMode='find',wireWsQuery='',wireWsBusId=null,wireWsDestinationId=null, + wireWsInspect=null,wireWsRemoveConfirm=null,wireWsHistory=[],wireWsPendingBefore=null,wireWsEditBefore=null; + +/* Scoped WIRE-only undo. Never rewinds fader, FX, mute, mixer bank or meters. + Refuse stale replay after another graph/scene mutation. */ +function wireWsSnapshot(){ + return {edges:clone(wireEdges),nextId:nextWireId, + outputs:tracks.map(t=>[t.id,t.output]),trackIds:tracks.map(t=>t.id)}; +} +function wireWsSignature(state){return JSON.stringify(state);} +function wireWsRecord(before){ + if(!before)return; + const after=wireWsSnapshot(),afterSig=wireWsSignature(after); + // The same action may arrive through a socket and the Matrix controller; + // capture its accepted graph ONCE, never create duplicate Undo steps. + if(wireWsSignature(before)===afterSig||wireWsHistory.at(-1)?.afterSig===afterSig)return; + wireWsHistory.push({before,afterSig}); + if(wireWsHistory.length>10)wireWsHistory.shift(); + const btn=document.getElementById('wireWsUndo');if(btn)btn.disabled=false; +} +function wireWsUndo(){ + const entry=wireWsHistory[wireWsHistory.length-1]; + if(!entry){say('WIRE: no routing change to undo');return false;} + if(wireWsSignature(wireWsSnapshot())!==entry.afterSig){ + wireWsHistory=[];wireWsPendingBefore=null; + say('WIRE UNDO canceled: graph changed outside Navigator · current routes preserved'); + renderWireWorkspace();return false; + } + const valid=ArSonWireGraph.validateCandidateGraph(tracks,master.id,entry.before.edges); + if(!valid.ok){say('WIRE UNDO BLOCKED: '+valid.error);return false;} + wireWsHistory.pop();wireEdges=clone(entry.before.edges);nextWireId=entry.before.nextId; + selectedWireEdgeId=wireEdges.some(e=>e.id===selectedWireEdgeId)?selectedWireEdgeId:null; + syncWireOutputProjection(); + wireWsInspect=null;wireWsRemoveConfirm=null; + render();renderWireWorkspace(); + say('WIRE UNDO · previous routing restored · unrelated mixer settings kept'); + return true; +} +function wireWsId(id){return 'CH'+String(id).padStart(2,'0');} +function wireWsLabel(id){ + const t=tracks.concat(master).find(x=>x.id===id);return t?(t.kind==='master'?'MAIN':wireWsId(id))+' · '+t.name:wireWsId(id); +} +function wireWsBank(id){ + const filter=document.getElementById('viewFilter')?.value||'all'; + const shown=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)); + const index=shown.findIndex(t=>t.id===id); + return index<0?'Hidden by filter':'Bank '+(Math.floor(index/Math.max(1,bankCapacity()))+1); +} +function wireWsRoutes(){return wireDisplayRoutes();} +function wireWsFindEdge(src,dst){return wireEdges.find(e=>e.enabled&&e.sourceId===src&&e.destId===dst);} +function wireWsRouteKind(src,dst,routes){ + const edge=wireWsFindEdge(src,dst); + if(edge)return {kind:'wire',edge}; + const linked=routes.find(e=>e.sourceId===src&&e.destId===dst); + return linked?{kind:linked.kind,edge:null}:null; +} +function wireWsMatches(t){ + const q=wireWsQuery.trim().toLowerCase(); + return !q||('ch'+String(t.id).padStart(2,'0')+' '+t.id+' '+t.name+' '+t.kind).toLowerCase().includes(q); +} +function wireWsCanJoin(src,dst){ + const a=wireSourceTrack(src),b=wireSourceTrack(dst); + return !!(a&&b&&a.id!==b.id&&!wireFor(src,dst)&&!wireIsCycle(src,dst)); +} +function wireWsChooseMode(mode){ + wireWsDestinationId=null; // Deliberate mode selection leaves the receiving socket inspector. + const previous=wireWsMode; + wireWsMode=['find','routes','bus','matrix'].includes(mode)?mode:'find'; + wireWsInspect=null;wireWsRemoveConfirm=null; + if(previous!==wireWsMode){wireWsQuery='';const search=document.getElementById('wireWsSearch');if(search)search.value='';} + const panel=document.getElementById('wireWorkspace'); + if(panel)panel.classList.toggle('is-matrix',wireWsMode==='matrix'); + renderWireWorkspace(); +} +function wireWsToggle(mode){ + const panel=document.getElementById('wireWorkspace'); + if(!panel)return; + if(wireWsOpen&&wireWsMode===mode){wireWsOpen=false;panel.hidden=true;} + else {setWireConfig(false);wireWsOpen=true;panel.hidden=false;wireWsChooseMode(mode);} + for(const id of ['wireNavigatorToggle','wireMatrixToggle']){ + const el=document.getElementById(id);if(el) + el.setAttribute('aria-expanded',String(wireWsOpen&& + (id==='wireMatrixToggle'?wireWsMode==='matrix':wireWsMode!=='matrix'))); + } + if(wireWsOpen&&wireWsMode==='find')document.getElementById('wireWsSearch')?.focus?.(); +} +/* Multiple incoming cables must be selected explicitly before an edit. + Opening this inspector never arms a new source or modifies the graph. */ +function inspectIncomingWireRoutes(destination){ + const arrivals=wireWsRoutes().filter(route=>route.destId===destination.id); + if(!arrivals.length)return; + setWireConfig(false);wireWsDestinationId=destination.id;wireWsMode='routes';wireWsOpen=true; + wireWsInspect=arrivals.length===1?{src:arrivals[0].sourceId,dst:destination.id}:null; + wireWsRemoveConfirm=null; + const panel=document.getElementById('wireWorkspace'); + if(panel)panel.hidden=false; + document.getElementById('wireNavigatorToggle').setAttribute('aria-expanded','true'); + document.getElementById('wireMatrixToggle').setAttribute('aria-expanded','false'); + renderWireWorkspace(); + say('IN '+wireWsLabel(destination.id)+' · '+arrivals.length+' incoming route'+(arrivals.length===1?'':'s')+' · select a cable to inspect'); +} +function wireWsJump(id){ + const target=wireSourceTrack(id);if(!target)return; + const filter=document.getElementById('viewFilter'); + let list=tracks.filter(t=>filter.value==='all'||(filter.value==='solo'?t.solo:t.kind===filter.value)); + if(!list.some(t=>t.id===id)){filter.value='all';list=tracks;} + const idx=list.findIndex(t=>t.id===id); + render(Math.floor(Math.max(0,idx)/Math.max(1,bankCapacity()))); + say('WIRE NAVIGATOR · showing '+wireWsLabel(id)+' · patch source unchanged'); +} +function wireWsListRow(t,source,routes,mode){ + const connected=source?wireWsRouteKind(source.id,t.id,routes):null; + const href=source?source.id+':'+t.id:null; + const possible=source&&t.id!==source.id&&wireWsCanJoin(source.id,t.id); + const linked=!!connected; + const action=linked? + '': + possible?'': + ''; + return '
'+ + ''+ + ''+wireWsId(t.id)+' · '+escapeHtml(t.name)+''+ + ''+escapeHtml(wireWsBank(t.id))+''+ + (linked?''+(connected.kind==='wire'?'● WIRE':'● '+escapeHtml(connected.kind.toUpperCase()))+'':'')+ + action+'
'; +} +function wireWsRouteRow(route,direction){ + const src=tracks.find(t=>t.id===route.sourceId),dst=tracks.find(t=>t.id===route.destId); + if(!src||!dst)return ''; + const other=direction==='out'?dst:src; + const info=wireWsRouteKind(src.id,dst.id,wireWsRoutes()); + return '
'+ + ''+ + (direction==='out'?'→ ':'← ')+escapeHtml(wireWsLabel(other.id))+''+ + ''+escapeHtml(wireWsBank(other.id))+''+ + escapeHtml(info?.kind||route.kind)+''+ + ''+ + '
'; +} +function wireWsMatrixMarkup(source,routes){ + const all=tracks.filter(t=>t.kind!=='master'); + const targets=all.filter(wireWsMatches); + // Matrix is deliberately capped; the search exposes all stable IDs without + // creating a huge DOM for 100+ strips or slowing audio UI interactions. + const rows=(source?[source,...all.filter(t=>t.id!==source.id)]:all).slice(0,16); + const columns=targets.slice(0,22); + if(!columns.length)return '
No matching channel. Search CH number or track name.
'; + const cols=columns.map(t=>''+wireWsId(t.id)+'').join(''); + const matrix=rows.map(src=>{ + const cells=columns.map(dst=>{ + const key=src.id+':'+dst.id,info=wireWsRouteKind(src.id,dst.id,routes),self=src.id===dst.id, + permitted=!self&&wireWsCanJoin(src.id,dst.id),cls=info?(info.edge?'is-linked':'is-legacy'):'', + action=info?'data-ws-inspect':'data-ws-join', + symbol=info?(info.edge?'●':'◆'):(permitted?'+':'–'); + return ''; + }).join(''); + return ''+wireWsId(src.id)+' · '+escapeHtml(src.name)+''+cells+''; + }).join(''); + return '
'+cols+ + ''+matrix+'
FROM ↓ / TO →
'+ + (all.length>16||targets.length>22?'
Showing up to 16 source rows × 22 destinations. Search for other targets, or set FROM to pin a source.
':''); +} +function renderWireWsInspector(){ + if(!wireWsOpen)return; + const panel=document.getElementById('wireWsInspector'); + if(!panel)return; + const p=wireWsInspect,info=p&&wireWsRouteKind(p.src,p.dst,wireWsRoutes()); + if(!info){panel.hidden=true;return;} + panel.hidden=false; + const src=tracks.find(t=>t.id===p.src),dst=tracks.concat(master).find(t=>t.id===p.dst); + if(!src||!dst){panel.hidden=true;return;} + const edge=info.edge,key=p.src+':'+p.dst; + const controls=edge? + '
'+ + ''+ + ''+edge.levelDb+' dB'+ + ''+ + ''+ + '
': + '
Managed by existing '+escapeHtml(info.kind.toUpperCase())+' routing. No duplicate WIRE edge.
'; + panel.innerHTML=''+escapeHtml(wireWsLabel(p.src))+' → '+escapeHtml(wireWsLabel(p.dst))+''+ + ''+escapeHtml(info.kind.toUpperCase())+''+controls+ + '
'+ + '
'; +} +function renderWireWorkspace(){ + if(!wireWsOpen)return; + const panel=document.getElementById('wireWorkspace'); + if(!panel||panel.hidden)return; + panel.classList.toggle('is-matrix',wireWsMode==='matrix'); + const source=armedWireSource(),routes=wireWsRoutes(); + document.getElementById('wireWsSource').textContent=wireWsDestinationId? + 'IN '+wireWsLabel(wireWsDestinationId)+' · routes':source?wireWsLabel(source.id)+' OUT':'Choose source OUT'; + for(const tab of panel.querySelectorAll('[data-ws-mode]')) + tab.setAttribute('aria-selected',String(tab.dataset.wsMode===wireWsMode)); + const sel=document.getElementById('wireWsSourceSelect'),selected=source?.id||0; + const options=''+tracks.map(t=> + '').join(''); + if(sel.innerHTML!==options)sel.innerHTML=options; + sel.value=String(selected||''); + const busSel=document.getElementById('wireWsBus'),buses=tracks.filter(t=>t.kind==='bus'); + busSel.hidden=wireWsMode!=='bus'; + const busOpt=buses.map(t=>'').join(''); + if(busSel.innerHTML!==busOpt)busSel.innerHTML=busOpt; + if(!buses.some(t=>t.id===wireWsBusId))wireWsBusId=buses[0]?.id||null; + busSel.value=String(wireWsBusId||''); + const list=document.getElementById('wireWsList'); + const foot=document.getElementById('wireWsFoot'); + if(wireWsMode==='find'){ + const matches=tracks.filter(t=>t.kind!=='master'&&t.id!==source?.id&&wireWsMatches(t)); + list.innerHTML=matches.slice(0,75).map(t=>wireWsListRow(t,source,routes,'find')).join('')|| + '
No destination matches your search.
'; + foot.textContent=(source?'SOURCE '+wireWsId(source.id)+' retained · ':'Select an OUT source · ')+ + matches.length+' matching destinations, across all banks'; + }else if(wireWsMode==='routes'){ + const focused=wireWsDestinationId?tracks.find(t=>t.id===wireWsDestinationId):source; + const inbound=focused?routes.filter(e=>e.destId===focused.id):[]; + const outbound=focused?routes.filter(e=>e.sourceId===focused.id):[]; + list.innerHTML=focused? + '
OUTGOING · '+outbound.length+'
'+ + (outbound.map(e=>wireWsRouteRow(e,'out')).join('')||'
No outgoing routes
')+ + '
INCOMING · '+inbound.length+'
'+ + (inbound.map(e=>wireWsRouteRow(e,'in')).join('')||'
No incoming routes
'): + '
Select source OUT above to see all incoming and outgoing routes.
'; + foot.textContent='Jump ↗ preserves source selection · only real WIRE edges are editable'; + }else if(wireWsMode==='bus'){ + const bus=tracks.find(t=>t.id===wireWsBusId&&t.kind==='bus'); + const sources=tracks.filter(t=>t.id!==bus?.id&&t.kind!=='master'&&wireWsMatches(t)); + list.innerHTML='
Choose a Bus to build its send mix.
'; + // Destination-first rows need a dedicated model-aware control, not a reversed wire. + if(bus)list.innerHTML=sources.slice(0,75).map(t=>{ + const info=wireWsRouteKind(t.id,bus.id,routes),can=wireWsCanJoin(t.id,bus.id); + return '
'+escapeHtml(wireWsLabel(t.id))+''+ + ''+escapeHtml(wireWsBank(t.id))+''+ + (info?'● '+escapeHtml(info.kind.toUpperCase())+'':'')+ + (info?'': + '')+ + '
'; + }).join('')||'
No source matches.
'; + foot.textContent='MIX TO '+(bus?wireWsLabel(bus.id):'Bus')+ + ' · choose sources across banks · Bus decision remains explicit'; + }else{ + list.innerHTML=wireWsMatrixMarkup(source,routes); + foot.textContent='Crosspoint ● WIRE / ◆ existing legacy · routes are never bank-specific'; + } + renderWireWsInspector(); + const undo=document.getElementById('wireWsUndo');if(undo)undo.disabled=wireWsHistory.length===0; +} + +function wireDisplayRoutes(){ + // Projection of ONE canonical graph. No independent output/SEND ghost paths. + return wireEdges.filter(e=>e.enabled).map(e=>({ + id:e.id,sourceId:e.sourceId,destId:e.destId,kind:'wire' + })); +} +function wireLegendHtml(focus,routes){ + const inRoutes=routes.filter(e=>e.destId===focus.id); + const outRoutes=routes.filter(e=>e.sourceId===focus.id); + const fmtId=t=>t.kind==='master'?'MAIN':'CH'+String(t.id).padStart(2,'0'); + const badges=(list,incoming)=>{ + const nodes=list.map(e=>tracks.concat(master).find(t=>t.id===(incoming?e.sourceId:e.destId))).filter(Boolean); + const visible=nodes.slice(0,2).map(t=>{ + const icon=incoming? + '': + ''; + return ''+icon+''+fmtId(t)+''; + }).join(''); + const rest=nodes.length>2?'+'+(nodes.length-2)+'':''; + return visible+rest||'—'; + }; + return ''+fmtId(focus)+''+ + ''+ + 'IN'+badges(inRoutes,true)+''+ + ''+ + 'OUT'+badges(outRoutes,false)+''; +} +/* V46: geometry from existing physical pins, never label-bearing buttons. + Applies to incoming/outgoing/context, drag, snap and impact alike. */ +function wireJackRect(button){ + if(!button)return null; + const dot=button.querySelector?.(button.classList.contains('wire-node-out')?'.wire-pin':'.wire-arrow'); + 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)=>''; + layer.innerHTML=p('wire-main-shadow',path)+p('wire-main-jacket',path)+ + p('wire-main-sheen',path)+ + ''; + layer.style.setProperty('--main-wire-hue',master.color); +} +function syncMainWireFragments(){ + // 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),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,!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(){ + syncMainWireFragments(); + if(wireWsOpen&&!wireGesture?.active)renderWireWorkspace(); + document.querySelector('.console-body')?.classList.toggle('wire-intent',!!wireIntent); + const svg=document.getElementById('wireLayer'),viewport=document.getElementById('viewport'); + const dragging=!!(wireGesture?.active&&wireGesture.point); + const focus=armedWireSource(),routes=wireDisplayRoutes(); + // 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): + (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; + const bankVisible=tracks.filter(t=>filter==='all'||(filter==='solo'?t.solo:t.kind===filter)); + const sourceIndex=bankVisible.findIndex(t=>t.id===focus?.id); + const sourceInBank=sourceIndex>=0&&Math.floor(sourceIndex/bankCapacity())===(Number(document.getElementById('bankSelect').value)||0); + const markup=focus&&!sourceInBank? + ''+ + 'Click any IN on this bank': + controlSource?wireLegendHtml(controlSource,routes):'Select a channel for IN / OUT'; + const picker=focus?'CH'+ + String(focus.id).padStart(2,'0')+' OUT →'+ + '':''; + const fullMarkup=markup+picker; + if(legend.innerHTML!==fullMarkup)legend.innerHTML=fullMarkup; + } + const configSource=document.getElementById('wireConfigSource'); + if(configSource)configSource.textContent=controlSource?wireWsLabel(controlSource.id)+' · '+(focus?'OUT armed':'selected channel'):'Select a channel or OUT jack to inspect routing'; + if(main){ + main.disabled=!controlSource; + if(!controlSource){main.textContent='MAIN';main.setAttribute('aria-pressed','false');} + } + if(main&&controlSource){ + const direct=!!wireFor(controlSource.id,master.id); + main.textContent=direct?'MAIN ON':'MAIN OFF';main.setAttribute('aria-pressed',String(direct)); + main.title='Direct source output: '+controlSource.output+' · click to toggle Main only when currently mapped to Main or Source Only'; + } + if(!svg||!viewport)return; + if(!source||document.querySelector('.console-body')?.classList.contains('collapsed-send')){ + if(svg.childNodes?.length)svg.replaceChildren?.(); + syncVisibleWireDots(svg); // no visible cables means no illuminated receiving rings + return; + } + const vp=viewport.getBoundingClientRect?.(); + const wireBay=viewport.querySelector('.strip .send-section')?.getBoundingClientRect?.(); + if(vp&&wireBay)svg.style.clipPath='inset('+Math.max(0,wireBay.top-vp.top)+'px 0px '+Math.max(0,vp.bottom-wireBay.bottom)+'px 0px)'; + const fromEl=viewport.querySelector?.('.strip[data-id="'+source.id+'"] .wire-node-out'); + const from=wireJackRect(fromEl); + const visibleSource=!!from?.width; + const bankIn=viewport.querySelector?.('#tracks .strip .wire-node-in'); + const bankRect=wireJackRect(bankIn); + if(!vp||!vp.width||!vp.height||(!visibleSource&&!bankRect?.width)){svg.innerHTML='';syncVisibleWireDots(svg);return;} + svg.setAttribute('viewBox','0 0 '+vp.width+' '+vp.height); + // An off-bank SOURCE enters via the left patch-bay boundary. This is a + // labelled portal, never a fabricated channel position across unseen banks. + const anchor=visibleSource?from:bankRect; + const x0=visibleSource?from.left-vp.left+from.width/2:12; + const y0=anchor.top-vp.top+anchor.height*.5; + const well=(visibleSource?fromEl:bankIn).closest?.('.send-section')?.getBoundingClientRect?.(); + const sagLimit=wireSagClearance(anchor,well); + const paths=[]; + wireMotionGeometry=new Map(); + // Never render unrelated channels. Navigator and Matrix inspect all routes. + // Physical incoming cables remain visible even when OUT is unarmed. + // If patch source is pinned, also show inputs of the inspected channel. + const incoming=wireView==='out'?[]: + routes.filter(e=>e.destId===source.id&&e.sourceId!==e.destId&&e.destId!==master.id); + let offBankIncoming=0; + for(const edge of incoming){ + const sender=wireSourceTrack(edge.sourceId); + const fromNode=viewport.querySelector?.('.strip[data-id="'+edge.sourceId+'"] .wire-node-out'); + const fromRect=wireJackRect(fromNode); + const toNode=viewport.querySelector?.('.strip[data-id="'+edge.destId+'"] .wire-node-in'); + const toRect=wireJackRect(toNode); + if(!sender||!toRect?.width)continue; + // An off-bank source starts at the left patch-bay portal. Never fake a + // hidden strip position or suppress a real incoming signal cable. + const offBank=!fromRect?.width; + const xb=toRect.left-vp.left+toRect.width*.5,yb=toRect.top-vp.top+toRect.height*.5; + const xa=offBank?11:fromRect.left-vp.left+fromRect.width*.5; + const ya=offBank?yb+Math.min(9,offBankIncoming++*3):fromRect.top-vp.top+fromRect.height*.5; + const senderBay=fromNode?.closest?.('.send-section')?.getBoundingClientRect?.(); + const rise=offBank?wireSagClearance(toRect,toNode.closest?.('.send-section')?.getBoundingClientRect?.()): + wireSagClearance(fromRect,senderBay); + const d=wirePathFor(edge,xa,ya,xb,yb,rise),key=wireCableKey(edge); + paths.push(''+ + ''); + if(offBank)paths.push(''+ + 'CH'+String(edge.sourceId).padStart(2,'0')+''); + } + // Front layer: all outgoing routes from selected channel (including existing + // legacy Sends, primary Bus and split links), plus the original hover hint. + const outgoing=routes.filter(e=>e.sourceId===source.id&& + (!dragging||!wireGesture.movingEdgeId|| + !wireEdges.some(w=>w.id===wireGesture.movingEdgeId&&w.destId===e.destId&&w.sourceId===source.id))); + if(!dragging&&!!focus&&wireHoverId!==null&&wireHoverId!==source.id&&!outgoing.some(e=>e.destId===wireHoverId)) + outgoing.push({sourceId:source.id,destId:wireHoverId,kind:'preview',preview:true}); + for(const edge of outgoing){ + const dest=tracks.find(t=>t.id===edge.destId); + if(!dest)continue; + const rect=wireJackRect(viewport.querySelector?.('.strip[data-id="'+dest.id+'"] .wire-node-in')); + if(!rect||!rect.width)continue; + const x1=rect.left-vp.left+rect.width/2,y1=rect.top-vp.top+rect.height/2; + const d=wirePathFor(edge,x0,visibleSource?y0:y1,x1,y1,sagLimit),color=source.color||'#93e5b4'; + paths.push(''+ + ''); + } + if(!visibleSource&&paths.some(p=>p.includes('wire-outgoing-line'))){ + paths.push(''); + } + if(dragging){ + let x1=Math.max(2,Math.min(vp.width-2,wireGesture.point.x-vp.left)); + let y1=Math.max(2,Math.min(vp.height-2,wireGesture.point.y-vp.top)); + const snap=tracks.concat(master).find(t=>t.id===wireGesture.snapId); + const rect=snap?wireJackRect(viewport.querySelector?.('.strip[data-id="'+snap.id+'"] .wire-node-in')):null; + if(rect?.width){ + // True magnetic PREVIEW: if the receiving ring is lit, the cable endpoint + // visibly docks into that ring. Exiting 24px undocks immediately and + // continues with the mouse. This never commits route state during drag. + x1=rect.left-vp.left+rect.width*.5; + y1=rect.top-vp.top+rect.height*.5; + } + const d=wirePathData(x0,y0,x1,y1,sagLimit); + paths.push(''+ + ''+ + (snap?'':'')); + } + svg.innerHTML=paths.join(''); + // Exactly one transparent hit geometry per real edge. Avoid endpoint sockets + // by reserving 6% of path length at both ends; previews/legacy stay passive. + if(!dragging){ + const represented=new Set(); + const lines=[...svg.querySelectorAll('path.wire-outgoing-line,path.wire-incoming-line,path.wire-context-line')]; + for(const line of lines){ + const edge=wireFor(Number(line.dataset.from),Number(line.dataset.to)); + if(!edge||represented.has(edge.id))continue; + represented.add(edge.id); + if(edge.id===selectedWireEdgeId)line.classList.add('is-wire-selected'); + const hit=document.createElementNS('http://www.w3.org/2000/svg','path'); + hit.setAttribute('class','wire-interaction-hit'+(edge.id===selectedWireEdgeId?' is-wire-selected':'')); + hit.setAttribute('data-edge-id',String(edge.id)); + hit.setAttribute('data-cable-key',wireCableKey(edge)); + hit.setAttribute('d',line.getAttribute('d')); + hit.setAttribute('pathLength','100'); + hit.setAttribute('stroke-dasharray','0 6 88 6'); + svg.appendChild(hit); + } + } + if(!dragging)syncVisibleWireDots(svg); +} + +/* Only visible SVG cables paint matching physical dot hue/opacity. + No RAF repaint and no forced active light on hidden/off-bank channels. */ +function syncVisibleWireDots(svg){ + const visible=new Map(); + // Physical WIRE material follows accepted edges only; legacy SEND/OUT/split + // metadata remains in Navigator but cannot light an unplugged WIRE jack. + const committed=wireEdges.filter(e=>e.enabled); + const custom=committed.filter(e=>e.destId!==master.id); + const arrivals=new Set(custom.map(e=>String(e.destId))); + const sends=new Set(custom.map(e=>String(e.sourceId))); + for(const path of svg.querySelectorAll('path.wire-incoming-line,path.wire-outgoing-line,path.wire-context-line')){ + // A hover hint is not a plugged-in cable. Keep snap/hover illumination + // independent of physical connection state and endpoint paint. + if(path.dataset.routeKind==='preview'|| + !wireFor(Number(path.dataset.from),Number(path.dataset.to)))continue; + const color=path.getAttribute('stroke'),opacity=Number(path.getAttribute('opacity')); + if(!color||!Number.isFinite(opacity))continue; + for(const [id,direction] of [[path.dataset.from,'out'],[path.dataset.to,'in']]){ + const key=id+':'+direction; + if(!id||(visible.has(key)&&visible.get(key).opacity>=opacity))continue; + visible.set(key,{color,opacity}); + } + } + for(const node of document.querySelectorAll('.strip .wire-node-out,.strip .wire-node-in')){ + const isInput=node.classList.contains('wire-node-in'); + const trackId=node.closest('.strip')?.dataset.id; + const key=trackId+':'+(isInput?'in':'out'); + const connected=isInput?committed.some(e=>String(e.destId)===trackId):sends.has(trackId); + if(connected)node.setAttribute('data-wire-connected','true'); + else node.removeAttribute('data-wire-connected'); + // Connected paint follows committed model; cable display focus never changes it. + // The receiving ring uses --ch (its own channel); the inner dot still + // uses the incoming wire's SVG hue and opacity. + if(isInput){ + if(arrivals.has(trackId))node.setAttribute('data-wire-arrival','true'); + else node.removeAttribute('data-wire-arrival'); + } + const edge=visible.get(key); + // Visual paint follows the visible committed WIRE path, not a legacy + // SEND or an off-bank hidden connection. Keep graph state separate. + node.dataset.wirePaint=(edge||( !isInput&&sends.has(trackId)))?'connected':'idle'; + if(!edge){ + if(!isInput&&sends.has(trackId)){ + const t=tracks.find(x=>String(x.id)===trackId); + if(t)node.style.setProperty('--wire-edge-color',t.color); + node.style.setProperty('--wire-edge-opacity','1'); + } + node.removeAttribute('data-wire-visible'); + if(isInput||!sends.has(trackId)){ + node.style.removeProperty('--wire-edge-color'); + node.style.removeProperty('--wire-edge-opacity'); + } + continue; + } + node.setAttribute('data-wire-visible','true'); + if(node.style.getPropertyValue('--wire-edge-color')!==edge.color)node.style.setProperty('--wire-edge-color',edge.color); + const alpha=String(edge.opacity); + if(node.style.getPropertyValue('--wire-edge-opacity')!==alpha)node.style.setProperty('--wire-edge-opacity',alpha); + } +} +/* A wire can be selected without changing the armed source. The existing + route inspector remains the non-drag remove/accessibility alternative. */ +document.getElementById('wireLayer').addEventListener('click',ev=>{ + const hit=ev.target.closest?.('path.wire-interaction-hit'); + if(!hit)return; + const edge=wireEdges.find(e=>e.enabled&&e.id===Number(hit.dataset.edgeId)); + if(!edge)return; + ev.stopPropagation();selectWireEdge(edge); +}); +document.getElementById('wireLayer').addEventListener('dblclick',ev=>{ + const hit=ev.target.closest?.('path.wire-interaction-hit'); + const edge=hit&&wireEdges.find(e=>e.enabled&&e.id===Number(hit.dataset.edgeId)); + if(!edge)return; + ev.stopPropagation();selectWireEdge(edge,true); +}); +function queueWireGestureFrame(){ + if(wireFramePending)return; + wireFramePending=true; + requestAnimationFrame(()=>{ + wireFramePending=false; + if(!wireGesture?.active)return; + const snap=wireSnapTarget(wireGesture.point,wireGesture.sourceId,wireGesture.originDestId); + wireGesture.snapId=snap?.track.id??null; + setWireSnapTarget(wireGesture.snapId); + renderWireRouting(); + }); +} +function syncActiveSend(t){ + if(t.kind==='master'||t.kind==='fx')return; + t.sendSlots[t.activeSend]={send:t.send,sendOn:t.sendOn,pre:t.pre,sendLevel:t.sendLevel,sendPan:t.sendPan}; +} +function openSendSlot(t,index){ + syncActiveSend(t);t.activeSend=index; + Object.assign(t,clone(t.sendSlots[index])); +} +function wouldFeedback(source,destination){ + const first=tracks.find(x=>(x.kind==='bus'||x.kind==='fx')&&x.name===destination); + if(!first)return false; + const seen=new Set(),pending=[first]; + while(pending.length){ + const current=pending.pop(); + if(current.id===source.id)return true; + if(seen.has(current.id))continue;seen.add(current.id); + const outgoing=[current.output]; + if(current.kind==='bus'){ + current.sendSlots.forEach((slot,i)=>{const live=i===current.activeSend?{send:current.send,sendOn:current.sendOn}:slot;if(live.sendOn)outgoing.push(live.send);}); + } + outgoing.forEach(name=>{const next=tracks.find(x=>(x.kind==='bus'||x.kind==='fx')&&x.name===name);if(next&&!seen.has(next.id))pending.push(next);}); + } + return false; +} +const COPY_KEYS=['fx','slotBypass','fxOn','eq','pan','trim','mute','solo','level']; +function copyChannels(){ + const src=selection()[0];if(!src){say('Select a channel to copy settings');return;} + clipboard=Object.fromEntries(COPY_KEYS.map(k=>[k,clone(src[k])])); + say('Copied mixer settings from '+src.name+' (does not copy hardware I/O)'); +} +function pasteChannels(){ + if(!clipboard){say('No channel settings in clipboard');return;} + const list=selection();if(!list.length){say('Select destination channels before pasting');return;} + for(const t of list){ + for(const k of COPY_KEYS){ + if((t.kind==='master'||t.kind==='fx')&&['send','sendOn','pre','sendLevel','sendPan','activeSend','sendSlots'].includes(k))continue; + if((k==='send')&&wouldFeedback(t,clipboard[k]))continue; + t[k]=clone(clipboard[k]); + } + } + render();say('Pasted compatible settings to '+list.length+' selected channel(s) · hardware I/O unchanged'); +} +function refreshScenes(){ + const el=document.getElementById('sceneSelect'),selected=el.value; + el.innerHTML=''+scenes.map((x,i)=>'').join(''); + if(selected&&scenes[Number(selected)])el.value=selected; +} +function saveScene(){ + const name='Scene '+(scenes.length+1); + scenes.push({name,wireGraphVersion:1,nextId,nextGroup,wireEdges:clone(wireEdges),nextWireId,wireMode,wireSourceId,wireAnchorId,tracks:clone(tracks),master:clone(master),filter:document.getElementById('viewFilter').value,narrow:document.querySelector('.console-body').classList.contains('narrow'),density:document.querySelector('.console-body').dataset.density||'comfort'}); + refreshScenes();document.getElementById('sceneSelect').value=String(scenes.length-1); + say('Scene saved: '+scenes[scenes.length-1].name+' · local reference session only'); +} +function recallScene(){ + const value=document.getElementById('sceneSelect').value; + if(value===''){say('Choose a saved Scene');return;} + const scene=scenes[Number(value)];if(!scene)return; + const protectedChannels=new Map(tracks.concat(master).filter(t=>t.safe).map(t=>[t.id,clone(t)])); + let nextTracks=clone(scene.tracks).map(t=>protectedChannels.get(t.id)||t); + for(const [id,t] of protectedChannels)if(t.kind!=='master'&&!nextTracks.some(x=>x.id===id)) + nextTracks.push(t); + const nextMaster=protectedChannels.get(master.id)||clone(scene.master); + if(nextMaster.id!==master.id){say('SCENE REJECTED: MAIN identity changed');return;} + const migrated=ArSonWireGraph.migrateLegacy(nextTracks,nextMaster.id, + clone(scene.wireEdges||[]),scene.nextWireId||1,{graphVersion:scene.wireGraphVersion||0}); + if(!migrated.ok){say('SCENE REJECTED: '+migrated.error);return;} + const protectedIds=new Set(protectedChannels.keys()); + const retain=wireEdges.filter(e=>protectedIds.has(e.sourceId)||protectedIds.has(e.destId)); + let nextEdges=migrated.edges.filter(e=>!protectedIds.has(e.sourceId)&&!protectedIds.has(e.destId)); + const taken=new Set(retain.map(e=>e.id)); + let seq=Math.max(1,scene.nextWireId||1,...retain.map(e=>e.id+1),...nextEdges.map(e=>e.id+1)); + nextEdges=nextEdges.map(e=>{if(taken.has(e.id))e.id=seq++;taken.add(e.id);return e;}); + nextEdges=[...retain,...nextEdges]; + const valid=ArSonWireGraph.validateCandidateGraph(nextTracks,nextMaster.id,nextEdges); + if(!valid.ok){say('SCENE REJECTED: '+valid.error+' · current graph kept');return;} + if(sofEnabled)toggleSof(false); + tracks=nextTracks;master=nextMaster;wireEdges=nextEdges; + nextId=Math.max(scene.nextId||1,...tracks.map(t=>t.id+1),master.id+1); + nextGroup=scene.nextGroup||1;nextWireId=Math.max(seq,...wireEdges.map(e=>e.id+1),1); + wireMode=scene.wireMode||'send';wireSourceId=scene.wireSourceId||null; + wireAnchorId=scene.wireAnchorId??null;selectedWireEdgeId=null; + wireWsHistory=[];wireWsInspect=null;wireWsRemoveConfirm=null; + document.getElementById('wireMode').value=wireMode; + document.getElementById('viewFilter').value=scene.filter; + syncWireOutputProjection(); + setDensity(scene.density||(scene.narrow?'compact':'comfort')); + render();say('Scene '+scene.name+' accepted · reference graph only'); +} +function groupSelected(){ + const selected=selection().filter(t=>t.kind!=='master'); + if(selected.length<2){say('Ctrl-click at least two channels to create a group');return;} + const group='G'+nextGroup++;selected.forEach(t=>t.group=group); + render();say('Linked '+selected.length+' channels in '+group+' (relative faders and M/S)'); +} +function ungroupSelected(){ + const selected=selection().filter(t=>t.kind!=='master'),groups=new Set(selected.map(t=>t.group).filter(Boolean)); + tracks.forEach(t=>{if(groups.has(t.group))t.group=null;}); + render();say(groups.size?'Removed '+groups.size+' channel group(s)':'Select a grouped channel to ungroup'); +} +function handleField(event){ + const el=event.target,field=el.dataset.field;if(!field)return; + const t=findTrack(el);if(!t)return; + if(field==='wireGain'){ + const edge=wireEdges.find(x=>x.id===Number(el.dataset.wireId)&&x.destId===t.id); + if(!edge){say('WIRE gain rejected: stale connection');return;} + const previous=edge.levelDb; + if(!wireGraphCommit([{type:'GAIN',sourceId:edge.sourceId,edgeId:edge.id, + levelDb:wireGainValue(el.value)}],{record:false})){el.value=previous;return;} + const accepted=wireFor(edge.sourceId,edge.destId); + if(el.style?.setProperty)el.style.setProperty('--wire-pct',wireGainPercent(accepted.levelDb)+'%'); + if(el.parentElement?.style?.setProperty){el.parentElement.style.setProperty('--wire-pct',wireGainPercent(accepted.levelDb)+'%');el.parentElement.style.setProperty('--wire-deg',(-135+wireGainPercent(accepted.levelDb)*2.7).toFixed(1)+'deg');} + if(el.parentElement)el.parentElement.title=wireDbText(accepted.levelDb); + if(event.type==='change')say('WIRE '+tracks.find(x=>x.id===edge.sourceId)?.name+' → '+t.name+' · '+wireDbText(accepted.levelDb)+' · GUI DEMO ONLY'); + return; + } + if(field==='fx'){t.fx[Number(el.dataset.slot)]=el.value;t.slotBypass[Number(el.dataset.slot)]=false;say(t.name+' · FX '+(Number(el.dataset.slot)+1)+': '+el.value);refreshStrip(t);} + else if(field==='level'){ + if(sofEnabled&&t.kind==='audio'){ + if(setSofLevel(t,Number(el.value))){const readout=el.closest('.strip')?.querySelector('.db-value');if(readout)readout.textContent='S '+formatDb(getSofLevel(t));syncFaderVisual(t,el.closest('.strip'));if(event.type==='change')say(t.name+' → '+sofTarget+' send '+formatDb(getSofLevel(t))+' dB');} + else el.value=getSofLevel(t); + return; + } + const old=t.level;t.level=Number(el.value); + const root=el.closest('.strip');syncFaderVisual(t,root); + if(t.group&&!event.altKey){ + const delta=t.level-old; + tracks.filter(peer=>peer.group===t.group&&peer.id!==t.id).forEach(peer=>{ + peer.level=Math.max(-60,Math.min(10,Math.round((peer.level+delta)*10)/10)); + const other=document.querySelector('.strip[data-id="'+peer.id+'"]'); + if(other){const fader=other.querySelector('.fader'),db=other.querySelector('.db-value');if(fader)fader.value=peer.level;if(db)db.textContent=formatDb(peer.level);syncFaderVisual(peer,other);} + }); + } + if(event.type==='change')say(t.name+' fader '+formatDb(t.level)+' dB'+(t.group?' (linked '+t.group+')':'')); +} + else if(field==='pan'){ + let value=Number(el.value);if(!Number.isFinite(value))return; + value=Math.max(-100,Math.min(100,value)); + // Hardware-like center detent: capture inside ±7, hold through ±12, + // release outside ±12. A finished drag inside ±12 snaps to dead center. + // Keyboard arrows remain fine-resolution (bypass sticky detent). + const keyboard=el.dataset.panKeyboard==='true'; + const bypass=!!event.altKey||el.dataset.panAltPointer==='true'; + const latched=el.dataset.panDetent==='true'; + const range=event.type==='change'?12:latched?12:7; + if(!keyboard&&!bypass&&Math.abs(value)<=range){value=0;el.value='0';} + el.dataset.panDetent=String(!keyboard&&value===0&&!bypass); + if(event.type==='change')delete el.dataset.panKeyboard; + t.pan=value; + el.setAttribute?.('aria-valuetext',value===0?'Center':value<0?'Left '+Math.abs(value):'Right '+value); + const wrapper=el.closest('.pan-control'); + if(wrapper){wrapper.setAttribute('style',panStyle(value));wrapper.classList?.toggle('is-centered',value===0);} + const label=wrapper?wrapper.nextElementSibling:el.nextElementSibling; + if(label)label.textContent=panLabel(value); + if(event.type==='change')say(t.name+' pan '+panLabel(value)); +} + else if(field==='trim'){t.trim=Number(el.value);if(el.style?.setProperty)el.style.setProperty('--range-pct',rangePct(t.trim,-24,24)+'%');const readout=el.closest('.trim-section')?.querySelector('.trim-value');if(readout)readout.textContent=formatDb(t.trim);if(event.type==='change')say(t.name+' digital trim '+formatDb(t.trim)+' dB');} + else if(field==='sendLevel'){t.sendLevel=Number(el.value);if(el.style?.setProperty)el.style.setProperty('--range-pct',rangePct(t.sendLevel,-60,6)+'%');el.nextElementSibling.textContent=formatDb(t.sendLevel);} + else if(field==='sendPan'){t.sendPan=Number(el.value);el.nextElementSibling.textContent=t.sendPan===0?'C':t.sendPan<0?'L'+Math.abs(t.sendPan):'R'+t.sendPan;} + else if(field==='activeSend'){const slot=Number(el.value.slice(1))-1;if(slot<0||slot>=16)return;openSendSlot(t,slot);refreshStrip(t);say(t.name+' · selected Send '+(slot+1));return;} + else if(field==='output'){ + if(t.kind==='master'){t.output=el.value;say('Physical MAIN output → '+el.value+' · reference only');return;} + const current=wireEdges.find(edge=>edge.sourceId===t.id&&edge.kind==='primary'); + const selected=el.value,dest=selected==='Master'?master:tracks.find(ch=>ch.name===selected); + const ops=[]; + if(selected==='SOURCE ONLY (No Main)'){ + if(current)ops.push({type:'REMOVE',sourceId:t.id,edgeId:current.id}); + }else if(dest&&dest.kind==='master'){ + if(current&¤t.destId!==master.id)ops.push({type:'REMOVE',sourceId:t.id,edgeId:current.id}); + if(!wireFor(t.id,master.id))ops.push({type:'CONNECT',sourceId:t.id,destId:master.id}); + }else if(dest){ + ops.push({type:'ROUTE_ONLY',sourceId:t.id,destId:dest.id}); + }else{ + say('Unsupported internal OUT: use physical I/O setup'); + refreshStrip(t);return; + } + if(ops.length&&!wireGraphCommit(ops)){refreshStrip(t);return;} + render();say('OUT '+t.name+' → '+t.output+' · canonical graph reference');return; + } + else if(field==='input'){ + const split=parseSplitSource(el.value); + const ops=wireEdges.filter(e=>e.destId===t.id&&e.kind==='split').map(e=> + ({type:'REMOVE',sourceId:e.sourceId,edgeId:e.id})); + if(split){ + if(!wireSourceTrack(split.sourceId)||split.sourceId===t.id){ + say('SPLIT REJECTED: invalid source');refreshStrip(t);return; + } + ops.push({type:'CONNECT',sourceId:split.sourceId,destId:t.id,mode: + split.tap==='PRE'?'splitPre':'splitPost'}); + } + if(ops.length&&!wireGraphCommit(ops)){refreshStrip(t);return;} + t.input=el.value;render(); + say(split?'SPLIT accepted in reference graph · no native PCM': + t.name+' physical input → '+el.value+' · reference only');return; + } + else if(field==='send'){say('Legacy SEND slot is display-only; patch via WIRE');refreshStrip(t);return;} + else{t[field]=el.value;say(t.name+' '+field+' → '+el.value);} + if(['send','sendLevel','sendPan'].includes(field))syncActiveSend(t); + selectTrack(t); +} + +/* Real pointer fader binding for the isolated reference. + One gesture, no rebuilding strips during drag, and source range remains keyboard-accessible. + The 29x62 visual cap center is aligned to this same travel ruler. */ +let faderGesture=null; +const consoleBody=document.querySelector('.console-body'); +function setFaderFromPointer(ev,gesture){ + const input=gesture.input,travel=gesture.travel?.getBoundingClientRect?.(); + if(!travel||travel.height<=0)return; + const max=Number(input.max)||10,min=Number(input.min)||-60; + const frac=Math.max(0,Math.min(1,(ev.clientY-travel.top)/travel.height)); + const gain=Math.round((max-(max-min)*frac)*10)/10; + input.value=String(gain); + handleField({target:input,type:'input',altKey:!!ev.altKey}); +} +consoleBody.addEventListener('pointerdown',ev=>{ + if(ev.button!==undefined&&ev.button!==0)return; + // The live receiving socket and its near-side well are a physical cable plug. + // Respect adjacent OUT, gain and remove targets, never steal their pointer. + const directIn=ev.target.closest?.('.wire-node-in'); + const tray=!directIn?ev.target.closest?.('.wire-tray'):null; + const other=ev.target.closest?.('.wire-node-out,.wire-pot'); + const socket=directIn||(!other?tray?.querySelector?.('.wire-node-in'):null); + const receiver=socket?findTrack(socket):null; + const activeSource=armedWireSource(); + const selectedSources=selection().filter(t=>t.kind!=='master'); + // MAIN has N summed incoming edges; the physical jack presents exactly ONE + // focused edgeId. Resolve that committed identity before pointer capture, + // rather than depending on selection timing or any hidden primary OUT field. + const mainEdgeId=receiver?.kind==='master'? + Number(socket.getAttribute('data-wire-main-edge')):null; + const focusedMainEdge=Number.isSafeInteger(mainEdgeId)&&mainEdgeId>0? + wireEdges.find(e=>e.enabled&&e.id===mainEdgeId&&e.destId===master.id):null; + const incoming=receiver?(receiver.kind==='master'? + (focusedMainEdge?[focusedMainEdge]:[]):incomingWireEdges(receiver.id)):[]; + const existing=incoming.find(e=>e.id===selectedWireEdgeId)|| + (incoming.length===1?incoming[0]: + (activeSource&&receiver?wireFor(activeSource.id,receiver.id):null)); + const socketRect=existing?socket.getBoundingClientRect?.():null; + const near=!!socketRect&&Math.hypot(ev.clientX-(socketRect.left+socketRect.width/2),ev.clientY-(socketRect.top+socketRect.height/2))<=22; + if(existing&&near){ + wireSuppressClick=false; + wireGesture={pointerId:ev.pointerId,sourceId:existing.sourceId,originDestId:receiver.id, + movingEdgeId:existing.id,startX:ev.clientX,startY:ev.clientY, + point:{x:ev.clientX,y:ev.clientY},snapId:receiver.id,active:false}; + ev.preventDefault?.(); + socket.setPointerCapture?.(ev.pointerId); + return; + } + const node=ev.target.closest?.('.wire-node-out'); + if(node){ + const src=findTrack(node); + if(src&&src.kind!=='master'&&Number.isFinite(ev.clientX)&&Number.isFinite(ev.clientY)){ + wireSuppressClick=false; + wireGesture={pointerId:ev.pointerId,sourceId:src.id,startX:ev.clientX,startY:ev.clientY, + point:{x:ev.clientX,y:ev.clientY},originDestId:null,movingEdgeId:null,snapId:null,active:false}; + ev.preventDefault?.(); + node.setPointerCapture?.(ev.pointerId); + return; + } + } + const pan=ev.target.closest?.('.center-pan'); + if(pan){delete pan.dataset.panKeyboard;pan.dataset.panAltPointer=String(!!ev.altKey);return;} + const box=ev.target.closest?.('.fader-box'); + if(!box)return; + const input=box.querySelector('.fader'),travel=box.querySelector('.fader-travel'); + if(!input||!travel)return; + ev.preventDefault?.(); + faderGesture={pointerId:ev.pointerId,box,input,travel}; + box.setPointerCapture?.(ev.pointerId); + setFaderFromPointer(ev,faderGesture); +}); +window.addEventListener('pointermove',ev=>{ + if(wireGesture&&ev.pointerId===wireGesture.pointerId){ + const g=wireGesture; + if(!Number.isFinite(ev.clientX)||!Number.isFinite(ev.clientY))return; + if(!g.active&&Math.hypot(ev.clientX-g.startX,ev.clientY-g.startY)>=(g.movingEdgeId!==null?10:5)){ + g.active=true;wireHoverId=null; // source selection changes only on an accepted drop + if(g.movingEdgeId!==null)consoleBody.querySelector?.('.strip[data-id="'+g.originDestId+'"] .wire-node-in')?.classList.add('is-replug-origin'); + consoleBody.classList.add('wire-dragging'); + consoleBody.querySelector?.('.strip[data-id="'+g.sourceId+'"] .wire-node-out')?.classList.add('is-drag-origin'); + } + if(g.active){g.point={x:ev.clientX,y:ev.clientY};queueWireGestureFrame();} + return; + } + if(!faderGesture||ev.pointerId!==faderGesture.pointerId)return; + setFaderFromPointer(ev,faderGesture); +}); +function finishFaderPointer(ev){ + if(wireGesture&&ev.pointerId===wireGesture.pointerId){ + const g=wireGesture; + const snap=g.active?wireSnapTarget({x:ev.clientX,y:ev.clientY},g.sourceId,g.originDestId,'release'):null; + wireGesture=null;setWireSnapTarget(null); + consoleBody.querySelector?.('.strip[data-id="'+g.originDestId+'"] .wire-node-in')?.classList.remove('is-replug-origin'); + consoleBody.classList.remove('wire-dragging'); + consoleBody.querySelectorAll?.('.wire-node-out.is-drag-origin').forEach(n=>n.classList.remove('is-drag-origin')); + if(g.active){ + if(g.movingEdgeId!==null){ + const bay=consoleBody.querySelector('.strip .send-section')?.getBoundingClientRect(); + const vp=document.getElementById('viewport')?.getBoundingClientRect(); + const masterBay=masterEl.querySelector('.send-section')?.getBoundingClientRect(); + const blankMainBay=!snap&&masterBay&&ev.clientX>=masterBay.left&& + ev.clientX<=masterBay.right&&ev.clientY>=masterBay.top&&ev.clientY<=masterBay.bottom; + const blankInBay=!snap&&((bay&&vp&&ev.clientX>=vp.left&&ev.clientX<=vp.right&& + ev.clientY>=bay.top&&ev.clientY<=bay.bottom)||blankMainBay); + const edge=wireEdges.find(e=>e.id===g.movingEdgeId&&e.destId===g.originDestId); + if(!edge||(!snap&&!blankInBay)){ + say('WIRE drop canceled · invalid area; routing unchanged'); + }else{ + const before=wireWsSnapshot(); + if(replugWireEdge(g.sourceId,g.originDestId,snap?.track.id??null)){ + wireWsRecord(before); + selectedWireEdgeId=snap?g.movingEdgeId:null; + } + } + }else{ + const hit=document.elementFromPoint?.(ev.clientX,ev.clientY)||ev.target; + const input=snap?.element||hit?.closest?.('.wire-node-in'); + const target=snap?.track||(input?findTrack(input):null),source=wireSourceTrack(g.sourceId); + if(target&&source&&target.id!==source.id){ + wireSourceId=source.id;wireSourcePinned=true;wireIntent=true;wireAnchorId=target.id; + requestWireConnection(source,target,input); + }else say('WIRE drop canceled · release in destination WIRE bay (graph unchanged)'); + } + renderWireRouting();wireSuppressClick=true; + }else if(g.sourceId){wireSuppressClick=false;} + return; + } + for(const pan of consoleBody.querySelectorAll?.('.center-pan[data-pan-alt-pointer]')||[]) + delete pan.dataset.panAltPointer; + if(!faderGesture||ev.pointerId!==faderGesture.pointerId)return; + setFaderFromPointer(ev,faderGesture); + const g=faderGesture;faderGesture=null; + g.box.releasePointerCapture?.(ev.pointerId); + const t=findTrack(g.input); + if(t)say(t.name+' fader '+formatDb(sofEnabled&&t.kind==='audio'?getSofLevel(t):t.level)+' dB'); +} +window.addEventListener('pointerup',finishFaderPointer); +window.addEventListener('pointercancel',ev=>{ + if(wireGesture&&ev.pointerId===wireGesture.pointerId){const g=wireGesture;wireGesture=null;setWireSnapTarget(null);consoleBody.querySelector?.('.strip[data-id="'+g.originDestId+'"] .wire-node-in')?.classList.remove('is-replug-origin');consoleBody.classList.remove('wire-dragging');consoleBody.querySelectorAll?.('.wire-node-out.is-drag-origin').forEach(n=>n.classList.remove('is-drag-origin'));renderWireRouting();say('WIRE drag canceled · graph unchanged');} + if(faderGesture&&ev.pointerId===faderGesture.pointerId)faderGesture=null; + for(const pan of consoleBody.querySelectorAll?.('.center-pan[data-pan-alt-pointer]')||[]) + delete pan.dataset.panAltPointer; +}); + +consoleBody.addEventListener('keydown',event=>{ + const el=event.target.closest?.('.center-pan'); + if(el&&['ArrowLeft','ArrowRight','ArrowUp','ArrowDown','PageUp','PageDown','Home','End'].includes(event.key)) + el.dataset.panKeyboard='true'; +}); +document.querySelector('.console-body').addEventListener('input',handleField); +document.querySelector('.console-body').addEventListener('change',handleField); +document.querySelector('.console-body').addEventListener('click',e=>{ + const btn=e.target.closest('[data-action]');if(!btn)return; + const t=findTrack(btn);if(!t)return; + const a=btn.dataset.action; + if(a==='wireExpand'){document.querySelector('.section-rail [data-section="send"]')?.click();return;} + if(a==='resetClip'){ + t.clip=false;btn.classList.remove('clipping'); + btn.closest('.fader-section')?.querySelector('.peak')?.classList.remove('clipping'); + say(t.name+' · clip latch cleared');return; + } + if(wireSuppressClick&&['wireSource','wireRoute'].includes(a)){wireSuppressClick=false;return;} + if(a==='wireSource'){ + selectWireSource(t);return; + } + if(a==='wireRoute'){ + const source=armedWireSource(); + const inbound=t.kind==='master'?[]:wireWsRoutes().filter(route=>route.destId===t.id); + // An armed OUT has priority for a NEW route, including BUS receivers + // already fed by other channels. Inspect only without a valid armed source, + // on the source's own IN, or when that exact source -> IN already exists. + // This preserves Route Only / Parallel and avoids implicit disconnects. + const sourceAlreadyInbound=!!source&&inbound.some(route=>route.sourceId===source.id); + if(t.kind!=='master'&&inbound.length&&(!source||t.id===source.id||sourceAlreadyInbound)){ + inspectIncomingWireRoutes(t);return; + } + if(t.kind==='master'){ + const selected=selection().filter(x=>x.kind!=='master'); + const focused=source||(selected.length===1?selected[0]:null); + if(!focused){say('Select one channel to inspect MAIN');return;} + const edge=wireFor(focused.id,master.id); + if(edge){selectWireEdge(edge);return;} + requestWireConnection(focused,t,btn);return; + } + if(!source||t.id===source.id){say('Select a source and another destination');return;} + if(e.shiftKey&&wireAnchorId!==null){wireConnectRange(source,wireAnchorId,t.id);wireAnchorId=t.id;return;} + requestWireConnection(source,t,btn);wireAnchorId=t.id;return; + } + if(a==='rename'||a==='editIdentity')return; // double-click edits; single-click selects + if(a==='format'&&t.kind==='audio'){t.format=t.format==='mono'?'stereo':'mono';refreshStrip(t);say(t.name+' processing → '+t.format.toUpperCase()+' · physical source '+t.input+' unchanged (reference only)');return;} + if(a==='openPlugin'){openFastPicker(t,Number(btn.dataset.slot),btn);return;} + if(a==='removeFx'){if(deferNativeFxIntent('Remove FX insert'))return;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);say(t.name+' · cleared FX insert '+(i+1));return;} + if(a==='slotPower'){if(deferNativeFxIntent('FX insert bypass'))return;const slot=Number(btn.dataset.slot);if(t.fx[slot]==='None'){say(t.name+': choose an effect before toggling bypass');return;}t.slotBypass[slot]=!t.slotBypass[slot];refreshStrip(t);say(t.name+': FX '+(slot+1)+(t.slotBypass[slot]?' bypassed':' enabled'));return;} + if(a==='eq')t.eq=!t.eq; + else if(a==='fxOn'){if(deferNativeFxIntent('FX chain bypass'))return;t.fxOn=!t.fxOn;} + else if(a==='pre'){t.pre=!t.pre;syncActiveSend(t);} + else if(a==='sendOn'){say('Legacy SEND disabled; patch via WIRE');return;} + else if(['mute','solo','cue','mon','phase'].includes(a)){ + t[a]=!t[a]; + if(t.group&&(a==='mute'||a==='solo')){ + tracks.filter(other=>other.group===t.group&&other.id!==t.id).forEach(other=>{other[a]=t[a];refreshStrip(other);}); + } + } + refreshStrip(t);selectTrack(t);if(a==='solo'&&document.getElementById('viewFilter').value==='solo')render();say(t.name+': '+a+' '+(t[a]?'on':'off')); +}); +document.querySelector('.console-body').addEventListener('dblclick',e=>{ + const t=findTrack(e.target);if(!t)return; + if(e.target.closest?.('.wire-gain,.wire-pot')){ + const el=e.target.closest('.wire-pot')?.querySelector('.wire-gain')||e.target.closest('.wire-gain');el.value='0';handleField({target:el,type:'change'});return; + } + if(e.target.classList.contains('fader')){t.level=0;refreshStrip(t);say(t.name+' fader reset to 0.0 dB');} + if(e.target.classList.contains('center-pan')){t.pan=0;refreshStrip(t);say(t.name+' pan centered');} + if(e.target.closest('.footer-label,.strip-identity-top'))openChannelIdentity(t,e.target); +}); +/* V16: rearrange channel model order by stable IDs, never swap signal + processors, channel IDs, existing patch edges, or pinned MAIN. */ +let channelDragId=null; +function moveChannelTo(id,destId,after=false){ + if(id===destId)return false; + const i=tracks.findIndex(t=>t.id===id),dest=tracks.find(t=>t.id===destId); + if(i<0||!dest)return false; + const item=tracks.splice(i,1)[0],j=tracks.indexOf(dest); + tracks.splice(j+(after?1:0),0,item); + return true; +} +function clearChannelDrag(){ + channelDragId=null; + document.querySelectorAll('#tracks .strip').forEach(el=> + el.classList.remove('channel-dragging','channel-drop-before','channel-drop-after')); +} +const arrangeSurface=document.querySelector('.console-body'); +arrangeSurface.addEventListener('dragstart',e=>{ + const header=e.target.closest?.('.strip-identity-top[draggable="true"]'); + if(!header)return; + const t=findTrack(header);if(!t||t.kind==='master')return; + channelDragId=t.id; + e.dataTransfer?.setData('application/x-arsonmix-channel',String(t.id)); + if(e.dataTransfer)e.dataTransfer.effectAllowed='move'; + header.closest('.strip').classList.add('channel-dragging'); +},true); +arrangeSurface.addEventListener('dragover',e=>{ + if(channelDragId===null)return; + const target=e.target.closest?.('#tracks .strip');if(!target)return; + e.preventDefault(); + if(e.dataTransfer)e.dataTransfer.dropEffect='move'; + document.querySelectorAll('#tracks .strip').forEach(el=> + el.classList.remove('channel-drop-before','channel-drop-after')); + const after=e.clientX>=target.getBoundingClientRect().left+target.getBoundingClientRect().width/2; + target.classList.add(after?'channel-drop-after':'channel-drop-before'); +},true); +arrangeSurface.addEventListener('drop',e=>{ + if(channelDragId===null)return; + e.preventDefault();e.stopPropagation(); + const target=e.target.closest?.('#tracks .strip'),id=channelDragId; + const destId=Number(target?.dataset.id); + const after=!!target&&e.clientX>=target.getBoundingClientRect().left+target.getBoundingClientRect().width/2; + clearChannelDrag(); + if(!target||!moveChannelTo(id,destId,after))return; + const t=tracks.find(x=>x.id===id); + render();say(t.name+' moved to strip '+(tracks.indexOf(t)+1)+' · signal routing unchanged'); +},true); +arrangeSurface.addEventListener('dragend',clearChannelDrag,true); +arrangeSurface.addEventListener('keydown',e=>{ + if(!e.altKey||!['ArrowLeft','ArrowRight'].includes(e.key))return; + const top=e.target.closest?.('.strip-identity-top');if(!top)return; + const t=findTrack(top),i=t?tracks.indexOf(t):-1,step=e.key==='ArrowRight'?1:-1; + if(i<0||i+step<0||i+step>=tracks.length)return; + e.preventDefault();e.stopPropagation(); + if(!moveChannelTo(t.id,tracks[i+step].id,step>0))return; + render(Math.floor((i+step)/bankCapacity())); + document.querySelector('#tracks .strip[data-id="'+t.id+'"] .strip-identity-top')?.focus(); + say(t.name+' moved '+(step>0?'right':'left')+' · channel ID unchanged'); +},true); +/* FX V53: the focused 16px grip alone owns drag; no row-wide HTML DnD. + No state mutation on dragover, cross-channel drop, Escape, or dragend. */ +function clearFxDrag(){ + fxDrag=null; + consoleBody.querySelectorAll('.fxslot-row').forEach(row=> + row.classList.remove('dragged','drop-before','drop-after')); +} +consoleBody.addEventListener('dragstart',e=>{ + const grip=e.target.closest?.('.fx-grip[draggable="true"]'); + if(!grip||!e.dataTransfer)return; + const row=grip.closest('.fxslot-row'),t=findTrack(grip),slot=Number(row?.dataset.slot); + if(!t||!Number.isInteger(slot)||t.fx[slot]==='None'||fxNativeTransactionRequired()){ + e.preventDefault();say('FX reorder unavailable without accepted native operation');return; + } + ensureFxInsertIds(t); + const insertId=t.fxInsertIds[slot]?.id; + if(!insertId||insertId!==grip.dataset.insertId){e.preventDefault();return;} + fxDrag={channelId:t.id,slot,insertId}; + e.dataTransfer.effectAllowed='move'; + e.dataTransfer.setData('application/x-arsonmix-fx',t.id+':'+insertId); + row.classList.add('dragged'); +},true); +consoleBody.addEventListener('dragover',e=>{ + if(!fxDrag)return; + const row=e.target.closest?.('.fxslot-row'),t=row&&findTrack(row); + if(!row)return; + e.preventDefault(); + const slot=Number(row.dataset.slot); + const valid=t?.id===fxDrag.channelId&&t.fx[slot]!=='None'&&slot!==fxDrag.slot; + if(e.dataTransfer)e.dataTransfer.dropEffect=valid?'move':'none'; + consoleBody.querySelectorAll('.fxslot-row').forEach(x=>x.classList.remove('drop-before','drop-after')); + if(valid)row.classList.add(slot{ + if(!fxDrag)return; + const row=e.target.closest?.('.fxslot-row'); + if(!row){clearFxDrag();return;} + e.preventDefault();e.stopPropagation(); + const gesture=fxDrag,t=findTrack(row),to=Number(row.dataset.slot); + clearFxDrag(); + if(!t||t.id!==gesture.channelId){say('Cross-channel FX transfer refused: native plugin state/lease not transferable');return;} + ensureFxInsertIds(t); + if(t.fxInsertIds[gesture.slot]?.id!==gesture.insertId){say('FX reordered elsewhere; canceled stale drag');return;} + if(!moveReferenceFx(t,gesture.slot,to))say('FX move canceled · order unchanged'); +},true); +consoleBody.addEventListener('dragend',clearFxDrag,true); +consoleBody.addEventListener('keydown',e=>{ + const grip=e.target.closest?.('.fx-grip'); + if(!grip)return; + const t=findTrack(grip),from=Number(grip.dataset.slot); + if(!t)return; + if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==='z'){ + e.preventDefault();undoReferenceFx(t);return; + } + if(e.altKey&&!e.ctrlKey&&!e.metaKey&&['ArrowUp','ArrowDown'].includes(e.key)){ + e.preventDefault(); + const used=t.fx.map((name,i)=>name==='None'?-1:i).filter(i=>i>=0); + const current=used.indexOf(from),next=used[current+(e.key==='ArrowUp'?-1:1)]; + if(Number.isInteger(next)&&!moveReferenceFx(t,from,next)) + say('FX move unavailable'); + } +},true); +document.addEventListener('keydown',e=>{ + if(e.key==='Escape'&&fxDrag){clearFxDrag();e.preventDefault();} +},true); +document.querySelector('.console-body').addEventListener('pointerover',e=>{ + const btn=e.target.closest?.('[data-action="wireRoute"]'); + const t=btn?findTrack(btn):null; + if(wireGesture?.active||!t||t.kind==='master'||t.id===wireSourceId||wireHoverId===t.id)return; + wireHoverId=t.id;renderWireRouting(); +}); +document.querySelector('.console-body').addEventListener('pointerout',e=>{ + if(wireHoverId===null)return; + const btn=e.target.closest?.('[data-action="wireRoute"]'); + if(!btn)return; + if(e.relatedTarget?.closest?.('[data-action="wireRoute"]')===btn)return; + wireHoverId=null;renderWireRouting(); +}); +// Pointer-relative knob: 198px of travel over 66dB instead of a 22px hit area. +let sendKnobDrag=null; +const sendControlSurface=document.querySelector('.console-body'); +sendControlSurface.addEventListener('pointerdown',e=>{ + const pot=e.target.closest?.('.wire-pot:not(.is-idle)'); + if(!pot||e.button!==0)return; + const input=pot.querySelector('.wire-gain');if(!input)return; + wireIntent=true; + sendKnobDrag={id:e.pointerId,pot,input,x:e.clientX,y:e.clientY,start:Number(input.value)||0}; + const edge=wireEdges.find(x=>x.id===Number(input.dataset.wireId)); + if(edge){wireSourceId=edge.sourceId;wireSourcePinned=true;} + pot.setPointerCapture?.(e.pointerId);e.preventDefault();e.stopPropagation(); +}); +sendControlSurface.addEventListener('pointermove',e=>{ + const g=sendKnobDrag;if(!g||g.id!==e.pointerId)return; + const distance=e.clientX-g.x-(e.clientY-g.y),next=wireGainValue(g.start+distance/(e.shiftKey?14:3)); + if(Number(g.input.value)!==next){g.input.value=String(next);handleField({target:g.input,type:'input'});} + e.preventDefault(); +}); +function finishSendKnob(e,cancel=false){ + const g=sendKnobDrag;if(!g||g.id!==e.pointerId)return; + sendKnobDrag=null;g.pot.releasePointerCapture?.(e.pointerId); + if(cancel){g.input.value=String(g.start);handleField({target:g.input,type:'input'});say('SEND gain canceled · original gain restored');} + else handleField({target:g.input,type:'change'}); + // Keep the SAME knob DOM through click/double-click. Replacing its node on pointerup + // swallows the second click and breaks unity reset. Only repaint the SVG/status. + renderWireRouting();e.preventDefault(); +} +sendControlSurface.addEventListener('pointerup',e=>finishSendKnob(e)); +sendControlSurface.addEventListener('pointercancel',e=>finishSendKnob(e,true)); +/* V49: shared bounded range control for hardware mouse + precision trackpad. + Handle the physical fader face, not its intentionally pointer-inert input. */ +const wheelResidue=new WeakMap(); +document.querySelector('.console-body').addEventListener('wheel',e=>{ + if(e.ctrlKey||wireGesture||faderGesture||!Number.isFinite(e.deltaY)||e.deltaY===0)return; + const target=e.target.closest?.('.wire-pot,.fader-box,input[type="range"]'); + if(!target)return; + const input=target.matches?.('input[type="range"]')?target: + target.querySelector?.('input[type="range"]'); + const allowed=new Set(['level','pan','wireGain','trim','sendLevel','sendPan']); + if(!input||input.disabled||!allowed.has(input.dataset.field))return; + const min=Number(input.min),max=Number(input.max),prev=Number(input.value); + if(![min,max,prev].every(Number.isFinite))return; + e.preventDefault(); + const pixels=e.deltaY*(e.deltaMode===1?16:e.deltaMode===2?240:1); + const accumulated=(wheelResidue.get(input)||0)+pixels; + const detents=Math.trunc(accumulated/100); + wheelResidue.set(input,accumulated-detents*100); + if(!detents)return; + const step=e.shiftKey?(input.dataset.field==='pan'||input.dataset.field==='sendPan'?1:.1): + (input.dataset.field==='pan'||input.dataset.field==='sendPan'?2:.5); + const resolution=Number(input.step)||.1; + const next=Math.round(Math.max(min,Math.min(max,prev-detents*step))/resolution)*resolution; + if(next===prev)return; + input.value=String(next); + if(input.dataset.field==='pan')input.dataset.panKeyboard='true'; + handleField({target:input,type:'input',altKey:e.altKey}); +},{passive:false}); +// Ordinary strip gestures may focus their channel, but touching the pinned +// MAIN receive jack must never change the *source* under inspection. Capture +// selection runs before bubble-phase wireGesture creation: selecting MAIN +// here used to destroy the unique CH focus and made its plug undraggable. +// MASTER identity remains separately selectable without affecting WIRE. +consoleBody.addEventListener('pointerdown',e=>{ + if(e.button!==0)return; + const t=findTrack(e.target); + if(t?.kind==='master'&&e.target.closest?.('.wire-node-in,.wire-tray,.wire-fold-summary')) + return; + if(t)selectTrack(t,e.ctrlKey||e.metaKey||e.shiftKey); +},true); +// Proximity uses one delegated pointer signal and static CSS, never a +// per-frame wire redraw, audio operation or DOM remount. +let nearWireOut=null; +consoleBody.addEventListener('pointermove',e=>{ + if(e.pointerType==='touch'||e.buttons||wireGesture?.active){ + // A stale approach highlight must never survive dragging or canceled drops. + nearWireOut?.classList.remove('is-near');nearWireOut=null;return; + } + const tray=e.target.closest?.('.wire-tray'); + let out=tray?.querySelector('.wire-node-out:not(:disabled)')||null; + if(out){ + const r=out.getBoundingClientRect(); + if(Math.hypot(e.clientX-(r.left+r.width/2),e.clientY-(r.top+r.height/2))>Math.max(r.width,r.height)/2+16)out=null; + } + if(nearWireOut!==out){ + nearWireOut?.classList.remove('is-near'); + nearWireOut=out;nearWireOut?.classList.add('is-near'); + } +}); +consoleBody.addEventListener('pointerleave',()=>{ + nearWireOut?.classList.remove('is-near');nearWireOut=null; +}); +// The 16px OUT proximity halo is clickable without enlarging its hardware. + // IN, knob and other data actions keep their own event owners. +consoleBody.addEventListener('click',e=>{ + if(e.target.closest?.('.wire-node-out,.wire-node-in,.wire-pot,[data-action]'))return; + const tray=e.target.closest?.('.wire-tray'); + const out=tray?.querySelector('.wire-node-out.is-near:not(:disabled)'); + const source=out?findTrack(out):null; + if(!source||source.kind==='master')return; + e.stopPropagation(); // explicit patch, not a click-away + selectWireSource(source); +}); +// A click elsewhere releases the source; bank navigation, WIRE workspace +// and route-choice remain in the active routing workflow. +document.addEventListener('click',e=>{ + if(!armedWireSource()||wireGesture||pendingBusRoute)return; + if(e.target.closest?.('.wire-node-out,.wire-node-in,.wire-pot,.wire-disconnect,#wireWorkspace,#wireConfigWindow,#wireNavigatorToggle,#wireMatrixToggle,#wireConfigToggle,[data-wire-open],#routeChoice,#bankPrev,#bankNext,#bankSelect,#viewFilter,#wireMaster,[data-wire-destination],[data-wire-jump-source],.wire-offbank-source,.wire-v34-tool'))return; + clearWireIntent(); +}); +window.addEventListener('blur',()=>{ + if(armedWireSource()&&!wireGesture&&!pendingBusRoute)clearWireIntent(); +}); +document.querySelector('.section-rail').addEventListener('click',e=>{ + const button=e.target.closest('[data-section]');if(!button)return; + const name=button.dataset.section,body=document.querySelector('.console-body'); + if(body.classList.contains('narrow')&&['fx','send'].includes(name)){ + say('Exit Narrow view before expanding '+name.toUpperCase());return; + } + const collapsed=body.classList.toggle('collapsed-'+name); + button.classList.toggle('collapsed',collapsed); + button.setAttribute('aria-expanded',String(!collapsed)); + button.setAttribute('aria-pressed',String(!collapsed)); + button.title=(collapsed?'Expand ':'Collapse ')+name.toUpperCase()+' section'; + say((name==='send'?'WIRE PATCH BAY':name.toUpperCase())+(collapsed?' compact':' expanded')+' · FX rack and fader remain aligned'); + requestAnimationFrame(renderWireRouting); // FX rack changed height; redraw only after layout, never on an audio tick +}); +document.getElementById('viewFilter').addEventListener('change',()=>{render();say('Channel display filtered: '+document.getElementById('viewFilter').value);}); +document.getElementById('mode').addEventListener('click',()=>{ + const compact=document.querySelector('.console-body').classList.contains('narrow'); + const value=setDensity(compact?'comfort':'compact'); + say('Mixer density: '+value+' · all live controls remain reachable'); +}); +document.getElementById('densitySelect').addEventListener('change',()=>{ + const value=setDensity(document.getElementById('densitySelect').value); + say('Mixer density: '+value+' · Master remains pinned'); +}); +const moreTools=document.getElementById('moreTools'); +document.addEventListener('pointerdown',e=>{ + if(moreTools.open&&!moreTools.contains(e.target))moreTools.open=false; +},true); +document.addEventListener('focusin',e=>{ + if(moreTools.open&&!moreTools.contains(e.target))moreTools.open=false; +},true); +document.addEventListener('keydown',e=>{ + if(e.key==='Escape'&&moreTools.open){moreTools.open=false;e.preventDefault();} +}); +// Modeless configuration lives above the mixer: no persistent setup strip. +function setWireConfig(open,restoreFocus=false){ + const panel=document.getElementById('wireConfigWindow'); + const trigger=document.getElementById('wireConfigToggle'); + if(open&&wireWsOpen)document.getElementById('wireWsClose').click(); + panel.hidden=!open; + trigger.setAttribute('aria-expanded',String(open)); + if(open){renderWireRouting();document.getElementById('wireMode').focus();} + else if(restoreFocus)trigger.focus(); +} +document.getElementById('wireConfigToggle').addEventListener('click',()=>{ + setWireConfig(document.getElementById('wireConfigWindow').hidden); +}); +document.getElementById('wireConfigClose').addEventListener('click',()=>setWireConfig(false,true)); +document.getElementById('wireConfigWindow').addEventListener('keydown',e=>{ + if(e.key==='Escape'){e.preventDefault();e.stopPropagation();setWireConfig(false,true);} +}); +document.getElementById('copy').addEventListener('click',copyChannels); +document.getElementById('paste').addEventListener('click',pasteChannels); +document.getElementById('group').addEventListener('click',groupSelected); +document.getElementById('ungroup').addEventListener('click',ungroupSelected); +document.getElementById('saveScene').addEventListener('click',saveScene); +document.getElementById('recallScene').addEventListener('click',recallScene); +document.getElementById('sceneSafe').addEventListener('click',setSnapshotSafe); +function sayWireBankContext(base){ + const source=armedWireSource(); + const inBank=!!document.querySelector('#tracks .strip[data-id="'+source?.id+'"]'); + say(source&&!inBank?'FROM CH'+String(source.id).padStart(2,'0')+' ('+source.name+') kept · click an IN on this bank · '+base:base); +} +/* V33 persistent source + universal cross-bank destination. Semantic routing graph + uses stable channel IDs: never infer patch identity from bank position. */ + +/* V34 operator events: delegated inside one modeless WIRE workspace. */ +document.getElementById('wireNavigatorToggle').addEventListener('click',()=>wireWsToggle('find')); +document.getElementById('wireMatrixToggle').addEventListener('click',()=>wireWsToggle('matrix')); +document.querySelectorAll('[data-wire-open]').forEach(button=>button.addEventListener('click',()=>{ + moreTools.open=false; + const mode=button.dataset.wireOpen; + if(mode==='config')setWireConfig(true); + else wireWsToggle(mode==='matrix'?'matrix':'find'); +})); +document.getElementById('wireWsUndo').addEventListener('click',wireWsUndo); +document.getElementById('wireWsClose').addEventListener('click',()=>{ + wireWsOpen=false;document.getElementById('wireWorkspace').hidden=true; + document.getElementById('wireNavigatorToggle').setAttribute('aria-expanded','false'); + document.getElementById('wireMatrixToggle').setAttribute('aria-expanded','false'); +}); +document.getElementById('wireWorkspace').addEventListener('keydown',e=>{ + if(e.key==='Escape'){e.stopPropagation?.();document.getElementById('wireWsClose').click();} +}); +document.getElementById('wireWorkspace').addEventListener('click',e=>{ + const tab=e.target.closest?.('[data-ws-mode]'); + if(tab){wireWsChooseMode(tab.dataset.wsMode);return;} + const jump=e.target.closest?.('[data-ws-jump]'); + if(jump){wireWsJump(Number(jump.dataset.wsJump));return;} + const inspect=e.target.closest?.('[data-ws-inspect]'); + if(inspect){ + const parts=inspect.dataset.wsInspect.split(':').map(Number); + if(parts.length!==2||parts.some(x=>!Number.isInteger(x)))return; + wireWsInspect={src:parts[0],dst:parts[1]};wireWsRemoveConfirm=null; + renderWireWsInspector();return; + } + const disconnect=e.target.closest?.('[data-ws-remove]'); + if(disconnect){ + const key=disconnect.dataset.wsRemove; + if(wireWsRemoveConfirm!==key){wireWsRemoveConfirm=key;renderWireWsInspector();return;} + const parts=key.split(':').map(Number),edge=wireWsFindEdge(parts[0],parts[1]); + wireWsRemoveConfirm=null;wireWsInspect=null; + if(edge){const before=wireWsSnapshot();replugWireEdge(parts[0],parts[1],null);wireWsRecord(before);} + renderWireWorkspace();return; + } + const join=e.target.closest?.('[data-ws-join]'); + if(!join)return; + const parts=join.dataset.wsJoin.split(':').map(Number); + if(parts.length!==2||parts.some(x=>!Number.isInteger(x)))return; + const src=wireSourceTrack(parts[0]),dst=wireSourceTrack(parts[1]); + if(!src||!dst||src.id===dst.id)return; + const info=wireWsRouteKind(src.id,dst.id,wireWsRoutes()); + if(info){wireWsInspect={src:src.id,dst:dst.id};renderWireWsInspector();return;} + if(!wireWsCanJoin(src.id,dst.id)){ + say('WIRE rejected: feedback cycle or invalid destination · graph unchanged');return; + } + // A matrix crosspoint explicitly sets FROM. Normal destination-first TO BUS + // never moves the displayed mixer bank or a third-party routing endpoint. + if(wireWsMode!=='bus'&&(!armedWireSource()||armedWireSource().id!==src.id)) + selectWireSource(src); + const before=wireWsSnapshot(); + requestWireConnection(src,dst,join); + if(document.getElementById('routeChoice')?.hidden===false)wireWsPendingBefore=before; + else wireWsRecord(before); + renderWireWorkspace(); +}); +document.getElementById('wireWsSearch').addEventListener('input',e=>{ + wireWsQuery=String(e.target.value||'').slice(0,80);renderWireWorkspace(); +}); +document.getElementById('wireWsSourceSelect').addEventListener('change',e=>{ + const src=wireSourceTrack(Number(e.target.value)); + if(src)selectWireSource(src); + renderWireWorkspace(); +}); +document.getElementById('wireWsBus').addEventListener('change',e=>{ + const b=tracks.find(t=>t.id===Number(e.target.value)&&t.kind==='bus'); + if(b)wireWsBusId=b.id; + renderWireWorkspace(); +}); +document.getElementById('wireWsInspector').addEventListener('focusin',e=>{ + if(e.target.closest?.('[data-ws-gain],[data-ws-tap]'))wireWsEditBefore=wireWsSnapshot(); +}); +document.getElementById('wireWsInspector').addEventListener('input',e=>{ + const gain=e.target.closest?.('[data-ws-gain]'); + if(!gain)return; + const edge=wireEdges.find(x=>x.id===Number(gain.dataset.wsGain)&&x.enabled); + if(!edge||edge.destId===master.id)return; + const amount=Math.max(-60,Math.min(6,Math.round(Number(gain.value)||0))); + if(!wireGraphCommit([{type:'GAIN',sourceId:edge.sourceId,edgeId:edge.id, + levelDb:amount}],{record:false}))return; + document.getElementById('wireWsGainText').textContent=amount+' dB'; +}); +document.getElementById('wireWsInspector').addEventListener('change',e=>{ + const gain=e.target.closest?.('[data-ws-gain]'),tap=e.target.closest?.('[data-ws-tap]'); + if(tap){ + const edge=wireEdges.find(x=>x.id===Number(tap.dataset.wsTap)&&x.enabled); + if(!edge||!wireGraphCommit([{type:'MODE',sourceId:edge.sourceId,edgeId:edge.id, + mode:tap.value==='split'?'split':'send'}],{record:false}))return; + } + if(gain||tap){ + wireWsRecord(wireWsEditBefore);wireWsEditBefore=null;render();renderWireWorkspace(); + say('WIRE inspector accepted · reference graph only'); + } +}); + +document.getElementById('wireLegend').addEventListener('change',e=>{ + const picker=e.target.closest('[data-wire-destination]'); + if(!picker||!picker.value)return; + const source=armedWireSource(),dest=wireSourceTrack(Number(picker.value)); + picker.value=''; + if(!source||!dest||source.id===dest.id)return; + requestWireConnection(source,dest,picker); + // An off-screen destination remains represented by a named, accessible route + // badge/legend; never draw a fictional cable spanning unseen mixer pages. + renderWireRouting(); +}); +document.getElementById('wireLegend').addEventListener('click',e=>{ + if(!e.target.closest('[data-wire-jump-source]'))return; + const source=armedWireSource();if(!source)return; + const filter=document.getElementById('viewFilter'); + let shown=tracks.filter(t=>filter.value==='all'||(filter.value==='solo'?t.solo:t.kind===filter.value)); + if(!shown.some(t=>t.id===source.id)){filter.value='all';shown=tracks;} + const index=shown.findIndex(t=>t.id===source.id); + render(Math.floor(Math.max(0,index)/bankCapacity())); + say('Returned to CH'+String(source.id).padStart(2,'0')+' · SOURCE kept · choose another bank to patch remotely'); +}); +document.getElementById('bankSelect').addEventListener('change',()=>{render();sayWireBankContext('Switched mixer fader bank');}); +document.getElementById('bankPrev').addEventListener('click',()=>{ + const sel=document.getElementById('bankSelect'),n=visibleBankCount(); + if(!n){sel.value='all';render();say('No channels available in the active layer');return;} + const old=Number(sel.value)||0;sel.value=String((old-1+n)%n);render();sayWireBankContext('Previous fader bank'); +}); +document.getElementById('bankNext').addEventListener('click',()=>{ + const sel=document.getElementById('bankSelect'),n=visibleBankCount(); + if(!n){sel.value='all';render();say('No channels available in the active layer');return;} + const old=Number(sel.value)||0;sel.value=String((old+1)%n);render();sayWireBankContext('Next fader bank'); +}); +document.getElementById('wireMode').addEventListener('change',()=>{ + const selected=document.getElementById('wireMode').value; + wireMode=selected==='split'?'split':'send'; + say('WIRE MODE '+(wireMode==='send'?'FOLLOW FADER (FL-style send)':'INDEPENDENT (pre-insert mult)')+' · new edges only · GUI DEMO'); +}); +document.getElementById('wireView').addEventListener('change',()=>{ + const next=document.getElementById('wireView').value; + wireView=['focus','out'].includes(next)?next:'focus'; + renderWireRouting(); // Visualization only: never touch wireEdges or DSP state + say('WIRE VIEW '+(wireView==='focus'?'SELECTED · incoming and outgoing':'SELECTED OUT ONLY')+' · display only'); +}); +function toggleDirectMain(){ + const t=armedWireSource()||selection().find(x=>x.kind!=='master'); + if(!t){say('Select a channel for MAIN');return;} + const edge=wireFor(t.id,master.id); + const op=edge?{type:'REMOVE',sourceId:t.id,edgeId:edge.id}: + {type:'CONNECT',sourceId:t.id,destId:master.id}; + if(!wireGraphCommit([op]))return; + render();say(t.name+(edge?' MAIN unplugged':' MAIN connected')+' · reference only'); +} +document.getElementById('routeOnly').addEventListener('click',()=>commitRouteChoice('only')); +document.getElementById('routeParallel').addEventListener('click',()=>commitRouteChoice('parallel')); +document.getElementById('routeChoiceClose').addEventListener('click',closeRouteChoice); +document.getElementById('wireMaster').addEventListener('click',toggleDirectMain); +document.getElementById('sofToggle').addEventListener('click',()=>toggleSof()); +document.getElementById('sofTarget').addEventListener('change',()=>{sofTarget=document.getElementById('sofTarget').value;render();say('Sends target: '+sofTarget);}); +document.getElementById('addTrack').addEventListener('click',()=>{ + const n=tracks.filter(t=>t.kind==='audio').length+1,t=make('Track '+n,'audio',COLORS[(n-1)%COLORS.length]);const firstBus=tracks.findIndex(x=>x.kind==='bus');tracks.splice(firstBus<0?tracks.length:firstBus,0,t); + if(!wireGraphCommit([{type:'CONNECT',sourceId:t.id,destId:master.id}],{record:false})){tracks=tracks.filter(x=>x.id!==t.id);return;}revealTrack(t);say('Added '+t.name+' → MAIN · reference only'); +}); +document.getElementById('addFx').addEventListener('click',()=>{ + const n=tracks.filter(t=>t.kind==='fx').length+1,t=make('FX '+n,'fx','#8b709a'); + t.fx[0]='Studio Reverb';tracks.push(t);if(!wireGraphCommit([{type:'CONNECT',sourceId:t.id,destId:master.id}],{record:false})){tracks.pop();return;}revealTrack(t); + say('Added FX Return '+t.name+' · send destination with insert processing'); +}); +document.getElementById('addBus').addEventListener('click',()=>{ + const n=tracks.filter(t=>t.kind==='bus').length+1,t=make('Bus '+String.fromCharCode(65+((n-1)%26)),'bus','#846e9e');tracks.push(t);if(!wireGraphCommit([{type:'CONNECT',sourceId:t.id,destId:master.id}],{record:false})){tracks.pop();return;}revealTrack(t);say('Added '+t.name+' · visual only'); +}); +document.getElementById('clearCue').addEventListener('click',()=>{tracks.forEach(t=>t.cue=false);master.cue=false;render();say('All Cue / PFL requests cleared · no hardware monitor connected');}); +document.getElementById('reset').addEventListener('click',()=>{if(preview)togglePreview();document.getElementById('viewFilter').value='all';document.getElementById('bankSelect').value='all';sofEnabled=false;document.getElementById('sofToggle').classList.remove('active');document.getElementById('sofToggle').setAttribute('aria-pressed','false');document.querySelector('.console-body').classList.remove('sends-mode');setDensity('comfort');init();say('Reference mixer reset; saved scenes remain available.');}); + +// Browser-only catalog contract. Only the native host can actually scan or instantiate VST3. +const plugEl=id=>document.getElementById(id); +function pluginTargetLabel(){ + const t=activeFxTarget&&tracks.concat(master).find(x=>x.id===activeFxTarget.channelId); + return t? t.name+' · Insert '+(activeFxTarget.slot+1):'Select a channel + insert slot'; +} +function renderChannelIdentityChoices(){ + document.getElementById('identityIcons').innerHTML=CHANNEL_ICONS.map(icon=> + '' + ).join(''); + document.getElementById('identityColors').innerHTML=CHANNEL_PALETTE.map(color=> + '' + ).join(''); +} +function closeChannelIdentity(){identityTrackId=null;document.getElementById('channelIdentity').hidden=true;} +function openChannelIdentity(t,anchor){ + if(!t)return; + setFastPicker(false); // non-modal Plugin Manager remains usable while editing channels + identityTrackId=t.id;identityColor=t.color;identityIcon=iconFor(t); + const dialog=document.getElementById('channelIdentity'); + document.getElementById('identityTitle').textContent='CHANNEL IDENTITY · '+t.name; + document.getElementById('identityName').value=t.name; + renderChannelIdentityChoices();dialog.hidden=false; + const parent=document.querySelector('.console-pane'),a=anchor?.getBoundingClientRect?.(),p=parent?.getBoundingClientRect?.(); + if(a&&p&&dialog.style?.setProperty){ + dialog.style.setProperty('left',Math.max(8,Math.min(p.width-302,a.left-p.left+a.width/2-148))+'px'); + dialog.style.setProperty('top',Math.max(8,Math.min(p.height-295,a.top-p.top+18))+'px'); + } + document.getElementById('identityName').focus?.(); +} +function applyChannelIdentity(){ + const t=tracks.concat(master).find(x=>x.id===identityTrackId); + if(!t){closeChannelIdentity();return;} + const name=String(document.getElementById('identityName').value||'').trim().replace(/\s+/g,' ').slice(0,30); + if(!name){say('Channel name cannot be empty');return;} + if(tracks.concat(master).some(other=>other.id!==t.id&&other.name.toLowerCase()===name.toLowerCase())){ + say('Channel name already exists: '+name);return; + } + const old=t.name; + t.name=name;t.icon=CHANNEL_ICONS.includes(identityIcon)?identityIcon:iconFor(t); + t.color=CHANNEL_PALETTE.includes(identityColor)?identityColor:t.color; + tracks.forEach(x=>{ + if(x.output===old)x.output=name; + if(x.send===old)x.send=name; + x.sendSlots.forEach(slot=>{if(slot.send===old)slot.send=name;}); + }); + if(sofTarget===old)sofTarget=name; + closeChannelIdentity();render();say('Channel identity updated · '+name+' · routing references preserved'); +} +document.getElementById('identityClose').addEventListener('click',closeChannelIdentity); +document.getElementById('identityCancel').addEventListener('click',closeChannelIdentity); +document.getElementById('identitySave').addEventListener('click',applyChannelIdentity); +document.getElementById('identityName').addEventListener('keydown',e=>{ + if(e.key==='Enter'){e.preventDefault();applyChannelIdentity();} + else if(e.key==='Escape'){e.preventDefault();closeChannelIdentity();} +}); +document.getElementById('identityIcons').addEventListener('click',e=>{ + const button=e.target.closest('[data-identity-icon]');if(!button)return; + identityIcon=button.dataset.identityIcon;renderChannelIdentityChoices(); +}); +document.getElementById('identityColors').addEventListener('click',e=>{ + const button=e.target.closest('[data-identity-color]');if(!button)return; + identityColor=button.dataset.identityColor;renderChannelIdentityChoices(); +}); + +// Plugin Manager is a modeless, movable tool window. Never captures background mixer input. +let pluginWindowMove=null; +function positionPluginWindow(ev){ + const panel=plugEl('pluginBrowser'),parent=document.querySelector('.console-pane'); + const bounds=parent?.getBoundingClientRect?.(); + if(!pluginWindowMove||!bounds||!panel.style?.setProperty)return; + const w=panel.offsetWidth||400,h=panel.offsetHeight||390; + const left=Math.max(4,Math.min(bounds.width-w-4,ev.clientX-bounds.left-pluginWindowMove.dx)); + const top=Math.max(4,Math.min(bounds.height-h-4,ev.clientY-bounds.top-pluginWindowMove.dy)); + panel.style.setProperty('left',left+'px','important'); + panel.style.setProperty('top',top+'px','important'); + panel.style.setProperty('right','auto','important'); + panel.style.setProperty('bottom','auto','important'); +} +plugEl('pluginDragHandle').addEventListener('pointerdown',ev=>{ + if(ev.button!==undefined&&ev.button!==0)return; + if(ev.target.closest?.('button,input,select'))return; + const panel=plugEl('pluginBrowser'),r=panel.getBoundingClientRect?.(); + if(!r)return; + pluginWindowMove={pointerId:ev.pointerId,dx:ev.clientX-r.left,dy:ev.clientY-r.top}; + plugEl('pluginDragHandle').setPointerCapture?.(ev.pointerId); +}); +plugEl('pluginDragHandle').addEventListener('pointermove',ev=>{ + if(pluginWindowMove&&ev.pointerId===pluginWindowMove.pointerId)positionPluginWindow(ev); +}); +plugEl('pluginDragHandle').addEventListener('pointerup',ev=>{ + if(!pluginWindowMove||ev.pointerId!==pluginWindowMove.pointerId)return; + positionPluginWindow(ev);pluginWindowMove=null; + plugEl('pluginDragHandle').releasePointerCapture?.(ev.pointerId); +}); +plugEl('pluginDragHandle').addEventListener('pointercancel',ev=>{ + if(pluginWindowMove&&ev.pointerId===pluginWindowMove.pointerId)pluginWindowMove=null; +}); +plugEl('pluginMinimize').addEventListener('click',()=>{ + const panel=plugEl('pluginBrowser'),minimized=panel.classList.toggle('minimized'); + plugEl('pluginMinimize').setAttribute('aria-expanded',String(!minimized)); + plugEl('pluginMinimize').textContent=minimized?'+':'−'; +}); +document.querySelector('.console-body').addEventListener('keydown',e=>{ + if(e.key!=='F2'&&e.key!=='Enter')return; + const top=e.target.closest?.('.strip-identity-top'),bottom=e.target.closest?.('.footer-label .name'); + if(!top&&!bottom)return; + const t=findTrack(e.target);if(!t)return; + e.preventDefault();openChannelIdentity(t,top||bottom); +}); + +function setBrowser(open){ + pluginOpen=!!open; + plugEl('pluginBrowser').hidden=!pluginOpen; + // Plugin Manager is floating and NEVER changes bank width or rebuilds strips. + document.querySelector('.console-body').classList.remove('plugin-open'); + plugEl('pluginsButton').setAttribute('aria-expanded',String(pluginOpen)); + if(pluginOpen){ + // The FX fast picker is an independent tool, not a modal child of the manager. + renderPluginCatalog();renderScanPaths(); + const input=plugEl('pluginSearch');if(input.focus)input.focus(); + } +} +function setFastPicker(open){ + quickOpen=!!open; + plugEl('fastPicker').hidden=!quickOpen; +} +function renderFastPicker(){ + const q=String(plugEl('fastSearch').value||'').trim().toLowerCase(); + const list=pluginCatalog.filter(p=>!p.hidden&&!['error','disabled'].includes(p.status)&& + [p.name,p.category,p.vendor].join(' ').toLowerCase().includes(q)) + .sort((a,b)=>Number(b.favorite)-Number(a.favorite)||a.name.localeCompare(b.name)); + plugEl('fastResults').innerHTML=list.length?list.map(p=> + '' + ).join(''):'
No matching effects
'; +} +function openFastPicker(t,slot,anchor){ + // Non-modal manager stays open: the user may audition/search and continue mixing. + const first=t||selection()[0]||tracks[0]; + if(!first)return; + const empty=first.fx.findIndex(x=>x==='None'); + activeFxTarget={channelId:first.id,slot:Number.isInteger(slot)?slot:empty<0?0:empty}; + plugEl('fastTarget').textContent=first.name+' · FX '+(activeFxTarget.slot+1); + plugEl('fastSearch').value=''; + const pane=document.querySelector('.console-pane'),r=anchor?.getBoundingClientRect?.(),p=pane?.getBoundingClientRect?.(); + const picker=plugEl('fastPicker'); + if(r&&p&&picker.style?.setProperty){ + const x=Math.min(Math.max(6,r.left-p.left),Math.max(6,p.width-310)); + const y=Math.min(Math.max(8,r.bottom-p.top+3),Math.max(8,p.height-330)); + picker.style.setProperty('left',x+'px');picker.style.setProperty('top',y+'px'); + } + setFastPicker(true);renderFastPicker();plugEl('fastSearch').focus?.(); +} +function openPluginBrowser(t,slot){ // manager button and F8, deliberately separate from Add FX + const first=t||selection()[0]||tracks[0]; + if(first){ + const empty=first.fx.findIndex(x=>x==='None'); + activeFxTarget={channelId:first.id,slot:Number.isInteger(slot)?slot:empty<0?0:empty}; + } + plugEl('pluginTarget').textContent=pluginTargetLabel(); + setBrowser(true); +} +function renderScanPaths(){ + const container=plugEl('pluginPaths'); + container.innerHTML=scanPaths.map((p,i)=>'
'+escapeHtml(p)+''+(i?'':'Default')+'
').join(''); +} +function catalogById(id){return pluginCatalog.find(p=>p.id===id);} +function renderPluginCatalog(){ + const q=String(plugEl('pluginSearch').value||'').trim().toLowerCase(); + const cat=plugEl('pluginCategory').value||'all'; + const mode=plugEl('pluginView').value||'all'; + const list=pluginCatalog.filter(p=>{ + if(cat!=='all'&&p.category!==cat)return false; + if(mode==='favorites'&&!p.favorite)return false; + if(mode==='recent'&&!pluginRecent.includes(p.id))return false; + if(mode==='hidden'&&!p.hidden)return false; + if(mode!=='hidden'&&p.hidden)return false; + return [p.name,p.vendor,p.category,p.format].join(' ').toLowerCase().includes(q); + }).sort((a,b)=> mode==='recent'?pluginRecent.indexOf(a.id)-pluginRecent.indexOf(b.id):a.name.localeCompare(b.name)); + plugEl('pluginResults').innerHTML=list.length?list.map(p=>{ + const isBad=p.status==='error'||p.status==='disabled'; + const status=p.status==='demo'?'UI only':p.status==='ready'?'Listed':p.status==='error'?'Error':'Disabled'; + const latency=p.latencySamples==null?'Latency unknown':p.latencySamples+' smp (reported)'; + const usedBy=tracks.concat(master).filter(t=>t.fx.includes(p.name)).map(t=>t.name); + return '
'+escapeHtml(p.format)+''+status+'
'; + }).join(''):'
No effects match · try another category or clear the search.
'; + plugEl('pluginCount').textContent=list.length+' shown / '+pluginCatalog.length+' listed'; +} +function insertCatalogPlugin(id){ + const plugin=catalogById(id); + if(!plugin||plugin.hidden||plugin.status==='error'||plugin.status==='disabled'){say('This effect is not available for insertion.');return;} + if(!activeFxTarget){say('Choose a channel FX insert before loading an effect.');return;} + const t=tracks.concat(master).find(x=>x.id===activeFxTarget.channelId); + if(!t||!Number.isInteger(activeFxTarget.slot)||activeFxTarget.slot<0||activeFxTarget.slot>=t.fx.length){say('Selected FX slot is no longer available.');return;} + t.fx[activeFxTarget.slot]=plugin.name;t.slotBypass[activeFxTarget.slot]=false; + pluginRecent=[plugin.id,...pluginRecent.filter(x=>x!==plugin.id)].slice(0,20);savePluginPreferences(); + refreshStrip(t);setFastPicker(false); // leave non-modal manager open after FX selection + say(t.name+' · FX '+(activeFxTarget.slot+1)+' → '+plugin.name+' · GUI reference only (no native DSP)'); +} +function acceptPluginManifest(items){ + if(!Array.isArray(items)||items.length>512)return false; + const added=[];const ids=new Set(); + for(const item of items){ + if(!item||typeof item.name!=='string'||!item.name.trim()||item.kind!=='effect')continue; + const name=item.name.trim().slice(0,80); + const vendor=typeof item.vendor==='string'?item.vendor.slice(0,60):'Unknown vendor'; + const format=['VST3','VST2','AU','CLAP','Native'].includes(item.format)?item.format:'Unknown'; + const status=['ready','disabled','error'].includes(item.status)?item.status:'disabled'; + const category=['EQ','Dynamics','Reverb','Delay','Modulation','Utility'].includes(item.category)?item.category:'Utility'; + const id=typeof item.id==='string'?item.id.slice(0,100):name+'@'+vendor+'@'+format; + if(ids.has(id))continue;ids.add(id); + added.push({id,name,vendor,category,format,status,latencySamples:Number.isFinite(item.latencySamples)&&item.latencySamples>=0?Math.round(item.latencySamples):null,favorite:false,hidden:false}); + } + if(!added.length)return false; + pluginCatalog=added;pluginRecent=[];restorePluginPreferences(); + plugEl('pluginView').value='all';plugEl('pluginCategory').value='all';plugEl('pluginSearch').value=''; + renderPluginCatalog();say('Imported '+added.length+' plugin metadata records · not a native scan, no plugin instantiated'); + return true; +} +plugEl('pluginsButton').addEventListener('click',()=>pluginOpen?setBrowser(false):openPluginBrowser()); +plugEl('pluginClose').addEventListener('click',()=>setBrowser(false)); +plugEl('pluginSearch').addEventListener('input',renderPluginCatalog); +plugEl('fastSearch').addEventListener('input',renderFastPicker); +plugEl('fastClose').addEventListener('click',()=>setFastPicker(false)); +plugEl('fastManage').addEventListener('click',()=>{setFastPicker(false);plugEl('pluginTarget').textContent=pluginTargetLabel();setBrowser(true);}); +plugEl('fastResults').addEventListener('click',e=>{ + const btn=e.target.closest('[data-fast-id]');if(btn)insertCatalogPlugin(btn.dataset.fastId); +}); +/* V25 Quick VST picker: dismiss on outside pointer or focus transfer. + Capture phase closes old picker BEFORE target activation; clicks inside + either popup stay interactive, no document-level per-frame poll. */ +const dismissPluginOverlays=(target)=>{ + if(!target||typeof target.closest!=='function')return; + // Quick Picker is transient; Plugin Manager is an independent modeless tool. + // Do not close the manager when the engineer interacts with a mixer strip. + if(quickOpen&&!plugEl('fastPicker').contains(target))setFastPicker(false); +}; +document.addEventListener?.('pointerdown',e=>dismissPluginOverlays(e.target),true); +document.addEventListener?.('focusin',e=>dismissPluginOverlays(e.target),true); +window.addEventListener('blur',()=>{if(quickOpen)setFastPicker(false);}); +plugEl('fastSearch').addEventListener('keydown',e=>{ + if(e.key==='Enter'){ + const b=plugEl('fastResults').querySelector('.fast-effect'); + if(b){e.preventDefault();insertCatalogPlugin(b.dataset.fastId);} + }else if(e.key==='Escape'){e.preventDefault();setFastPicker(false);} +}); +plugEl('pluginAddPath').addEventListener('click',()=>{ + const input=plugEl('pluginNewPath'),raw=String(input.value||'').trim(); + if(!raw||raw.length>260){say('Enter a valid plugin folder path (max 260 characters)');return;} + if(!scanPaths.includes(raw))scanPaths.push(raw); + input.value='';renderScanPaths(); + say('Added search path to UI reference; native VST3 scanning not connected'); +}); +plugEl('pluginPaths').addEventListener('click',e=>{ + const btn=e.target.closest('[data-path-index]');if(!btn)return; + const i=Number(btn.dataset.pathIndex);if(i>0&&i{ + const scanner=window.ArSonMixNativePlugins?.scan; + if(typeof scanner==='function'){ + plugEl('pluginScanStatus').textContent='Native scan requested · awaiting verified results'; + try{ + Promise.resolve(scanner({paths:[...scanPaths],verify:true})).then(result=>{ + if(Array.isArray(result)){ + const good=acceptPluginManifest(result); + plugEl('pluginScanStatus').textContent=good?'Native scan metadata received · verify status before inserting':'Native scanner returned no usable audio effects'; + }else plugEl('pluginScanStatus').textContent='Native scan requested · waiting for host catalog update'; + }).catch(()=>{plugEl('pluginScanStatus').textContent='Native scan failed · inspect scanner logs';}); + }catch(error){plugEl('pluginScanStatus').textContent='Native scan could not start';} + }else{ + plugEl('pluginScanStatus').textContent='Windows VST3 scan requires installed native host · GitHub Pages cannot access local plugin files'; + say('Plugin Manager setup only: scanning requires native ArSonMix executable'); + } +}); +plugEl('pluginCategory').addEventListener('change',renderPluginCatalog); +plugEl('pluginView').addEventListener('change',renderPluginCatalog); +plugEl('pluginResults').addEventListener('click',e=>{ + const btn=e.target.closest('[data-plugin-action]');if(!btn)return; + const plugin=catalogById(btn.dataset.pluginId);if(!plugin)return; + const a=btn.dataset.pluginAction; + if(a==='fav')plugin.favorite=!plugin.favorite; + else if(a==='hide')plugin.hidden=!plugin.hidden; + else if(a==='choose'){insertCatalogPlugin(plugin.id);return;} + if(a==='fav'||a==='hide')savePluginPreferences(); + renderPluginCatalog(); +}); +plugEl('pluginImport').addEventListener('click',()=>{if(plugEl('pluginFile').click)plugEl('pluginFile').click();}); +plugEl('pluginFile').addEventListener('change',e=>{ + const file=e.target.files&&e.target.files[0];if(!file)return; + if(file.size>2000000){say('Plugin metadata JSON too large (2 MB maximum)');return;} + const reader=new FileReader(); + reader.onload=()=>{try{const data=JSON.parse(reader.result);if(!acceptPluginManifest(data)){say('No valid effect entries in JSON. Expected [{name,kind:"effect",format,status,...}]');}}catch(error){say('Invalid plugin metadata JSON.');}}; + reader.readAsText(file); + e.target.value=''; +}); +// Explicitly metadata-only integration point; does not scan filesystem or instantiate FX. +window.ArSonMixReference=Object.freeze({setPluginCatalog:acceptPluginManifest}); + +function togglePreview(){ + preview=!preview; + const b=document.getElementById('preview'); + b.textContent=preview?'■ Stop Meter Preview':'▶ Preview Meters';b.classList.toggle('active',preview);b.setAttribute('aria-pressed',String(preview)); + document.getElementById('transport').textContent=preview?'Meter preview running':'Stopped'; + if(preview){say('Meters use generated UI-only values. No capture, DSP or audio output.');requestAnimationFrame(animateMeters);} + else{ + tracks.concat(master).forEach(t=>{t.meterL=t.meterR=0;}); + meterPeakHolds.clear(); + document.querySelectorAll('.meter-fill').forEach(x=>x.style.setProperty('--lit','0%')); + document.querySelectorAll('.meter-peak-hold').forEach(x=>{x.style.opacity='0';}); + } +} +document.getElementById('preview').addEventListener('click',togglePreview); +function animateMeters(ts){ + if(!preview)return; + if(ts-lastTick>80){lastTick=ts;meterFrame++; + const anySolo=tracks.some(t=>t.solo); + tracks.concat(master).forEach((t,i)=>{ + const routedThroughSoloBus=t.kind==='audio'&&tracks.some(bus=>bus.kind==='bus'&&bus.solo&&t.output===bus.name); + const fedBySoloChannel=t.kind==='bus'&&tracks.some(ch=>ch.solo&&(ch.output===t.name||ch.send===t.name)); + const suppressed=t.mute||(anySolo&&!t.solo&&!routedThroughSoloBus&&!fedBySoloChannel&&t.kind!=='master'); + const modulation=.46+.23*Math.sin(meterFrame*.13+i*1.21)+.17*Math.sin(meterFrame*.31+i*2.2); + const leftDbfs=suppressed?METER_DBFS_MIN:demoMeterDbfs(t.level,modulation); + // Stereo differences are measured in dB, not arbitrary LED percentages. + const rightDbfs=suppressed?METER_DBFS_MIN:Math.max(METER_DBFS_MIN, + Math.min(METER_DBFS_MAX,leftDbfs-1+0.8*Math.sin(meterFrame*.15+i))); + const root=document.querySelector('.strip[data-id="'+t.id+'"]');if(!root)return; + const l=root.querySelector('.meter-fill.left'),r=root.querySelector('.meter-fill.right'); + displayMeterDbfs(l,leftDbfs,ts,t.id+':L'); + displayMeterDbfs(r,rightDbfs,ts,t.id+':R'); + if((leftDbfs>=-0.1||rightDbfs>=-0.1)&&!t.clip){ + t.clip=true; + root.querySelector('.peak')?.classList.add('clipping'); + root.querySelector('.clip-indicator')?.classList.add('clipping'); + } + }); + } + requestAnimationFrame(animateMeters); +} +window.addEventListener('keydown',e=>{ + const textEntry=e.target.closest&&e.target.closest('input,textarea,select,[contenteditable="true"]'); + if((e.ctrlKey||e.metaKey)&&!textEntry){ + if(e.key.toLowerCase()==='c'){e.preventDefault();copyChannels();return;} + if(e.key.toLowerCase()==='v'){e.preventDefault();pasteChannels();return;} + if(e.key.toLowerCase()==='g'){e.preventDefault();e.shiftKey?ungroupSelected():groupSelected();return;} + } + if(e.key==='Escape'&&wireGesture){ + wireGesture=null;setWireSnapTarget(null);consoleBody.classList.remove('wire-dragging'); + consoleBody.querySelectorAll('.is-replug-origin,.is-drag-origin').forEach(el=> + el.classList.remove('is-replug-origin','is-drag-origin')); + renderWireRouting();say('WIRE canceled · original edge unchanged');return; + } + if(e.key==='Escape'&&sofEnabled){toggleSof(false);return;} + if(e.key==='F8'&&!textEntry){e.preventDefault();pluginOpen?setBrowser(false):openPluginBrowser();return;} + if(e.key==='Escape'&&identityTrackId!==null){closeChannelIdentity();return;} + if(e.key==='Escape'&&quickOpen){setFastPicker(false);return;} + if(e.key==='Escape'&&pluginOpen){setBrowser(false);return;} + if(e.key==='Escape'&&(wireIntent||wireSourcePinned)){ + clearWireIntent();say('WIRE idle · click OUT to patch');return; + } + if(e.key==='Escape'&&preview)togglePreview(); + if(e.target===document.body&&(e.key==='ArrowRight'||e.key==='ArrowLeft')){ + const width={comfort:150,standard:125,compact:105}[document.querySelector('.console-body').dataset.density]||150; + document.getElementById(e.key==='ArrowRight'?'bankNext':'bankPrev').click(); + } +}); +let resizeQueued=false; +window.addEventListener('resize',()=>{ + if(resizeQueued)return;resizeQueued=true; + requestAnimationFrame(()=>{resizeQueued=false;render();}); +}); +restorePluginPreferences();init(); +})(); + + + + + \ No newline at end of file diff --git a/site/preview/mixer.html b/site/preview/mixer.html deleted file mode 100644 index 4397c1399..000000000 --- a/site/preview/mixer.html +++ /dev/null @@ -1,5302 +0,0 @@ - - - - - - -ArSonMix — Live Console Reference - - - -
-
Mixer · Reference SessionOPERATOR-FIRST · SINGLE LIVE CONSOLE REFERENCE
- -
-
Live MixerCH01 · click destination arrows10 audio tracks · 1 bus · master
-
- -
-
-
- - - - -
-
StoppedInteractive visual reference. Changes are local to this mockup.SIMULATED METERS · NO REAL AUDIO
-
- - - \ No newline at end of file diff --git a/site/preview/perf.html b/site/preview/perf.html deleted file mode 100644 index bcb6849eb..000000000 --- a/site/preview/perf.html +++ /dev/null @@ -1,33 +0,0 @@ - -ArSonMix Mixer Performance Lab - -
ArSonMix · Mixer Perf Lab - - -Open direct mixerLoading…
- - -
No measurements. rAF intervals are scheduling proxies, not GPU paint/input latency. Unsupported Long Tasks API is reported as null, not zero.
- \ No newline at end of file From 87487638004f80558f47da7c3fa9b931318bf570 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:21:01 +0700 Subject: [PATCH 02/19] build(gui): emit /preview/ from ONE approved physical source with PNG controls --- scripts/build_pages.py | 176 +++++++++++++++++++++-------------------- 1 file changed, 89 insertions(+), 87 deletions(-) diff --git a/scripts/build_pages.py b/scripts/build_pages.py index e224b7882..b0097211e 100644 --- a/scripts/build_pages.py +++ b/scripts/build_pages.py @@ -1,90 +1,92 @@ -"""Build public Pages landing and interactive console from canonical standalone HTML.""" +"""Build ONE public approved /preview/ from ONE physical source directory. + +The checked-in site/preview/ files are the approved GUI with PNG MUTE/SOLO/PFL +skin. Never assemble a second renderer or source CSS from retired preview-v2. +The native JUCE packager invokes this same builder for byte-for-byte parity. +""" from pathlib import Path -import argparse,os,json,shutil,subprocess,sys -ROOT=Path(__file__).resolve().parents[1] -p=argparse.ArgumentParser() -p.add_argument('--out',default='dist-pages') -p.add_argument('--sha',default=os.environ.get('GITHUB_SHA','local')) -p.add_argument('--branch',default=os.environ.get('GITHUB_REF_NAME','local')) -args=p.parse_args() -dst=Path(args.out).resolve() -if dst==ROOT or dst==ROOT/'site': raise SystemExit('unsafe output path') -dst.mkdir(parents=True,exist_ok=True) -# Publish only the landing and ONE approved /preview/ GUI. Internal GUI seed -# folders remain in repo for design tests, never as separate public screens. -shutil.copy2(ROOT/'site/index.html',dst/'index.html') -subprocess.run([sys.executable,str(ROOT/'scripts/build_ui_css.py'),'--check'],check=True) +import argparse +import hashlib +import json +import os +import re +import shutil +import subprocess +import sys + +ROOT = Path(__file__).resolve().parents[1] +SOURCE = ROOT / "site" / "preview" +KEY_ASSETS = ("mixer-control-keys.css", "mixer-control-keys.js") +REDIRECTS = ("preview-v2", "preview-buttons", "preview-v33", "preview-v34") + +p = argparse.ArgumentParser() +p.add_argument("--out", default="dist-pages") +p.add_argument("--sha", default=os.environ.get("GITHUB_SHA", "local")) +p.add_argument("--branch", default=os.environ.get("GITHUB_REF_NAME", "local")) +args = p.parse_args() +dst = Path(args.out).resolve() +if dst in (ROOT, ROOT / "site", SOURCE) or ROOT in dst.parents and dst.parts[-1] in ("site", "preview"): + raise SystemExit("unsafe Pages output path") +if not (SOURCE / "index.html").is_file(): + raise SystemExit("canonical approved /preview/ source missing") +subprocess.run([sys.executable, str(ROOT / "scripts/build_ui_css.py"), "--check"], check=True) +dst.mkdir(parents=True, exist_ok=True) +shutil.copy2(ROOT / "site/index.html", dst / "index.html") +dest = dst / "preview" +if dest.exists(): + shutil.rmtree(dest) +shutil.copytree(SOURCE, dest) + +source_html = (SOURCE / "index.html").read_text(encoding="utf-8") +html = source_html +revisions = {} +for name in KEY_ASSETS: + asset = SOURCE / "assets" / name + if not asset.is_file(): + raise SystemExit("approved PNG-button component missing: " + name) + token = "assets/" + name + pattern = re.compile(re.escape(token) + r'(?:\?[^"\s>]+)?') + matches = list(pattern.finditer(html)) + if len(matches) != 1: + raise SystemExit("expected one approved GUI asset link for " + name) + digest = hashlib.sha256(asset.read_bytes()).hexdigest()[:16] + match = matches[0] + html = html[:match.start()] + token + "?rev=" + digest + html[match.end():] + revisions[name] = digest + if (dest / "assets" / name).read_bytes() != asset.read_bytes(): + raise SystemExit("source-to-published PNG-button asset drift: " + name) +if "console-body" not in html or "]+)?') - matches=list(pattern.finditer(canonical_html)) - if len(matches)!=1: - raise SystemExit(f'Expected one source link for {token}; found {len(matches)}') - digest=hashlib.sha256((buttons_dest/'assets'/name).read_bytes()).hexdigest()[:16] - revisions[name]=digest - match=matches[0] - canonical_html=canonical_html[:match.start()]+token+'?rev='+digest+canonical_html[match.end():] -(buttons_dest/'index.html').write_text(canonical_html,encoding='utf-8') -(buttons_dest/'build.json').write_text(json.dumps({ - 'canonical_url':'/preview/', - 'sha':args.sha,'branch':args.branch, - 'kind':'APPROVED_SINGLE_GUI','live_audio':False, - 'wire_source':'site/preview-v2/index.html', - 'wire_source_sha256':hashlib.sha256((canonical/'index.html').read_bytes()).hexdigest(), - 'button_asset_source':'site/preview-buttons/assets/', - 'button_css_js_revisions':revisions -},indent=2),encoding='utf-8') -# Fail closed if routing has no identical source files in the variant. -for name in ('mixer-wire-dots.css','knob-ICON.svg'): - if (buttons_dest/'assets'/name).read_bytes()!=(canonical/'assets'/name).read_bytes(): - raise SystemExit('PNG preview WIRE dependency drift: '+name) -# The source directories /preview-v2/ and /preview-buttons/ MUST NOT ship -# alternative mixer pages. Preserve old bookmarks with redirect-only shells; -# all redirects lead to exactly the SAME approved /preview/ GUI. -legacy_paths=('preview-v2','preview-buttons','preview-v33','preview-v34') -redirect_html=('' - '' - '' - 'ArSonMix — Official Preview' - 'Open the only approved ArSonMix preview') -for legacy in legacy_paths: - target=dst/legacy - if target.exists(): shutil.rmtree(target) - target.mkdir(parents=True) - (target/'index.html').write_text(redirect_html,encoding='utf-8') -# Retire the old competing /preview/mixer.html body and its candidate metadata; -# they are never an alternate product skin. -(dst/'preview'/'mixer.html').write_text( +redirect_html = ('' + '' + '' + 'ArSonMix — Official Preview' + 'Open the only approved ArSonMix preview') +for old in REDIRECTS: + route = dst / old + if route.exists(): + shutil.rmtree(route) + route.mkdir(parents=True) + (route / "index.html").write_text(redirect_html, encoding="utf-8") +(dest / "mixer.html").write_text( '' - '',encoding='utf-8') -for obsolete in ('candidate.json',): - (dst/'preview'/obsolete).unlink(missing_ok=True) -(dst/'.nojekyll').touch() -assert (dst/'index.html').exists() and (dst/'preview'/'index.html').exists() -assert 'APPROVED_SINGLE_GUI' in (dst/'preview'/'build.json').read_text(encoding='utf-8') -print('Built ONE approved public GUI at /preview/:',dst/'preview', - 'from internal HTML + approved button assets', 'revision:',args.sha) + '', encoding="utf-8") +(dst / ".nojekyll").touch() +print("Built ONE /preview/ GUI from site/preview/ source:", + len(list((dest / "assets").iterdir())), "assets", args.sha) From 7d94da9f8c32f7ff8f5bc8195f846814ee839ae3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:23:03 +0700 Subject: [PATCH 03/19] refactor(gui): route Pages, JUCE BinaryData, and contracts to single physical preview source --- AGENTS.md | 6 +++--- CMakeLists.txt | 3 +-- scripts/build_approved_native_gui.py | 2 +- scripts/check_approved_native_gui_release.mjs | 8 ++++---- tests/approved_native_gui_bundle_test.py | 2 +- tests/ci_workflow_efficiency_test.mjs | 2 +- tests/native_artifact_packaging_contract_test.mjs | 4 ++-- tests/pages_micro_button_assets_v1_smoke.py | 4 ++-- tests/pages_png_buttons_wire_reconciliation_smoke.py | 6 +++--- tests/single_preview_publication_contract_test.py | 8 ++++---- web/approved-native-bridge.js | 2 +- 11 files changed, 23 insertions(+), 24 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 6c65e2fcb..afcc12620 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,12 +3,12 @@ **ONLY approved/public/product GUI: https://masarray.github.io/arsonmix/preview/**. There must be ONE public preview, ONE actual rendered GUI, and ONE native Windows GUI. **/preview-v2/ is rejected**: do not display, promote, publish or base native design on it as a separate UI. Do not substitute another console from `web/index.html`, `web/mixer-layout.js`, `web/console-native.html`, PR #278 or old M3/V48 mock. **The JUCE ENGINE must stitch into the EXACT approved /preview/ GUI**, never redesign it. -## Verified current published GUI implementation -`site/preview/index.html` was merely a wrapper/iframe pointing at a generated `/preview-buttons/index.html`. `scripts/build_pages.py` generates that **approved PNG hardware-button variant** using current `site/preview-v2/index.html` as an INTERNAL HTML/WIRE/FX/fader source, with specifically `site/preview-buttons/assets/mixer-control-keys.css`, `mixer-control-keys.js` and `mute-solo-pfl-56x37.png` as approved button source. **The assembled result behind /preview/ is the visual authority, not /preview-v2/ in isolation.** There must be exactly ONE deterministic assembled output and no independent published variant. Internal source files may survive only as build inputs until safely consolidated; they are NOT alternate product GUIs. **Current approved visual including PNG keys must never be silently replaced by the base variant.** +## Single physical GUI source (consolidated) +**ONLY `site/preview/index.html` and `site/preview/assets/**` own the approved source**, including PNG MUTE/SOLO/PFL and all WIRE/FX/fader CSS/JS. `scripts/build_pages.py` publishes exactly those bytes with two content-addressed CSS/JS link revisions. `scripts/build_approved_native_gui.py` invokes the SAME builder for JUCE resources. Retired `site/preview-v2/`, `site/preview-buttons/`, and V33/V34 snapshot directories have been deleted from current source; their old public URLs are redirect-only. Do not reintroduce copied GUI files or variant skins. ## Active contract and ownership - [P0 native GUI stitch #389](https://github.com/masarray/arsonmix/issues/389) — compile the **exact /preview/ assembled GUI** and component assets into JUCE WebView2, no new layout/renderer. Update the issue from earlier incorrect preview-v2 wording. -- GUI reference maintenance: currently reviewed `main` component/source changes. Publish ONLY `/preview/` and no independent `/preview-v2/`, `/preview-buttons/` or historical Vxx GUI. Old URLs may redirect to /preview/ but never contain another mixer UI. +- GUI reference maintenance: currently reviewed `main/site/preview/**` component/source changes. Publish ONLY `/preview/` and no independent `/preview-v2/`, `/preview-buttons/` or historical Vxx GUI. Old URLs may redirect to /preview/ but never contain another mixer UI. - ENGINE [#266](https://github.com/masarray/arsonmix/pull/266) + [#387](https://github.com/masarray/arsonmix/pull/387) keep ONE primary JUCE realtime callback, ONE accepted ChannelId/EdgeId PCM graph, ONE genuine native VST3 lease/editor; do not ship ENGINE's own `web/console-native.*` visual renderer. - FAT [#270](https://github.com/masarray/arsonmix/pull/270), native epic #192, hardware crackle #15. One integrated exact-SHA Windows EXE; exact approved generated `/preview/` HTML/assets SHA256 and screenshot/interaction parity; native PCM + VST3 + actual hardware FAT. diff --git a/CMakeLists.txt b/CMakeLists.txt index d97d5e1f4..1ebb588fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,7 @@ juce_add_gui_app(ARMixConsole find_package(Python3 REQUIRED COMPONENTS Interpreter) set(ARMIX_APPROVED_GUI_DIR "${CMAKE_CURRENT_BINARY_DIR}/approved_gui") file(GLOB_RECURSE ARMIX_APPROVED_GUI_SOURCE_INPUTS CONFIGURE_DEPENDS - "${CMAKE_CURRENT_SOURCE_DIR}/site/preview-v2/*" - "${CMAKE_CURRENT_SOURCE_DIR}/site/preview-buttons/assets/*") + "${CMAKE_CURRENT_SOURCE_DIR}/site/preview/*") list(APPEND ARMIX_APPROVED_GUI_SOURCE_INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/web/approved-native-bridge.js" "${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_approved_native_gui.py") diff --git a/scripts/build_approved_native_gui.py b/scripts/build_approved_native_gui.py index a0a32b4e2..074ce6330 100644 --- a/scripts/build_approved_native_gui.py +++ b/scripts/build_approved_native_gui.py @@ -123,7 +123,7 @@ def stage(out: Path) -> dict: "schema": SCHEMA, "authoritativePagesRoute": "/preview/", "authoritativePagesOutput": "preview/index.html", - "canonicalSource": "site/preview-v2/index.html", + "canonicalSource": "site/preview/index.html", "canonicalSourceSha256": sha256((CANONICAL / "index.html").read_bytes()), "approvedPagesHtmlSha256": sha256(approved), "nativeHtmlSha256": sha256(native), diff --git a/scripts/check_approved_native_gui_release.mjs b/scripts/check_approved_native_gui_release.mjs index 6eb4b0348..ef9228f52 100644 --- a/scripts/check_approved_native_gui_release.mjs +++ b/scripts/check_approved_native_gui_release.mjs @@ -12,8 +12,8 @@ const digest=b=>createHash('sha256').update(b).digest('hex'); const fail=s=>{console.error('RELEASE BLOCKED — approved /preview/ GUI: '+s);process.exitCode=1;}; const entry='web/approved-preview/index.html'; const manifest='web/approved-preview/native-manifest.json'; -const source='site/preview-v2/index.html'; // INTERNAL HTML seed, NOT /preview-v2/ product -const buttons='site/preview-buttons/assets/'; +const source='site/preview/index.html'; // INTERNAL HTML seed, NOT /preview-v2/ product +const buttons='site/preview/assets/'; if(!exists(entry)||!exists(manifest)){ fail('Windows approved GUI bundle missing. Generate the exact /preview/ assembled HTML, CSS/JS/PNG, then embed it into JUCE.'); process.exit(1); @@ -37,12 +37,12 @@ if(read(entry).toString('utf8')!==expected)fail('Native HTML does not match EXAC const linked=[...new Set([...sourceHtml.matchAll(/(?:src|href)=["'](assets\/[^"'?]+)(?:\?[^"']*)?["']/g)].map(v=>v[1]))]; for(const rel of linked){ const name=rel.slice('assets/'.length); - const sourceAsset=['mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'].includes(name)?buttons+name:'site/preview-v2/'+rel; + const sourceAsset=['mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'].includes(name)?buttons+name:'site/preview/'+rel; const nativeAsset='web/approved-preview/'+rel; if(!exists(sourceAsset)||!exists(nativeAsset)||digest(read(sourceAsset))!==digest(read(nativeAsset)))fail('Native CSS/JS/art missing/changed: '+rel); } for(const name of ['mute-solo-pfl-56x37.png','mixer-wire-dots.css','knob-ICON.svg']){ - const ref=name==='mute-solo-pfl-56x37.png'?buttons+name:'site/preview-v2/assets/'+name; + const ref=name==='mute-solo-pfl-56x37.png'?buttons+name:'site/preview/assets/'+name; const native='web/approved-preview/assets/'+name; if(!exists(native)||!exists(ref)||digest(read(native))!==digest(read(ref)))fail('Mandatory GUI art mismatch: '+name); } diff --git a/tests/approved_native_gui_bundle_test.py b/tests/approved_native_gui_bundle_test.py index ff19498c2..c52a3c407 100644 --- a/tests/approved_native_gui_bundle_test.py +++ b/tests/approved_native_gui_bundle_test.py @@ -30,7 +30,7 @@ def test_native_is_exact_assembled_public_pages_plus_nonvisual_native_seam(self) self.assertEqual((out / "assets" / asset.name).read_bytes(), asset.read_bytes(), "Native /preview/ asset differs: " + asset.name) for name in ("mixer-control-keys.css", "mixer-control-keys.js", "mute-solo-pfl-56x37.png"): - button = (ROOT / "site/preview-buttons/assets" / name).read_bytes() + button = (ROOT / "site/preview/assets" / name).read_bytes() self.assertEqual((out / "assets" / name).read_bytes(), button) self.assertIn("assets/mixer-control-keys.css?rev=", native) self.assertNotIn("console-native.html", native) diff --git a/tests/ci_workflow_efficiency_test.mjs b/tests/ci_workflow_efficiency_test.mjs index e7a64eabb..099dc9069 100644 --- a/tests/ci_workflow_efficiency_test.mjs +++ b/tests/ci_workflow_efficiency_test.mjs @@ -43,7 +43,7 @@ const selected = (paths, file) => paths.some(p => globMatches(p, file)); test('visual GUI changes never consume Windows native runner on a PR or on main', () => { for (const filename of [ - 'site/preview-v2/index.html', 'site/preview-v2/assets/mixer-fader-assembly.css', + 'site/preview/index.html', 'site/preview/assets/mixer-fader-assembly.css', 'web/mixer-layout.js', 'web/mixer-io.js', 'AR-MIX-Live-FX-Host-Standalone-v0.3.html' ]) { diff --git a/tests/native_artifact_packaging_contract_test.mjs b/tests/native_artifact_packaging_contract_test.mjs index 6b33b1a86..501caa4b7 100644 --- a/tests/native_artifact_packaging_contract_test.mjs +++ b/tests/native_artifact_packaging_contract_test.mjs @@ -40,8 +40,8 @@ test('JUCE embeds only generated approved Pages DOM, CSS, JS, and PNG button var assert.match(sourceBlock,/ARMIX_APPROVED_GUI_BINARIES/); assert.doesNotMatch(sourceBlock,/web\/index\.html|web\/console-native\.html/); assert.match(cmake,/build_approved_native_gui\.py/); - assert.match(cmake,/site\/preview-v2/); - assert.match(cmake,/site\/preview-buttons/); + assert.match(cmake,/site\/preview\/\*/); + assert.doesNotMatch(cmake,/site\/preview-v2|site\/preview-buttons/); assert.match(nativeMain,/ApprovedGuiResources\.h/); assert.match(nativeMain,/resolveApprovedGuiResource \(path, data, size, mime\)/); assert.doesNotMatch(nativeMain,/BinaryData::consolenative_html|BinaryData::index_html|BinaryData::app_js/); diff --git a/tests/pages_micro_button_assets_v1_smoke.py b/tests/pages_micro_button_assets_v1_smoke.py index 63d9c3963..030dfd8a9 100644 --- a/tests/pages_micro_button_assets_v1_smoke.py +++ b/tests/pages_micro_button_assets_v1_smoke.py @@ -8,8 +8,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -ASSET=ROOT/'site/preview-v2/assets' -PAGE=ROOT/'site/preview-v2/index.html' +ASSET=ROOT/'site/preview/assets' +PAGE=ROOT/'site/preview/index.html' SQUARE='micro-hardware-17x17-2x4.png' FORMAT='format-hardware-25x15-2x1.png' diff --git a/tests/pages_png_buttons_wire_reconciliation_smoke.py b/tests/pages_png_buttons_wire_reconciliation_smoke.py index 036003f62..5c689c7f1 100644 --- a/tests/pages_png_buttons_wire_reconciliation_smoke.py +++ b/tests/pages_png_buttons_wire_reconciliation_smoke.py @@ -16,8 +16,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -REFERENCE=ROOT/"site/preview-v2" -OWNER=ROOT/"site/preview-buttons/assets" +REFERENCE=ROOT/"site/preview" +OWNER=ROOT/"site/preview/assets" SPECIAL=("mixer-control-keys.css","mixer-control-keys.js") SPRITE="mute-solo-pfl-56x37.png" @@ -60,7 +60,7 @@ def verify_bundle(dist): assert (generated/"assets"/name).read_bytes()==(REFERENCE/"assets"/name).read_bytes(),name png=(generated/"assets"/SPRITE).read_bytes() - assert png==(ROOT/"site/preview-v34/assets"/SPRITE).read_bytes() + assert png==(REFERENCE/"assets"/SPRITE).read_bytes() assert png[:8]==bytes.fromhex("89504e470d0a1a0a") assert struct.unpack(">II",png[16:24])==(112,111) assert png[25]==6,"Must keep RGBA transparency" diff --git a/tests/single_preview_publication_contract_test.py b/tests/single_preview_publication_contract_test.py index 3603b1d76..088c7b488 100644 --- a/tests/single_preview_publication_contract_test.py +++ b/tests/single_preview_publication_contract_test.py @@ -7,7 +7,7 @@ def require(ok,why): if not ok: raise AssertionError('SINGLE APPROVED PREVIEW FAILED: '+why) html=(gui/'index.html').read_text(encoding='utf-8') -source=(ROOT/'site/preview-v2/index.html').read_text(encoding='utf-8') +source=(ROOT/'site/preview/index.html').read_text(encoding='utf-8') build=json.loads((gui/'build.json').read_text(encoding='utf-8')) require(build.get('kind')=='APPROVED_SINGLE_GUI' and build.get('canonical_url')=='/preview/','wrong public GUI identity') require(build.get('live_audio') is False,'browser must not claim PCM') @@ -22,13 +22,13 @@ def require(ok,why): pattern=re.compile(re.escape(token)+r'(?:\?[^"\s>]+)?') require(len(pattern.findall(expected))==1,'approved key CSS/JS link missing or duplicated: '+name) expected=pattern.sub(token+'?rev='+revisions[name],expected) - approved=ROOT/'site/preview-buttons/assets'/name + approved=ROOT/'site/preview/assets'/name target=gui/'assets'/name require(target.read_bytes()==approved.read_bytes(),'wrong PNG-button CSS/JS: '+name) require(html==expected,'rendered /preview/ DOM differs from exact source + approved PNG-key revision assembly') for name in ('mixer-wire-dots.css','knob-ICON.svg'): - require((gui/'assets'/name).read_bytes()==(ROOT/'site/preview-v2/assets'/name).read_bytes(),'WIRE source drift: '+name) -require((gui/'assets/mute-solo-pfl-56x37.png').read_bytes()==(ROOT/'site/preview-buttons/assets/mute-solo-pfl-56x37.png').read_bytes(),'approved PNG sprite mismatch') + require((gui/'assets'/name).read_bytes()==(ROOT/'site/preview/assets'/name).read_bytes(),'WIRE source drift: '+name) +require((gui/'assets/mute-solo-pfl-56x37.png').read_bytes()==(ROOT/'site/preview/assets/mute-solo-pfl-56x37.png').read_bytes(),'approved PNG sprite mismatch') require(not (gui/'candidate.json').exists(),'legacy preview candidate metadata still published') require('http-equiv="refresh"' in (gui/'mixer.html').read_text(encoding='utf-8'),'old mixer.html must redirect, never be another GUI') for old in ('preview-v2','preview-buttons','preview-v33','preview-v34'): diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 6b43c23c3..7bbaa0b64 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -6,7 +6,7 @@ "use strict"; const backend = window.__JUCE__?.backend; const descriptor = Object.freeze({ - source: "site/preview-v2 + site/preview-buttons", + source: "site/preview + site/preview-buttons", pagesRoute: "/preview/", nativeTransport: Boolean(backend?.emitEvent && backend?.addEventListener), acceptedGraphConnected: false, From f3f389a4e7c65572c64c66972b219496b8f67591 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:24:16 +0700 Subject: [PATCH 04/19] test(gui): port canonical WIRE/FX/meter tests to sole approved source --- tests/css_v28_restore.py | 2 +- tests/pages_fx_rail_v53_smoke.py | 2 +- tests/pages_v51_portrait_led_peak_hold_smoke.py | 4 ++-- tests/pages_v54_wire_fx_context_smoke.py | 2 +- tests/pages_v55_context_wire_fader_smoke.py | 2 +- tests/pages_wire_first_canonical_main_smoke.py | 2 +- tests/pages_wire_v49_direct_controls_smoke.py | 2 +- tests/wire_knob_asset_contract_test.py | 6 +++--- tests/wire_main_native_handoff_contract.test.cjs | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/css_v28_restore.py b/tests/css_v28_restore.py index 5f827a058..04b241e77 100644 --- a/tests/css_v28_restore.py +++ b/tests/css_v28_restore.py @@ -9,7 +9,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" OWNER=HTML.parent/"assets/mixer-chrome-material.css" LEDGER=ROOT/"tests/fixtures/css-v28-inline-chrome-owner.json" diff --git a/tests/pages_fx_rail_v53_smoke.py b/tests/pages_fx_rail_v53_smoke.py index 9f3f55625..8d6925799 100644 --- a/tests/pages_fx_rail_v53_smoke.py +++ b/tests/pages_fx_rail_v53_smoke.py @@ -3,7 +3,7 @@ from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" BREAKPOINTS=((1366,768),(1378,911),(1680,900),(1920,1080)) DENSITIES=("comfort","standard","compact") diff --git a/tests/pages_v51_portrait_led_peak_hold_smoke.py b/tests/pages_v51_portrait_led_peak_hold_smoke.py index 0ffaaacd6..5a456bddd 100644 --- a/tests/pages_v51_portrait_led_peak_hold_smoke.py +++ b/tests/pages_v51_portrait_led_peak_hold_smoke.py @@ -7,8 +7,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" -CSS=ROOT/"site/preview-v2/assets/mixer-meter-display.css" +HTML=ROOT/"site/preview/index.html" +CSS=ROOT/"site/preview/assets/mixer-meter-display.css" def inspect_geometry(page,density,w): page.locator("#densitySelect").select_option(density) diff --git a/tests/pages_v54_wire_fx_context_smoke.py b/tests/pages_v54_wire_fx_context_smoke.py index 59847f7f0..6e34cd602 100644 --- a/tests/pages_v54_wire_fx_context_smoke.py +++ b/tests/pages_v54_wire_fx_context_smoke.py @@ -3,7 +3,7 @@ from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" def wire(page,ch,direction): node=".wire-node-out" if direction=="out" else ".wire-node-in" diff --git a/tests/pages_v55_context_wire_fader_smoke.py b/tests/pages_v55_context_wire_fader_smoke.py index 51f838402..f3bc7347b 100644 --- a/tests/pages_v55_context_wire_fader_smoke.py +++ b/tests/pages_v55_context_wire_fader_smoke.py @@ -2,7 +2,7 @@ """V55 context-aware physical WIRE dot paint; preserve owner-restored V51 fader shadow.""" from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" def node(page,ch,direction): sel=".wire-node-out" if direction=="out" else ".wire-node-in" dot=".wire-pin" if direction=="out" else ".wire-arrow" diff --git a/tests/pages_wire_first_canonical_main_smoke.py b/tests/pages_wire_first_canonical_main_smoke.py index 944b9cbde..b2bde7ddf 100644 --- a/tests/pages_wire_first_canonical_main_smoke.py +++ b/tests/pages_wire_first_canonical_main_smoke.py @@ -3,7 +3,7 @@ from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" def edge(page, channel, endpoint): selector=(f'#tracks .strip[data-id="{channel}"] .wire-node-out' diff --git a/tests/pages_wire_v49_direct_controls_smoke.py b/tests/pages_wire_v49_direct_controls_smoke.py index b56bb13b1..86d282dd6 100644 --- a/tests/pages_wire_v49_direct_controls_smoke.py +++ b/tests/pages_wire_v49_direct_controls_smoke.py @@ -4,7 +4,7 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -PAGE=ROOT/"site/preview-v2/index.html" +PAGE=ROOT/"site/preview/index.html" def center(box): assert box and box["width"] and box["height"], box diff --git a/tests/wire_knob_asset_contract_test.py b/tests/wire_knob_asset_contract_test.py index 27a93939b..eeb608e2d 100644 --- a/tests/wire_knob_asset_contract_test.py +++ b/tests/wire_knob_asset_contract_test.py @@ -9,11 +9,11 @@ from xml.etree import ElementTree as ET root = Path(__file__).resolve().parents[1] -ref = root / "site/preview-v2/index.html" -svg = root / "site/preview-v2/assets/knob-ICON.svg" +ref = root / "site/preview/index.html" +svg = root / "site/preview/assets/knob-ICON.svg" legacy_preview = root / "site/preview/assets/knob-ICON.svg" html = ref.read_text(encoding="utf-8") -wire_owner = (root / "site/preview-v2/assets/mixer-wire-dots.css").read_text(encoding="utf-8") +wire_owner = (root / "site/preview/assets/mixer-wire-dots.css").read_text(encoding="utf-8") # WIRE declarations may be owned by the existing component stylesheet after V16. material = html + "\n" + wire_owner # Inline the supplied SVG exactly: CSS masks loaded from file:// or another diff --git a/tests/wire_main_native_handoff_contract.test.cjs b/tests/wire_main_native_handoff_contract.test.cjs index 036be23a3..8a70665f4 100644 --- a/tests/wire_main_native_handoff_contract.test.cjs +++ b/tests/wire_main_native_handoff_contract.test.cjs @@ -8,8 +8,8 @@ const path=require("node:path"); const root=path.resolve(__dirname,".."); const read=p=>fs.readFileSync(path.join(root,p),"utf8"); const contract=JSON.parse(read("contracts/console-puzzle-v8.json")); -const ui=read("site/preview-v2/index.html"); -const css=read("site/preview-v2/assets/mixer-wire-dots.css"); +const ui=read("site/preview/index.html"); +const css=read("site/preview/assets/mixer-wire-dots.css"); const handoff=read("docs/workstreams/WIRE_V59_MAIN_NATIVE_ENGINE_RECONCILIATION_20261104.md"); assert.equal(contract.schemaVersion,6,"The installed Console v8 envelope must not be replaced"); From 15ebfec2824cb91acea617ea2773a20ba4989757 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:24:49 +0700 Subject: [PATCH 05/19] test(gui): bind WIRE positions, responsive fold, and physical fader to single-source GUI --- tests/pages_v50_wire_popout_layout_smoke.py | 2 +- tests/pages_v52_fader_recess_smoke.py | 11 +++++------ tests/pages_wire_dot_v42_smoke.py | 2 +- tests/pages_wire_focus_v40_smoke.py | 2 +- tests/pages_wire_incoming_v43_smoke.py | 4 ++-- tests/pages_wire_v44_finish_smoke.py | 4 ++-- tests/pages_wire_v45_socket_layout_smoke.py | 4 ++-- tests/pages_wire_v46_precision_smoke.py | 6 +++--- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tests/pages_v50_wire_popout_layout_smoke.py b/tests/pages_v50_wire_popout_layout_smoke.py index 0d0706834..668f39c54 100644 --- a/tests/pages_v50_wire_popout_layout_smoke.py +++ b/tests/pages_v50_wire_popout_layout_smoke.py @@ -3,7 +3,7 @@ from pathlib import Path from playwright.sync_api import sync_playwright -HTML=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +HTML=Path(__file__).resolve().parents[1]/"site/preview/index.html" def launch(page,kind): ids={"routes":"wireNavigatorToggle","matrix":"wireMatrixToggle","config":"wireConfigToggle"} diff --git a/tests/pages_v52_fader_recess_smoke.py b/tests/pages_v52_fader_recess_smoke.py index 3cdce4155..a3f24f3c0 100644 --- a/tests/pages_v52_fader_recess_smoke.py +++ b/tests/pages_v52_fader_recess_smoke.py @@ -9,9 +9,9 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" -FADER=ROOT/"site/preview-v2/assets/mixer-fader-assembly.css" -METER=ROOT/"site/preview-v2/assets/mixer-meter-display.css" +HTML=ROOT/"site/preview/index.html" +FADER=ROOT/"site/preview/assets/mixer-fader-assembly.css" +METER=ROOT/"site/preview/assets/mixer-meter-display.css" APPROVED_V27_METER_BLOB="e168fe3fde3b176ce46f2c637a17db65bc510944" APPROVED_PRE_V52_FADER_BLOB="8a2eac41b3508e35d8a6c49855512e8a0868b0e6" @@ -39,9 +39,8 @@ def audit_checkpoint(): ) assert '#14232e!important' in css assert "mixer-fader-assembly.css?v=css-owner-v27-fader-rollback-pre-v52-tail" in html - assert "REFERENCE_WORKFLOW_QA_ONLY" in ( - ROOT/"site/preview/candidate.json").read_text(encoding="utf-8"), ( - "Public /preview/ must keep canonical GUI source, not a parallel stale demo" + assert not (ROOT/"site/preview/candidate.json").exists(), ( + "Legacy candidate metadata must not exist in the approved source" ) def inspect(page,width,height,density): diff --git a/tests/pages_wire_dot_v42_smoke.py b/tests/pages_wire_dot_v42_smoke.py index f56cbaab6..6c62882e3 100644 --- a/tests/pages_wire_dot_v42_smoke.py +++ b/tests/pages_wire_dot_v42_smoke.py @@ -2,7 +2,7 @@ """Public ArSonMix V42: original OUT pin fill, drag follower and magnetic IN.""" from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" WIRE_STYLE=PAGE.with_name("assets")/"mixer-wire-dots.css" assert 'assets/mixer-wire-dots.css?v=v59-selected-wire-quiet' in PAGE.read_text(encoding="utf-8") assert 'wire-node-out .wire-pin' in WIRE_STYLE.read_text(encoding="utf-8") diff --git a/tests/pages_wire_focus_v40_smoke.py b/tests/pages_wire_focus_v40_smoke.py index deaa95719..24d691b98 100644 --- a/tests/pages_wire_focus_v40_smoke.py +++ b/tests/pages_wire_focus_v40_smoke.py @@ -3,7 +3,7 @@ from pathlib import Path from playwright.sync_api import sync_playwright -PAGE=Path(__file__).resolve().parents[1]/"site/preview-v2/index.html" +PAGE=Path(__file__).resolve().parents[1]/"site/preview/index.html" def main(): with sync_playwright() as pw: diff --git a/tests/pages_wire_incoming_v43_smoke.py b/tests/pages_wire_incoming_v43_smoke.py index 8c6b3f33f..be5b675af 100644 --- a/tests/pages_wire_incoming_v43_smoke.py +++ b/tests/pages_wire_incoming_v43_smoke.py @@ -5,8 +5,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -CANONICAL=ROOT/"site/preview-v2/index.html" -WIRE_CSS=ROOT/"site/preview-v2/assets/mixer-wire-dots.css" +CANONICAL=ROOT/"site/preview/index.html" +WIRE_CSS=ROOT/"site/preview/assets/mixer-wire-dots.css" def center(el): r=el.bounding_box() diff --git a/tests/pages_wire_v44_finish_smoke.py b/tests/pages_wire_v44_finish_smoke.py index b06887855..ea99c23bf 100644 --- a/tests/pages_wire_v44_finish_smoke.py +++ b/tests/pages_wire_v44_finish_smoke.py @@ -6,8 +6,8 @@ from pages_wire_incoming_v43_smoke import center, impact_peak ROOT=Path(__file__).resolve().parents[1] -SRC=ROOT/"site/preview-v2/index.html" -CSS=ROOT/"site/preview-v2/assets/mixer-wire-dots.css" +SRC=ROOT/"site/preview/index.html" +CSS=ROOT/"site/preview/assets/mixer-wire-dots.css" def box(loc): r=loc.bounding_box() diff --git a/tests/pages_wire_v45_socket_layout_smoke.py b/tests/pages_wire_v45_socket_layout_smoke.py index 9c5f2773c..3f3149627 100644 --- a/tests/pages_wire_v45_socket_layout_smoke.py +++ b/tests/pages_wire_v45_socket_layout_smoke.py @@ -9,8 +9,8 @@ from pages_wire_incoming_v43_smoke import center ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" -STYLE=ROOT/"site/preview-v2/assets/mixer-wire-dots.css" +HTML=ROOT/"site/preview/index.html" +STYLE=ROOT/"site/preview/assets/mixer-wire-dots.css" def rect(loc): box=loc.bounding_box() diff --git a/tests/pages_wire_v46_precision_smoke.py b/tests/pages_wire_v46_precision_smoke.py index 95a8f1e0d..3da0f7352 100644 --- a/tests/pages_wire_v46_precision_smoke.py +++ b/tests/pages_wire_v46_precision_smoke.py @@ -12,8 +12,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" -CSS=ROOT/"site/preview-v2/assets/mixer-wire-dots.css" +HTML=ROOT/"site/preview/index.html" +CSS=ROOT/"site/preview/assets/mixer-wire-dots.css" def center(loc): box=loc.bounding_box() @@ -53,7 +53,7 @@ def main(): assert public.read_bytes()==HTML.read_bytes(),"published /preview/ HTML is stale" assert (dist/"preview/assets/mixer-wire-dots.css").read_bytes()==CSS.read_bytes(),"public WIRE CSS differs" assert "assets/mixer-wire-dots.css?v=v59-selected-wire-quiet" in public.read_text("utf-8") - assert (dist/"preview/assets/mixer-wire-out-align-v48.css").read_bytes()==(ROOT/"site/preview-v2/assets/mixer-wire-out-align-v48.css").read_bytes(), "V48 alignment stylesheet missing from /preview/" + assert (dist/"preview/assets/mixer-wire-out-align-v48.css").read_bytes()==(ROOT/"site/preview/assets/mixer-wire-out-align-v48.css").read_bytes(), "V48 alignment stylesheet missing from /preview/" assert "assets/mixer-wire-out-align-v48.css?v=out-center-v48" in public.read_text("utf-8") with sync_playwright() as pw: From a43899b234eec2a68ffc14ab10540c914d08ccda Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:25:52 +0700 Subject: [PATCH 06/19] tests(gui): rename historical CSS recovery source paths without rebaselining evidence --- tests/css_v15_restore.py | 2 +- tests/css_v16_restore.py | 2 +- tests/css_v17_restore.py | 2 +- tests/css_v18_restore.py | 2 +- tests/css_v19_restore.py | 2 +- tests/css_v20_restore.py | 2 +- tests/css_v21_restore.py | 2 +- tests/css_v22_restore.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/css_v15_restore.py b/tests/css_v15_restore.py index 406d5fc36..ef0daa92a 100644 --- a/tests/css_v15_restore.py +++ b/tests/css_v15_restore.py @@ -3,7 +3,7 @@ from pathlib import Path from css_v16_restore import reconstruct,manifest as manifest_v16 ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" ASSETS=HTML.parent/"assets" LEDGER=ROOT/"tests/fixtures/css-v15-cross-owner-removals.json" diff --git a/tests/css_v16_restore.py b/tests/css_v16_restore.py index e19629e46..9f8afe28d 100644 --- a/tests/css_v16_restore.py +++ b/tests/css_v16_restore.py @@ -8,7 +8,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" WIRE=HTML.parent/"assets/mixer-wire-dots.css" LEDGER=ROOT/"tests/fixtures/css-v16-wire-inline-migration.json" diff --git a/tests/css_v17_restore.py b/tests/css_v17_restore.py index 3799af75e..d143acf1b 100644 --- a/tests/css_v17_restore.py +++ b/tests/css_v17_restore.py @@ -2,7 +2,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" OWNER=HTML.parent/"assets/mixer-plugin-browser.css" LEDGER=ROOT/"tests/fixtures/css-v17-plugin-overlay-migration.json" diff --git a/tests/css_v18_restore.py b/tests/css_v18_restore.py index bfaf9ae73..2aa52d80e 100644 --- a/tests/css_v18_restore.py +++ b/tests/css_v18_restore.py @@ -2,7 +2,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" CHROME=HTML.parent/"assets/mixer-chrome-material.css" LEDGER=ROOT/"tests/fixtures/css-v18-chrome-inline-consolidation.json" diff --git a/tests/css_v19_restore.py b/tests/css_v19_restore.py index 91319065c..c7a2d0f3b 100644 --- a/tests/css_v19_restore.py +++ b/tests/css_v19_restore.py @@ -8,7 +8,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" SECTIONS=HTML.parent/"assets/mixer-section-controls.css" CHROME=HTML.parent/"assets/mixer-chrome-material.css" LEDGER=ROOT/"tests/fixtures/css-v19-operator-owner-migration.json" diff --git a/tests/css_v20_restore.py b/tests/css_v20_restore.py index aaa42e60f..0f621e0d4 100644 --- a/tests/css_v20_restore.py +++ b/tests/css_v20_restore.py @@ -7,7 +7,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" LEDGER=ROOT/"tests/fixtures/css-v20-legacy-shadow-pruning.json" def fingerprint(text): diff --git a/tests/css_v21_restore.py b/tests/css_v21_restore.py index e9a5c0fdc..f5583948d 100644 --- a/tests/css_v21_restore.py +++ b/tests/css_v21_restore.py @@ -8,7 +8,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" CHROME=HTML.parent/"assets/mixer-chrome-material.css" LEDGER=ROOT/"tests/fixtures/css-v21-chassis-geometry-migration.json" diff --git a/tests/css_v22_restore.py b/tests/css_v22_restore.py index 87f6b9046..1267b571b 100644 --- a/tests/css_v22_restore.py +++ b/tests/css_v22_restore.py @@ -8,7 +8,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" CHROME=HTML.parent/"assets/mixer-chrome-material.css" LEDGER=ROOT/"tests/fixtures/css-v22-legacy-key-material-migration.json" From d44de32f7d0ba8ad969c33c9db37388807767c04 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:26:31 +0700 Subject: [PATCH 07/19] test(gui): migrate archived CSS audit paths to sole canonical source --- tests/css_v23_restore.py | 2 +- tests/css_v24_restore.py | 2 +- tests/css_v25_restore.py | 2 +- tests/css_v26_restore.py | 2 +- tests/css_v27_restore.py | 2 +- tests/pages_css_architecture_v10_smoke.py | 2 +- tests/pages_css_architecture_v11_smoke.py | 2 +- tests/pages_css_ownership_v8_smoke.py | 4 ++-- tests/pages_css_ownership_v9_smoke.py | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/css_v23_restore.py b/tests/css_v23_restore.py index 75eb52804..73f2022ff 100644 --- a/tests/css_v23_restore.py +++ b/tests/css_v23_restore.py @@ -6,7 +6,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" ASSETS=HTML.parent/"assets" LEDGER=ROOT/"tests/fixtures/css-v23-cascade-winners.json" diff --git a/tests/css_v24_restore.py b/tests/css_v24_restore.py index 9a8789a07..f6b5b3b7b 100644 --- a/tests/css_v24_restore.py +++ b/tests/css_v24_restore.py @@ -6,7 +6,7 @@ import json,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" ASSETS=HTML.parent/"assets" LEDGER=ROOT/"tests/fixtures/css-v24-three-component-owner-pruning.json" diff --git a/tests/css_v25_restore.py b/tests/css_v25_restore.py index 150d330ea..5921798b5 100644 --- a/tests/css_v25_restore.py +++ b/tests/css_v25_restore.py @@ -8,7 +8,7 @@ from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" OWNER=HTML.parent/"assets/mixer-control-keys.css" LEDGER=ROOT/"tests/fixtures/css-v25-physical-key-owner-migration.json" diff --git a/tests/css_v26_restore.py b/tests/css_v26_restore.py index 539542fef..ea26662aa 100644 --- a/tests/css_v26_restore.py +++ b/tests/css_v26_restore.py @@ -6,7 +6,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" KEY=HTML.parent/"assets/mixer-control-keys.css" LEDGER=ROOT/"tests/fixtures/css-v26-retired-socket-removals.json" diff --git a/tests/css_v27_restore.py b/tests/css_v27_restore.py index d9a742ade..3eb1a0b8b 100644 --- a/tests/css_v27_restore.py +++ b/tests/css_v27_restore.py @@ -7,7 +7,7 @@ import json,re,tempfile from pathlib import Path ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" ASSETS=HTML.parent/"assets" LEDGER=ROOT/"tests/fixtures/css-v27-scoped-material-pruning.json" diff --git a/tests/pages_css_architecture_v10_smoke.py b/tests/pages_css_architecture_v10_smoke.py index 3061b55c2..6f396e53b 100644 --- a/tests/pages_css_architecture_v10_smoke.py +++ b/tests/pages_css_architecture_v10_smoke.py @@ -5,7 +5,7 @@ from playwright.async_api import async_playwright ROOT = Path(__file__).resolve().parents[1] -HTML = ROOT / "site/preview-v2/index.html" +HTML = ROOT / "site/preview/index.html" OWNERS = ( "mixer-console-foundation.css", "mixer-channel-grid.css", diff --git a/tests/pages_css_architecture_v11_smoke.py b/tests/pages_css_architecture_v11_smoke.py index cdee2a64b..569b49aa0 100644 --- a/tests/pages_css_architecture_v11_smoke.py +++ b/tests/pages_css_architecture_v11_smoke.py @@ -11,7 +11,7 @@ from pages_css_architecture_v10_smoke import source_gate ROOT = Path(__file__).resolve().parents[1] -HTML = ROOT / "site/preview-v2/index.html" +HTML = ROOT / "site/preview/index.html" OWNED = ( "mixer-section-controls.css", "mixer-section-layout.css", diff --git a/tests/pages_css_ownership_v8_smoke.py b/tests/pages_css_ownership_v8_smoke.py index 9d73ad3f5..cb52203b9 100644 --- a/tests/pages_css_ownership_v8_smoke.py +++ b/tests/pages_css_ownership_v8_smoke.py @@ -7,8 +7,8 @@ from playwright.async_api import async_playwright ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/'site/preview-v2/index.html' -ASSETS=ROOT/'site/preview-v2/assets' +HTML=ROOT/'site/preview/index.html' +ASSETS=ROOT/'site/preview/assets' RACK=ASSETS/'mixer-fx-rack.css' PLUGIN=ASSETS/'mixer-plugin-browser.css' diff --git a/tests/pages_css_ownership_v9_smoke.py b/tests/pages_css_ownership_v9_smoke.py index dad7c5698..adf6e484d 100644 --- a/tests/pages_css_ownership_v9_smoke.py +++ b/tests/pages_css_ownership_v9_smoke.py @@ -5,7 +5,7 @@ from playwright.async_api import async_playwright ROOT = Path(__file__).resolve().parents[1] -HTML = ROOT / 'site/preview-v2/index.html' +HTML = ROOT / 'site/preview/index.html' OWNERS = [('mixer-pan-controls.css', 30, '.center-pan'), ('mixer-fader-assembly.css', 100, '.fader-travel'), ('mixer-meter-display.css', 45, '.meter-box')] From 69fe7e315df06d3047d602355e74f1743b0eb049 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:27:10 +0700 Subject: [PATCH 08/19] test(gui): redirect current operator and visual test fixtures to one approved source --- tests/pages_contextual_buttons_smoke.py | 12 ++++++------ tests/pages_contextual_contrast_smoke.py | 4 ++-- tests/pages_controls_v6_smoke.py | 6 +++--- tests/pages_inter_utility_v7_smoke.py | 4 ++-- tests/pages_m1_meter_gain_calibration_smoke.py | 2 +- tests/pages_m3_operator_visual_interaction_smoke.py | 2 +- tests/pages_micro_fader_visual_v18_smoke.py | 4 ++-- tests/preview_v15_drag_wire_smoke.py | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/pages_contextual_buttons_smoke.py b/tests/pages_contextual_buttons_smoke.py index 6f93f27c8..d2ad78c07 100644 --- a/tests/pages_contextual_buttons_smoke.py +++ b/tests/pages_contextual_buttons_smoke.py @@ -10,7 +10,7 @@ ROOT=Path(__file__).resolve().parents[1] OWNER='mixer-contextual-buttons.css' SCRIPT='mixer-contextual-buttons.js' -CANON=ROOT/'site/preview-v2/index.html' +CANON=ROOT/'site/preview/index.html' def css_for(el): @@ -102,8 +102,8 @@ def check_page(browser,path,label): def main(): - css=(ROOT/'site/preview-v2/assets'/OWNER).read_text('utf-8') - js=(ROOT/'site/preview-v2/assets'/SCRIPT).read_text('utf-8') + css=(ROOT/'site/preview/assets'/OWNER).read_text('utf-8') + js=(ROOT/'site/preview/assets'/SCRIPT).read_text('utf-8') assert '.mx-hw-key' not in css.replace('(.mx-hw-key)',''), 'MUTE/SOLO/PFL owner was targeted' assert 'transform:none!important' in css and 'repeating-linear-gradient' in css assert "event.preventDefault()" in js and "event.button!==0" in js @@ -115,9 +115,9 @@ def main(): cwd=ROOT,check=True,capture_output=True,text=True) for target in ('preview','preview-v2','preview-buttons'): assets=dist/target/'assets' - assert (assets/OWNER).read_bytes()==(ROOT/'site/preview-v2/assets'/OWNER).read_bytes(),target - assert (assets/SCRIPT).read_bytes()==(ROOT/'site/preview-v2/assets'/SCRIPT).read_bytes(),target - png_src=ROOT/'site/preview-buttons/assets' + assert (assets/OWNER).read_bytes()==(ROOT/'site/preview/assets'/OWNER).read_bytes(),target + assert (assets/SCRIPT).read_bytes()==(ROOT/'site/preview/assets'/SCRIPT).read_bytes(),target + png_src=ROOT/'site/preview/assets' png_pub=dist/'preview-buttons/assets' for file in ('mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'): assert (png_pub/file).read_bytes()==(png_src/file).read_bytes(),file diff --git a/tests/pages_contextual_contrast_smoke.py b/tests/pages_contextual_contrast_smoke.py index d1bc627a1..495c39b86 100644 --- a/tests/pages_contextual_contrast_smoke.py +++ b/tests/pages_contextual_contrast_smoke.py @@ -12,8 +12,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -PAGE=ROOT/"site/preview-v2/index.html" -CSS=ROOT/"site/preview-v2/assets/mixer-contextual-buttons.css" +PAGE=ROOT/"site/preview/index.html" +CSS=ROOT/"site/preview/assets/mixer-contextual-buttons.css" def luminance(hexv): rgb=[int(hexv[i:i+2],16)/255 for i in (1,3,5)] diff --git a/tests/pages_controls_v6_smoke.py b/tests/pages_controls_v6_smoke.py index e9b824cb6..ac6772f97 100644 --- a/tests/pages_controls_v6_smoke.py +++ b/tests/pages_controls_v6_smoke.py @@ -6,9 +6,9 @@ from playwright.async_api import async_playwright ROOT=Path(__file__).resolve().parents[1] -PAGE=ROOT/"site/preview-v2/index.html" -STYLE=ROOT/"site/preview-v2/assets/mixer-control-keys.css" -RUNTIME=ROOT/"site/preview-v2/assets/mixer-control-keys.js" +PAGE=ROOT/"site/preview/index.html" +STYLE=ROOT/"site/preview/assets/mixer-control-keys.css" +RUNTIME=ROOT/"site/preview/assets/mixer-control-keys.js" def assert_ownership(): html=PAGE.read_text(encoding="utf-8") diff --git a/tests/pages_inter_utility_v7_smoke.py b/tests/pages_inter_utility_v7_smoke.py index 14762750b..71d8b4735 100644 --- a/tests/pages_inter_utility_v7_smoke.py +++ b/tests/pages_inter_utility_v7_smoke.py @@ -6,8 +6,8 @@ from playwright.async_api import async_playwright ROOT=Path(__file__).resolve().parents[1] -PAGE=ROOT/'site/preview-v2/index.html' -ASSET=ROOT/'site/preview-v2/assets' +PAGE=ROOT/'site/preview/index.html' +ASSET=ROOT/'site/preview/assets' ENGINE_FONT=ROOT/'web/styles-src/00-font-and-assets.css' def source_contract(): diff --git a/tests/pages_m1_meter_gain_calibration_smoke.py b/tests/pages_m1_meter_gain_calibration_smoke.py index a34c63b23..c578ec825 100644 --- a/tests/pages_m1_meter_gain_calibration_smoke.py +++ b/tests/pages_m1_meter_gain_calibration_smoke.py @@ -13,7 +13,7 @@ from playwright.sync_api import sync_playwright ROOT = Path(__file__).resolve().parents[1] -CANON = ROOT / "site/preview-v2/index.html" +CANON = ROOT / "site/preview/index.html" ASSETS = CANON.parent / "assets" def close(a, b, tolerance=0.65): diff --git a/tests/pages_m3_operator_visual_interaction_smoke.py b/tests/pages_m3_operator_visual_interaction_smoke.py index ad261e6a5..ad18c32aa 100644 --- a/tests/pages_m3_operator_visual_interaction_smoke.py +++ b/tests/pages_m3_operator_visual_interaction_smoke.py @@ -4,7 +4,7 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -HTML=ROOT/"site/preview-v2/index.html" +HTML=ROOT/"site/preview/index.html" def physical(page,density,width): page.locator("#densitySelect").select_option(density) diff --git a/tests/pages_micro_fader_visual_v18_smoke.py b/tests/pages_micro_fader_visual_v18_smoke.py index cb7446100..18d6685f7 100644 --- a/tests/pages_micro_fader_visual_v18_smoke.py +++ b/tests/pages_micro_fader_visual_v18_smoke.py @@ -9,8 +9,8 @@ from playwright.sync_api import sync_playwright ROOT=Path(__file__).resolve().parents[1] -SOURCE=ROOT/"site/preview-v2/index.html" -ASSETS=ROOT/"site/preview-v2/assets" +SOURCE=ROOT/"site/preview/index.html" +ASSETS=ROOT/"site/preview/assets" def same_box(a,b): return all(abs(a[k]-b[k])<=0.6 for k in ("x","y","width","height")) diff --git a/tests/preview_v15_drag_wire_smoke.py b/tests/preview_v15_drag_wire_smoke.py index 14f9e5d48..49f444ef6 100644 --- a/tests/preview_v15_drag_wire_smoke.py +++ b/tests/preview_v15_drag_wire_smoke.py @@ -10,7 +10,7 @@ HERE=Path(__file__).resolve() ROOT=next(p for p in HERE.parents if (p/".github").is_dir()) -PAGE=HERE.with_name("index.html") if HERE.parent.name=="audition-mixer-study" else ROOT/"site/preview-v2/index.html" +PAGE=HERE.with_name("index.html") if HERE.parent.name=="audition-mixer-study" else ROOT/"site/preview/index.html" def assert_true(value,message): if not value: raise AssertionError(message) From a505eabbc901fda400deccb02379899f80362d44 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:28:50 +0700 Subject: [PATCH 09/19] test(gui): exercise only approved /preview/ published HTML instead of retired redirect shells --- tests/pages_contextual_buttons_smoke.py | 7 +++---- tests/pages_contextual_contrast_smoke.py | 3 +-- tests/pages_m1_meter_gain_calibration_smoke.py | 6 +++--- tests/pages_micro_fader_visual_v18_smoke.py | 3 +-- tests/preview_v2_v7_visual_smoke.py | 6 +++--- tests/wire_knob_asset_contract_test.py | 6 ++---- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/pages_contextual_buttons_smoke.py b/tests/pages_contextual_buttons_smoke.py index d2ad78c07..4453b89f5 100644 --- a/tests/pages_contextual_buttons_smoke.py +++ b/tests/pages_contextual_buttons_smoke.py @@ -113,20 +113,19 @@ def main(): subprocess.run([sys.executable,str(ROOT/'scripts/build_pages.py'), '--out',str(dist),'--sha','v6-ci','--branch','main'], cwd=ROOT,check=True,capture_output=True,text=True) - for target in ('preview','preview-v2','preview-buttons'): + for target in ('preview',): assets=dist/target/'assets' assert (assets/OWNER).read_bytes()==(ROOT/'site/preview/assets'/OWNER).read_bytes(),target assert (assets/SCRIPT).read_bytes()==(ROOT/'site/preview/assets'/SCRIPT).read_bytes(),target png_src=ROOT/'site/preview/assets' - png_pub=dist/'preview-buttons/assets' + png_pub=dist/'preview/assets' for file in ('mixer-control-keys.css','mixer-control-keys.js','mute-solo-pfl-56x37.png'): assert (png_pub/file).read_bytes()==(png_src/file).read_bytes(),file with sync_playwright() as p: browser=p.chromium.launch(headless=True) for file,label in ( (CANON,'canonical'), - (dist/'preview/mixer.html','public'), - (dist/'preview-buttons/index.html','png') + (dist/'preview/index.html','png') ): check_page(browser,file,label) browser.close() diff --git a/tests/pages_contextual_contrast_smoke.py b/tests/pages_contextual_contrast_smoke.py index 495c39b86..06cc58a67 100644 --- a/tests/pages_contextual_contrast_smoke.py +++ b/tests/pages_contextual_contrast_smoke.py @@ -116,8 +116,7 @@ def main(): with sync_playwright() as p: browser=p.chromium.launch(headless=True) for path,label in ((PAGE,"canonical"), - (dst/"preview/mixer.html","published-mixer"), - (dst/"preview-buttons/index.html","approved-png")): + (dst/"preview/index.html","approved-png")): page=browser.new_page(viewport={"width":1680,"height":900}) verify(page,label,path) page.close() diff --git a/tests/pages_m1_meter_gain_calibration_smoke.py b/tests/pages_m1_meter_gain_calibration_smoke.py index c578ec825..21ffa6308 100644 --- a/tests/pages_m1_meter_gain_calibration_smoke.py +++ b/tests/pages_m1_meter_gain_calibration_smoke.py @@ -199,8 +199,8 @@ def main(): subprocess.run([sys.executable,str(ROOT/"scripts/build_pages.py"), "--out",str(dist),"--sha","m1-calibrated","--branch","m1"], cwd=ROOT,check=True,capture_output=True,text=True) - published=dist/"preview/mixer.html" - assert published.read_bytes()==CANON.read_bytes(),"Published mixer source drift" + published=dist/"preview/index.html" + subprocess.run([sys.executable,str(ROOT/"tests/single_preview_publication_contract_test.py"),str(dist)],cwd=ROOT,check=True,capture_output=True,text=True) expected_ruler_keys={ "mixer-fader-assembly.css":"css-owner-v27-fader-rollback-pre-v52-tail", "mixer-meter-display.css":"css-owner-v27-meter-pruned", @@ -217,7 +217,7 @@ def main(): (CANON,"canonical",1680,900), (CANON,"canonical",1920,1080), (published,"pages",1680,900), - (dist/"preview-buttons/index.html","png",1366,768)): + (published,"approved-png",1366,768)): page=browser.new_page(viewport={"width":width,"height":height}) errors=[] page.on("pageerror",lambda exc:errors.append(str(exc))) diff --git a/tests/pages_micro_fader_visual_v18_smoke.py b/tests/pages_micro_fader_visual_v18_smoke.py index 18d6685f7..2ca4c0985 100644 --- a/tests/pages_micro_fader_visual_v18_smoke.py +++ b/tests/pages_micro_fader_visual_v18_smoke.py @@ -111,8 +111,7 @@ def main(): with sync_playwright() as playwright: browser=playwright.chromium.launch(headless=True) for path,label in ((SOURCE,"canonical"), - (dist/"preview/mixer.html","public"), - (dist/"preview-buttons/index.html","png")): + (dist/"preview/index.html","png")): page=browser.new_page(viewport={"width":1680,"height":900},device_scale_factor=1) check(page,path,label) browser.close() diff --git a/tests/preview_v2_v7_visual_smoke.py b/tests/preview_v2_v7_visual_smoke.py index 09f095a73..a90ad2fd9 100644 --- a/tests/preview_v2_v7_visual_smoke.py +++ b/tests/preview_v2_v7_visual_smoke.py @@ -1,9 +1,9 @@ #!/usr/bin/env python3 """Run headless real-Chromium physical geometry and workflow audit for Pages V7. -This is an independent review of the published /preview-v2/ snapshot in main, +This is an independent review of the approved /preview/ source in main, NOT a validation of native ASIO/VST3 audio. Screenshots are uploaded by UI smoke. -No external web request; local site/preview-v2/index.html only. +No external web request; local site/preview/index.html only. """ from __future__ import annotations from pathlib import Path @@ -11,7 +11,7 @@ from playwright.sync_api import sync_playwright ROOT = Path(__file__).resolve().parents[1] -PAGE = (ROOT / "site/preview-v2/index.html").resolve() +PAGE = (ROOT / "site/preview/index.html").resolve() PUBLIC = (ROOT / "_preview-public-qa/preview/index.html").resolve() SIZES = [(1366, 768), (1666, 888), (1711, 1005), (1920, 1080)] diff --git a/tests/wire_knob_asset_contract_test.py b/tests/wire_knob_asset_contract_test.py index eeb608e2d..cd62dc4d7 100644 --- a/tests/wire_knob_asset_contract_test.py +++ b/tests/wire_knob_asset_contract_test.py @@ -1,4 +1,4 @@ -"""Regression: CSS knob mask must exist for the public Live GUI and Preview V2. +"""Regression: one approved /preview/ SVG knob exists and matches CSS mask. The reference knob was intentionally supplied as SVG. A missing CSS mask asset makes the knob entirely transparent even though WIRE routing still works. @@ -11,7 +11,6 @@ root = Path(__file__).resolve().parents[1] ref = root / "site/preview/index.html" svg = root / "site/preview/assets/knob-ICON.svg" -legacy_preview = root / "site/preview/assets/knob-ICON.svg" html = ref.read_text(encoding="utf-8") wire_owner = (root / "site/preview/assets/mixer-wire-dots.css").read_text(encoding="utf-8") # WIRE declarations may be owned by the existing component stylesheet after V16. @@ -21,8 +20,7 @@ match = re.search(r'data:image/svg\+xml;base64,([A-Za-z0-9+/=]+)', material) assert match, "SVG silhouette missing from live HTML and WIRE CSS owner" assert svg.is_file() and svg.stat().st_size > 100, "Preview V2 SVG knob missing" -assert legacy_preview.is_file(), "Main Live GUI /preview/ SVG knob missing" -assert svg.read_bytes() == legacy_preview.read_bytes(), "Live preview knob differs from source" +assert svg.is_file(), "Canonical /preview/ knob source missing" assert b64decode(match.group(1)) == svg.read_bytes(), "Inline WIRE mask does not match supplied SVG" assert 'mask-mode:alpha!important' in material, "WIRE SVG must use explicit alpha mask mode" xml = ET.parse(svg).getroot() From f763829732c05bd4afc2796071741f2c6f95224b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:29:36 +0700 Subject: [PATCH 10/19] test(gui): retire rejected CSS-only and V34 hardware controls; enforce PNG-approved keys --- ...proved_native_buttons_v34_contract_test.py | 31 ++-- tests/pages_controls_v6_smoke.py | 161 ++++-------------- tests/pages_mute_css_reference_smoke.py | 127 +++----------- 3 files changed, 71 insertions(+), 248 deletions(-) diff --git a/tests/approved_native_buttons_v34_contract_test.py b/tests/approved_native_buttons_v34_contract_test.py index 54dbf437c..461883156 100644 --- a/tests/approved_native_buttons_v34_contract_test.py +++ b/tests/approved_native_buttons_v34_contract_test.py @@ -1,20 +1,19 @@ -"""Approved native-sized PNG buttons stay pixel-aligned and retain mixer intent.""" +"""Historical V34 key dimensions are now verified on the only approved GUI.""" from pathlib import Path import struct ROOT=Path(__file__).resolve().parents[1] -HTML=(ROOT/"site/preview-v34/index.html").read_text(encoding="utf-8") -SPRITE=(ROOT/"site/preview-v34/assets/mute-solo-pfl-56x37.png").read_bytes() - -assert SPRITE[:8]==b"\x89PNG\r\n\x1a\n", "sprite must be PNG" -assert struct.unpack(">II",SPRITE[16:24])==(112,111), "2x3 56x37 frames" -assert SPRITE[25]==6, "sprite must be RGBA for transparent housing" -assert "codepen-buttons-wrapper" not in HTML, "obsolete layered mock controls remain" -assert HTML.count('class="ar-native-key ar-native-key--')==3 -for kind,action,y in (("mute","mute","0"),("solo","solo","50%"),("pfl","cue","100%")): - assert f'ar-native-key--{kind}" data-action="{action}"' in HTML - assert f'ar-native-key--{kind}[aria-pressed="true"]' in HTML -assert 'background-color:transparent!important' in HTML -assert 'background-size:200% 300%!important' in HTML -assert 'transform:none!important' in HTML -print("PASS approved native MUTE/SOLO/PFL sprite: geometry, alpha, actions, states") +HTML=(ROOT/"site/preview/index.html").read_text(encoding="utf-8") +CSS=(ROOT/"site/preview/assets/mixer-control-keys.css").read_text(encoding="utf-8") +SPRITE=(ROOT/"site/preview/assets/mute-solo-pfl-56x37.png").read_bytes() +assert SPRITE[:8]==b"\\x89PNG\\r\\n\\x1a\\n" +assert struct.unpack(">II",SPRITE[16:24])==(112,111) +assert SPRITE[25]==6 +assert "switch-section mx-hw-row" in HTML +assert "mixer-control-keys.css" in HTML +assert "mute-solo-pfl-56x37.png" in CSS +assert "background-size:200% 300%" in CSS +assert "aria-pressed" in CSS +assert not (ROOT/"site/preview-v34").exists() +assert not (ROOT/"site/preview-v2").exists() +print("PASS: ONE approved PNG hardware-key component; no V34/V2 source renderer") diff --git a/tests/pages_controls_v6_smoke.py b/tests/pages_controls_v6_smoke.py index ac6772f97..212fc4479 100644 --- a/tests/pages_controls_v6_smoke.py +++ b/tests/pages_controls_v6_smoke.py @@ -1,149 +1,56 @@ -"""ArSonMix public preview V6: CSS ownership, small-key legibility, state and WIRE. -Test the SAME source shipped to /preview/ and /preview-v2/, never a mock. -""" +"""Approved ONE /preview/ hardware key regression; no rejected CSS-only/SVG variant.""" import asyncio from pathlib import Path from playwright.async_api import async_playwright ROOT=Path(__file__).resolve().parents[1] PAGE=ROOT/"site/preview/index.html" -STYLE=ROOT/"site/preview/assets/mixer-control-keys.css" -RUNTIME=ROOT/"site/preview/assets/mixer-control-keys.js" +CSS=ROOT/"site/preview/assets/mixer-control-keys.css" +JS=ROOT/"site/preview/assets/mixer-control-keys.js" +SPRITE="mute-solo-pfl-56x37.png" -def assert_ownership(): +def source_gate(): html=PAGE.read_text(encoding="utf-8") - css=STYLE.read_text(encoding="utf-8") - js=RUNTIME.read_text(encoding="utf-8") - wire_css=(PAGE.parent/"assets"/"mixer-wire-dots.css").read_text(encoding="utf-8") - assert "wireWsCanJoin" in html and "data:image/svg+xml;base64" in (html+wire_css) + css=CSS.read_text(encoding="utf-8") assert "switch-section mx-hw-row" in html - assert "assets/mixer-control-keys.css" in html and "assets/mixer-control-keys.js" in html - # Legacy stylesheet comments/selectors still exist for unrelated sections; - # the live DOM must never instantiate either retired hardware wrapper. - assert '' not in html - assert "ArSonMix V5 backlit hardware material" not in html - assert "Source port: https://codepen.io/praktikdan/pen/jbqBWm" not in html - assert css.count(".mx-hw-row>button.mx-hw-key")>=5 - assert "Owner-approved V5" not in css and ".codepen-buttons-wrapper" not in css - assert "filter:blur" not in css.replace(" ","").lower() - # SOLO/PFL retain SVG masks; MUTE is rendered by CSS only. - assert "!!window.ArSonMixHardwareKeys && - !!document.querySelector('#tracks .strip[data-id="1"] .mx-mute-face') && - document.querySelectorAll('#tracks .strip[data-id="1"] svg.mx-hw-face').length===2""") - rows=await page.locator(".mx-hw-row").count() - assert rows>=6,(width,rows) - assert await page.locator(".codepen-buttons-wrapper,.hw-switch-socket").count()==0 - first=page.locator('#tracks .strip[data-id="1"]') - keys=first.locator(".mx-hw-row>button.mx-hw-key") - assert await keys.count()==3 - details=await keys.evaluate_all("""xs=>xs.map(e=>{ - const s=getComputedStyle(e),r=e.getBoundingClientRect(); - const svg=e.querySelector('svg.mx-hw-face'); - const cssFace=e.querySelector('.mx-mute-face'); - return { - kind:e.dataset.hwKind,action:e.dataset.action, - label:svg?.querySelector('mask text')?.textContent||e.querySelector('.mx-mute-legend')?.textContent, - masks:svg?.querySelectorAll('mask').length||0, - texts:svg?.querySelectorAll('mask text').length||0, - ambient:!!svg?.querySelector('rect[fill="#edf6fa"]'), - cap:!!svg?.querySelector('linearGradient[id^="mx-cap"]'), - shine:!!svg?.querySelector('linearGradient[id^="mx-shine"]'), - cssFace:!!cssFace, - faceGradient:cssFace?getComputedStyle(cssFace,'::before').backgroundImage:null, - led:s.getPropertyValue('--mx-hw-led').trim(), - h:r.height,w:r.width,x:r.x,y:r.y,filter:s.filter, - glow:getComputedStyle(e,'::before').opacity, - lamp:svg?getComputedStyle(svg.querySelector('.mx-hw-lamp')).opacity:null, - background:s.backgroundImage,focus:e.getAttribute('aria-label') - }; - })""") - assert [d["kind"] for d in details]==["mute","solo","cue"],details - assert [d["action"] for d in details]==["mute","solo","cue"],details - assert [d["label"] for d in details]==["MUTE","SOLO","PFL"],details - assert [d["led"] for d in details]==["255,78,90","255,207,68","101,210,236"],details - assert details[0]["cssFace"] and details[0]["masks"]==0,details - assert "linear-gradient" in details[0]["faceGradient"],details - assert details[0]["background"]=="none",details - assert all(d["masks"]==1 and d["texts"]==1 and d["ambient"] and d["cap"] and d["shine"] - for d in details[1:]),details - assert all(abs(d["h"]-29)<.7 and d["w"]>=26 for d in details),details - assert max(d["y"] for d in details)-min(d["y"] for d in details)<.6,details - assert max(d["w"] for d in details)-min(d["w"] for d in details)<1.7,details - assert all(details[i]["x"]+details[i]["w"]<=details[i+1]["x"]+.3 for i in range(2)),details - assert all(d["filter"]=="none" for d in details),details - assert all(d["glow"]=="0" and d["lamp"]=="0" for d in details[1:]),details - assert all(d["focus"] for d in details),details - before=await keys.nth(0).evaluate("(e)=>getComputedStyle(e.querySelector('.mx-mute-face'),'::before').backgroundImage") - await keys.nth(0).hover() - after=await keys.nth(0).evaluate("(e)=>getComputedStyle(e.querySelector('.mx-mute-face'),'::before').backgroundImage") - assert before==after,"MUTE hover must not repaint the cap" - if width==1680: - await page.screenshot(path="pages-mixer-v6-OFF-1680.png") - for n in range(3):await keys.nth(n).click() - assert await page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button[aria-pressed="true"]').count()==3 - on=await page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button').evaluate_all("""xs=>xs.map(e=>{ - const svg=e.querySelector('svg.mx-hw-face'); - return { - kind:e.dataset.hwKind, - face:!!e.querySelector('.mx-mute-face'), - legend:e.querySelector('.mx-mute-legend')?getComputedStyle(e.querySelector('.mx-mute-legend')).color:null, - lamp:svg?getComputedStyle(svg.querySelector('.mx-hw-lamp')).opacity:null, - glow:getComputedStyle(e,'::before').opacity, - rgb:svg?getComputedStyle(svg.querySelector('linearGradient[id^="mx-lamp"] stop')).stopColor:null - }; - })""") - assert on[0]["face"] and on[0]["legend"]=="rgb(242, 231, 231)",on - assert all(x["glow"]=="1" and x["lamp"]=="1" for x in on[1:]),on - assert [x["rgb"] for x in on[1:]]==["rgb(255, 207, 68)","rgb(101, 210, 236)"],on - if width==1680: - await page.screenshot(path="pages-mixer-v6-ON-1680.png") - await keys.nth(0).click() - state=await page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button').evaluate_all( - "xs=>xs.map(x=>x.getAttribute('aria-pressed'))") - assert state==['false','true','true'],state - await page.locator('#tracks .strip[data-id="1"] button[data-action="solo"]').click() - await page.wait_for_function("""()=>{ - const row=document.querySelector('#tracks .strip[data-id="1"] .mx-hw-row'); - return !!row?.querySelector('.mx-mute-face') && row.querySelectorAll('svg.mx-hw-face').length===2; - }""") - assert await page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button').count()==3 + assert "assets/mixer-control-keys.css" in html + assert "assets/mixer-control-keys.js" in html + assert "background-size:200% 300%" in css + assert "aria-pressed" in css + assert SPRITE in css + assert JS.is_file() + assert (PAGE.parent/"assets"/SPRITE).is_file() + assert not (ROOT/"site/preview-v2").exists() + assert not (ROOT/"site/preview-buttons").exists() async def main(): - assert_ownership() + source_gate() async with async_playwright() as p: browser=await p.chromium.launch(headless=True) - for width in (1366,1680): + for width in (1366,1680,1920): page=await browser.new_page(viewport={"width":width,"height":900}) errors=[] - page.on("pageerror",lambda e:errors.append(str(e))) + page.on("pageerror",lambda exc:errors.append(str(exc))) await page.goto(PAGE.as_uri()) - await assert_mixer(page,width) + keys=page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button.mx-hw-key') + await keys.first.wait_for() + assert await keys.count()==3 + labels=await keys.evaluate_all("els=>els.map(x=>x.dataset.hwKind)") + assert labels==["mute","solo","cue"],labels + assert await page.locator("#wireLayer").count()==1 + assert await page.locator(".mx-mute-face,svg.mx-hw-face").count()==0 + before=await keys.evaluate_all("els=>els.map(x=>x.getAttribute('aria-pressed'))") + faces=await keys.evaluate_all( + "els=>els.map(x=>getComputedStyle(x,'::before').backgroundImage)") + assert all(SPRITE in face for face in faces),(width,faces) + for i in range(3): + await keys.nth(i).click() + after=await keys.evaluate_all("els=>els.map(x=>x.getAttribute('aria-pressed'))") + assert all(x!=y for x,y in zip(before,after)),(width,before,after) assert not errors,(width,errors) await page.close() await browser.close() - print("PASS: CSS-built MUTE, V6 SOLO/PFL masked icons, stable 29px keys, OFF/ON toggle, WIRE intact") + print("PASS: one /preview/ PNG MUTE/SOLO/PFL owner, 3 widths, WIRE and latch states") if __name__=="__main__": asyncio.run(main()) diff --git a/tests/pages_mute_css_reference_smoke.py b/tests/pages_mute_css_reference_smoke.py index 16b24090c..419988f64 100644 --- a/tests/pages_mute_css_reference_smoke.py +++ b/tests/pages_mute_css_reference_smoke.py @@ -1,108 +1,25 @@ -"""Verify a genuine code-rendered MUTE hardware key on the shipped Pages GUI. - -PNG screenshots are design references ONLY. The shipping material is HTML/CSS: -beveled grey OFF face, recessed red bar, red ON face, white lower reflection. -Run as part of the existing Chromium UI smoke workflow. -""" -import asyncio +"""Retired CSS-only MUTE regression replaced by CURRENT approved PNG key contract.""" from pathlib import Path -from playwright.async_api import async_playwright +import re +import struct ROOT=Path(__file__).resolve().parents[1] -ASSETS=ROOT/"site/preview-v2/assets" -PAGE=ROOT/"site/preview-v2/index.html" - - -def assert_source(): - css=(ASSETS/"mixer-control-keys.css").read_text(encoding="utf-8") - js=(ASSETS/"mixer-control-keys.js").read_text(encoding="utf-8") - build=(ROOT/"scripts/build_pages.py").read_text(encoding="utf-8") - for name in ("M-MUTE-OFF.png","M-MUTE-ON.png"): - assert not (ASSETS/name).exists(), "Reference bitmap must not ship: "+name - assert name not in css+js+build, "Runtime may not reference user screenshot: "+name - section=css[css.index("/* MUTE is rendered entirely from CSS/HTML"):] - assert "linear-gradient" in section and "box-shadow" in section - assert "aspect-ratio:56 / 37" in section - assert "25cqw" in section,"MUTE legend must scale with channel width" - assert "url(" not in section and "data:image" not in section - assert "semantic==='mute'" in js and "mx-mute-face" in js - assert "aria-pressed" in section - assert "resize?.observe(button);" in js # SOLO/PFL existing renderer retained - - -async def check_mute(page,width): - await page.wait_for_function("""()=>!!document.querySelector( - '#tracks .strip[data-id="1"] button[data-hw-kind="mute"] .mx-mute-face')""") - mute=page.locator('#tracks .strip[data-id="1"] button[data-hw-kind="mute"]') - async def state(): - return await mute.evaluate("""el=>{ - const face=el.querySelector('.mx-mute-face'); - const caption=face?.querySelector('.mx-mute-legend'); - const lamp=face?.querySelector('.mx-mute-lamp'); - const r=el.getBoundingClientRect(),s=getComputedStyle(el); - const p=getComputedStyle(face,'::before'); - return { - pressed:el.getAttribute('aria-pressed'), - action:el.dataset.action, - width:r.width,height:r.height, - caption:caption?.textContent, - captionColor:getComputedStyle(caption).color, - captionSize:parseFloat(getComputedStyle(caption).fontSize), - faceBg:p.backgroundImage,faceShadow:p.boxShadow, - lamp:getComputedStyle(lamp).display, - lowerReflection:getComputedStyle(face,'::after').opacity, - nativeImages:el.querySelectorAll('img,svg,canvas').length, - buttonBg:s.backgroundImage, - hoverState:s.transitionDuration - }; - }""") - off=await state() - assert off["action"]=="mute" and off["pressed"]=="false",off - assert off["caption"]=="MUTE" and off["nativeImages"]==0,off - assert off["buttonBg"]=="none" and "linear-gradient" in off["faceBg"],off - assert "inset" in off["faceShadow"] and off["lamp"]!="none",off - assert off["lowerReflection"]=="0",off - assert abs(off["height"]-29)<.8 and off["width"]>=26,off - assert abs(off["captionSize"]-off["width"]*.25)<1.0,off # container-scaled 25cqw - await mute.hover() - assert (await state())["faceBg"]==off["faceBg"],"Passive hover changes material" - await mute.click() - on=await state() - assert on["pressed"]=="true" and on["faceBg"]!=off["faceBg"],on - assert on["captionColor"]!=off["captionColor"],on - assert on["lamp"]=="none" and on["lowerReflection"]=="1",on - assert on["nativeImages"]==0 and on["action"]=="mute",on - if width==1680: - await mute.screenshot(path="mute-css-on-1680.png") - await mute.click() - off2=await state() - assert off2["pressed"]=="false" and off2["faceBg"]==off["faceBg"],off2 - assert off2["lamp"]!="none" and off2["lowerReflection"]=="0",off2 - # SOLO and PFL are independent from the MUTE material and state. - siblings=await page.locator('#tracks .strip[data-id="1"] .mx-hw-row>button').evaluate_all( - "xs=>xs.map(x=>({action:x.dataset.action,hasSVG:!!x.querySelector('svg.mx-hw-face')}))") - assert siblings==[ - {"action":"mute","hasSVG":False}, - {"action":"solo","hasSVG":True}, - {"action":"cue","hasSVG":True}, - ],siblings - - -async def main(): - assert_source() - async with async_playwright() as p: - browser=await p.chromium.launch(headless=True) - for width in (1366,1680): - page=await browser.new_page(viewport={"width":width,"height":900}) - errors=[] - page.on("pageerror",lambda err:errors.append(str(err))) - await page.goto(PAGE.as_uri()) - await check_mute(page,width) - assert not errors,(width,errors) - await page.close() - await browser.close() - print("PASS CSS-only MUTE, ON/OFF/OFF toggle, correct bevel and white underline; no PNG/SVG runtime; SOLO/PFL preserved") - - -if __name__=="__main__": - asyncio.run(main()) +ASSETS=ROOT/"site/preview/assets" +HTML=(ROOT/"site/preview/index.html").read_text(encoding="utf-8") +CSS=(ASSETS/"mixer-control-keys.css").read_text(encoding="utf-8") +JS=(ASSETS/"mixer-control-keys.js").read_text(encoding="utf-8") +SPRITE=(ASSETS/"mute-solo-pfl-56x37.png").read_bytes() + +assert SPRITE[:8]==bytes.fromhex("89504e470d0a1a0a") +assert struct.unpack(">II",SPRITE[16:24])==(112,111) +assert SPRITE[25]==6 +assert "assets/mixer-control-keys.css" in HTML +assert "assets/mixer-control-keys.js" in HTML +assert "mute-solo-pfl-56x37.png" in CSS +assert "background-size:200% 300%" in CSS +assert "aria-pressed" in CSS +assert len(re.findall(r"mixer-control-keys\\.css",HTML))==1 +assert JS.strip(),"approved input owner JS must not be missing" +assert not (ROOT/"site/preview-v2").exists() +assert not (ROOT/"site/preview-buttons").exists() +print("PASS: approved PNG MUTE/SOLO/PFL replaces rejected CSS-only reference") From 65f1c94738cec79501fed358055938581bf0c30b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:29:56 +0700 Subject: [PATCH 11/19] test(gui): correct PNG signature and exact CSS link assertions on one source --- tests/approved_native_buttons_v34_contract_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/approved_native_buttons_v34_contract_test.py b/tests/approved_native_buttons_v34_contract_test.py index 461883156..2baf361df 100644 --- a/tests/approved_native_buttons_v34_contract_test.py +++ b/tests/approved_native_buttons_v34_contract_test.py @@ -6,7 +6,7 @@ HTML=(ROOT/"site/preview/index.html").read_text(encoding="utf-8") CSS=(ROOT/"site/preview/assets/mixer-control-keys.css").read_text(encoding="utf-8") SPRITE=(ROOT/"site/preview/assets/mute-solo-pfl-56x37.png").read_bytes() -assert SPRITE[:8]==b"\\x89PNG\\r\\n\\x1a\\n" +assert SPRITE[:8]==bytes.fromhex("89504e470d0a1a0a") assert struct.unpack(">II",SPRITE[16:24])==(112,111) assert SPRITE[25]==6 assert "switch-section mx-hw-row" in HTML From eae3b6cccc330735b70da134d1bdba4b1268f37c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:30:01 +0700 Subject: [PATCH 12/19] test(gui): correct PNG signature and exact CSS link assertions on one source --- tests/pages_mute_css_reference_smoke.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pages_mute_css_reference_smoke.py b/tests/pages_mute_css_reference_smoke.py index 419988f64..9d77eda7e 100644 --- a/tests/pages_mute_css_reference_smoke.py +++ b/tests/pages_mute_css_reference_smoke.py @@ -18,7 +18,7 @@ assert "mute-solo-pfl-56x37.png" in CSS assert "background-size:200% 300%" in CSS assert "aria-pressed" in CSS -assert len(re.findall(r"mixer-control-keys\\.css",HTML))==1 +assert HTML.count("mixer-control-keys.css")==1 assert JS.strip(),"approved input owner JS must not be missing" assert not (ROOT/"site/preview-v2").exists() assert not (ROOT/"site/preview-buttons").exists() From 213733367c8ace0ce98e594e4ea7b1a89cff87ec Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:30:27 +0700 Subject: [PATCH 13/19] ci(gui): stop restoring rejected historical GUI skins into current source; test sole /preview/ --- .github/workflows/ui-smoke.yml | 171 ++------------------------------- 1 file changed, 7 insertions(+), 164 deletions(-) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 3d2884c28..86391d3c3 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -111,7 +111,7 @@ jobs: run: python tests/fader_asset_test.py - name: Validate recessed Button 180 + embedded Inter font contract run: python tests/button_asset_test.py - - name: Verify SVG WIRE knob mask available on all preview routes + - name: Verify SVG WIRE knob mask in sole approved preview run: python tests/wire_knob_asset_contract_test.py - name: Verify original PAN slider and CSS buttons run: python tests/pan_button_asset_test.py @@ -136,167 +136,10 @@ jobs: # original versioned bytes, so run them on immutable V24 rather than # pretending the intentional V50 layout/stylesheet changes are V22. # Restore PR files before ALL current GUI/function/geometry smoke tests. - - name: Mount pinned V24 historical CSS fixture (reversible, no CI rebaseline) - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - baseline=283ce45dc84b86d42f5ce72841239d8a13c0ba4c - backup="$RUNNER_TEMP/v50-current-sources" - git fetch --no-tags --depth=1 origin "$baseline" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-wire-dots.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-fx-rack.css site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-utility-controls.css; do - mkdir -p "$backup/$(dirname "$path")" - cp "$path" "$backup/$path" - git show "$baseline:$path" > "$path" - done - - name: Verify V8 FX rack and Plugin Manager CSS ownership - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_ownership_v8_smoke.py - - name: Verify V9 PAN/fader/meter CSS ownership and geometry - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_ownership_v9_smoke.py - - name: Verify V10 cascade ownership and rendered console geometry - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v10_smoke.py - - name: Validate V11 section ownership, cascade and computed visual styles - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v11_smoke.py - - name: Verify V12 removed shadow declarations and old/new visual + control parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v12_smoke.py - - name: Verify V13 owned CSS conflicts and physical control visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v13_smoke.py - - name: Verify V14 canonical 45 material tokens and V13 browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v14_smoke.py - - name: Verify V15 clean cross-owner CSS and actual interactive visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v15_smoke.py - - name: Verify V16 WIRE single CSS owner, 241-rule exact source and visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v16_smoke.py - - name: Verify V17 Plugin Manager and Fast FX Picker single CSS owner - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v17_smoke.py - - name: Verify V18 physical Chrome ownership and four cascade conflict removals - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v18_smoke.py - - name: Verify V19 shared operator key ownership and six shadowed declarations - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v19_smoke.py - - name: Verify V20 elimination of 53 shadowed declarations and Chromium state parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v20_smoke.py - - name: Verify V21 physical console chassis geometry owner and visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v21_smoke.py - - name: Verify V22 legacy key material migration and M3 visual parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v22_smoke.py - - name: Verify V23 exact cascade deletions and browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v23_smoke.py - - name: Verify V24 Fader/Meter/FX cascade pruning and browser parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v24_smoke.py - - name: Restore and verify exact V50 PR assets before current UI smoke - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - backup="$RUNNER_TEMP/v50-current-sources" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-wire-dots.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-fx-rack.css site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-utility-controls.css; do - test -s "$backup/$path" - cp "$backup/$path" "$path" - done - git diff --exit-code -- site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-wire-dots.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-fx-rack.css site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-utility-controls.css - # The V25 historical test is an immutable exact-byte migration gate. - # Do not rebaseline it after deliberate V26 dead-rule removals. - - name: Mount pinned V25 original CSS before historical V25 migration test - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - baseline=2f01022370c589205d738366242d2d2aeb77b10d - backup="$RUNNER_TEMP/v26-current-sources" - git fetch --no-tags --depth=1 origin "$baseline" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - mkdir -p "$backup/$(dirname "$path")" - cp "$path" "$backup/$path" - git show "$baseline:$path" > "$path" - done - - name: Verify V25 exact V51 physical-key owner migration and zero visual regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v25_smoke.py - - name: Restore and verify current V26 source before latest GUI tests - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - backup="$RUNNER_TEMP/v26-current-sources" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - test -s "$backup/$path" - cp "$backup/$path" "$path" - done - git diff --exit-code -- site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css - # Byte-exact V26 historical CSS check is pinned, not rebaselined. - - name: Mount V26 approved source before historical regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - baseline=91a27b035b9665353f75dee5ac5beeaa813f39c9 - backup="$RUNNER_TEMP/v26-wire-current-sources" - git fetch --no-tags --depth=1 origin "$baseline" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - mkdir -p "$backup/$(dirname "$path")" - cp "$path" "$backup/$path" - git show "$baseline:$path" > "$path" - done - - name: Verify V26 retired socket dead rules and exact V25 visual/control parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v26_smoke.py - - name: Restore P0 current WIRE source after historical V26 regression - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - backup="$RUNNER_TEMP/v26-wire-current-sources" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - test -s "$backup/$path" - cp "$backup/$path" "$path" - done - git diff --exit-code -- site/preview-v2/index.html site/preview-v2/assets/mixer-control-keys.css site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css - # V27 is a byte-exact historical CSS migration proof; it must run - # against its original qualified GUI, never rebaseline a newer FX/rail. - - name: Mount pinned V27 GUI and CSS owners for immutable parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - baseline=01d84c30c2dd8026b0324045e0f130e84f534f78 - backup="$RUNNER_TEMP/v53-current-sources" - git fetch --no-tags --depth=1 origin "$baseline" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - mkdir -p "$backup/$(dirname "$path")" - cp "$path" "$backup/$path" - git show "$baseline:$path" > "$path" - done - - name: Verify V27 scoped material and 37 owned loser declarations with Chromium parity - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - run: python tests/pages_css_architecture_v27_smoke.py - - name: Restore and verify exact V53 current sources after historical V27 - if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} - shell: bash - run: | - set -euo pipefail - backup="$RUNNER_TEMP/v53-current-sources" - for path in site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css; do - test -s "$backup/$path" - cp "$backup/$path" "$path" - done - git diff --exit-code -- site/preview-v2/index.html site/preview-v2/assets/mixer-chrome-material.css site/preview-v2/assets/mixer-plugin-browser.css site/preview-v2/assets/mixer-pan-controls.css site/preview-v2/assets/mixer-fader-assembly.css site/preview-v2/assets/mixer-meter-display.css site/preview-v2/assets/mixer-utility-controls.css + # Historical V8-V27 migrations are retained in Git history, not mounted + # into the SINGLE current GUI source at runtime. Never overwrite the + # accepted PNG-button source with an earlier rejected skin in CI. + # The current V28 and WIRE/fader/meter/browser checks below are live. - name: Verify V28 exact approved /preview/ source and interactive browser parity if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'css/v28-') || startsWith(github.head_ref, 'integration/product-'))) }} run: python tests/pages_css_architecture_v28_smoke.py @@ -309,7 +152,7 @@ jobs: - name: Verify owned V6 mixer hardware keys and WIRE regression if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} run: python tests/pages_controls_v6_smoke.py - - name: Verify CSS-built MUTE reference face and active/inactive interaction + - name: Verify approved PNG MUTE source and active/inactive material if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} run: python tests/pages_mute_css_reference_smoke.py - name: Reconcile PNG button preview with exact latest WIRE source and geometry @@ -329,7 +172,7 @@ jobs: run: python tests/pages_m3_operator_visual_interaction_smoke.py - name: Run mixer UI smoke tests run: python tests/ui_smoke.py - - name: Verify Preview V2 V7 physical visual geometry and modeless mixer workflow + - name: Verify sole approved /preview/ geometry and modeless mixer workflow if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/product-')) }} run: python tests/preview_v2_v7_visual_smoke.py - name: Verify V40 WIRE proximity, focus release and full-tray channel selection From e2a0871703a2c5967e66a711145322dcf4f4aa43 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:31:20 +0700 Subject: [PATCH 14/19] fix(gui): lock single-source native descriptor and smart current-only CI policy --- tests/ci_workflow_efficiency_test.mjs | 6 +++--- web/approved-native-bridge.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci_workflow_efficiency_test.mjs b/tests/ci_workflow_efficiency_test.mjs index 099dc9069..d13da3f7c 100644 --- a/tests/ci_workflow_efficiency_test.mjs +++ b/tests/ci_workflow_efficiency_test.mjs @@ -111,7 +111,7 @@ test('docs and isolated CI tests do not fan out into unrelated builds', () => { } }); -test('ordinary GUI PR and main use current targeted checks; full history is explicit', () => { +test('ordinary GUI PR and main use current targeted checks; historical skin never mounts', () => { assert.match(ui, /concurrency:\s+group: ui-smoke-/); assert.match(ui, /cancel-in-progress: true/); assert.match(ui, /python tests\/pages_wire_first_canonical_main_smoke.py/); @@ -119,8 +119,8 @@ test('ordinary GUI PR and main use current targeted checks; full history is expl assert.match(ui, /node tests\/wire_main_native_handoff_contract.test.cjs/); assert.match(ui, /python tests\/pages_v51_portrait_led_peak_hold_smoke.py/); const fullOnly = [...ui.matchAll(/^\s{8}if: .*workflow_dispatch.*integration\/product-/gm)].length; - assert.ok(fullOnly >= 35, 'Historical/extended GUI steps must be opt-in, found ' + fullOnly); - assert.match(ui, /python tests\/pages_css_architecture_v27_smoke.py/); + assert.ok(fullOnly >= 15, 'Extended GUI checks must remain opt-in, found ' + fullOnly); + assert.doesNotMatch(ui, /Mount pinned V24 historical|Mount pinned V27 GUI/, 'Do not overwrite sole approved GUI with rejected historical skin'); assert.match(ui, /retention-days: 3/); }); diff --git a/web/approved-native-bridge.js b/web/approved-native-bridge.js index 7bbaa0b64..274ead9d0 100644 --- a/web/approved-native-bridge.js +++ b/web/approved-native-bridge.js @@ -6,7 +6,7 @@ "use strict"; const backend = window.__JUCE__?.backend; const descriptor = Object.freeze({ - source: "site/preview + site/preview-buttons", + source: "site/preview/", pagesRoute: "/preview/", nativeTransport: Boolean(backend?.emitEvent && backend?.addEventListener), acceptedGraphConnected: false, From df6de0baec9320857a43b35fc755ce4e4f169f9b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:32:35 +0700 Subject: [PATCH 15/19] test(wire): resolve canonical graph model from sole site/preview source --- tests/wire_graph_canonical_model.test.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/wire_graph_canonical_model.test.cjs b/tests/wire_graph_canonical_model.test.cjs index a8a5a2aeb..853cfc687 100644 --- a/tests/wire_graph_canonical_model.test.cjs +++ b/tests/wire_graph_canonical_model.test.cjs @@ -1,7 +1,7 @@ #!/usr/bin/env node 'use strict'; const assert=require('node:assert/strict'); -const graph=require('../site/preview-v2/assets/wire-graph-model.js'); +const graph=require('../site/preview/assets/wire-graph-model.js'); const channels=[{id:1,name:'CH1',output:'Master'},{id:2,name:'CH2',output:'Master'}, {id:3,name:'CH3',output:'Master'}]; const base=graph.migrateLegacy(channels,9); From 161a52a075a53dcb0f9154aa8853fd8def6844ce Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:33:07 +0700 Subject: [PATCH 16/19] fix(native): resolve one physical site/preview source in approved Windows GUI manifest --- scripts/build_approved_native_gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_approved_native_gui.py b/scripts/build_approved_native_gui.py index 074ce6330..785cf0bb4 100644 --- a/scripts/build_approved_native_gui.py +++ b/scripts/build_approved_native_gui.py @@ -19,7 +19,7 @@ import tempfile ROOT = Path(__file__).resolve().parents[1] -CANONICAL = ROOT / "site" / "preview-v2" +CANONICAL = ROOT / "site" / "preview" NATIVE_ADAPTER = ROOT / "web" / "approved-native-bridge.js" ADAPTER_MARKER = '' SCHEMA = "arsonmix.approved-native-pages-bundle.v2" From 8a6e7e3a20b63c2f900ef446580b955c12a514d9 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:34:49 +0700 Subject: [PATCH 17/19] test(native): validate canonical Pages builder source, not removed buttons_dest assembler --- tests/reconciled_gui_engine_contract_test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/reconciled_gui_engine_contract_test.mjs b/tests/reconciled_gui_engine_contract_test.mjs index 5fede272e..d9846a65b 100644 --- a/tests/reconciled_gui_engine_contract_test.mjs +++ b/tests/reconciled_gui_engine_contract_test.mjs @@ -62,7 +62,8 @@ test('JUCE native resources use EXACT assembled Pages /preview/, not archived we assert.doesNotMatch(cmake,/^\s+web\/index\.html web\/styles\.css/m); assert.match(generator,/scripts" \/ "build_pages\.py"/); assert.match(pagesBuilder,/APPROVED_SINGLE_GUI/); - assert.match(pagesBuilder,/buttons_dest=dst\/'preview'/); + assert.match(pagesBuilder,/dest = dst \/ "preview"/); + assert.match(pagesBuilder,/SOURCE = ROOT \/ "site" \/ "preview"/); assert.match(generator,/approvedPagesHtmlSha256/); assert.match(generator,/SCAFFOLD_ONLY__NOT_LIVE_PCM/); assert.match(nativeAdapter,/acceptedGraphConnected: false/); From 88bc723e0647136bafac2b1e015693d78aadf68e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:37:49 +0700 Subject: [PATCH 18/19] docs(gui): direct all engineers to single physical approved site/preview source --- README.md | 2 +- docs/ARD_WIRE_FIRST_ZERO_ADDED_LATENCY_20261104.md | 2 +- .../workstreams/HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md | 3 +-- docs/workstreams/START_HERE_WIRE_FIRST_20261104.md | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bacdf9f7d..cd8dd2005 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Choose device once, then directly from the console: One accepted stable-ChannelId graph, one JUCE realtime callback, one native VST3 owner, one request/ACK truth. Continuous controls do not trigger device restart; structural edits prepare safely off callback. Native accepted capability gates UI; **no fake CH11/FX/PCM**. Operator-selected legal I/O only; correct device buffering and plugin latency disclosures, not '0ms' guarantees. ## Browser preview, native builds and QA -**ONLY approved GUI:** https://masarray.github.io/arsonmix/preview/ (visual UI reference, **NO REAL AUDIO**). Old `/preview-v2/`, `/preview-buttons/` and `/preview/mixer.html` redirect to this one approved screen. Source: https://github.com/masarray/arsonmix. Windows x64 native packages: [Windows Actions workflow](https://github.com/masarray/arsonmix/actions/workflows/p1-windows.yml). Download only a successful exact-source-SHA artifact; verify `BUILD_PROVENANCE.json` and EXE SHA-256, install WebView2/real device driver, test at safe headphone volume. +**ONLY approved GUI/source:** `site/preview/index.html` + `site/preview/assets/**` → https://masarray.github.io/arsonmix/preview/ (visual UI reference, **NO REAL AUDIO**). Old `/preview-v2/`, `/preview-buttons/` and `/preview/mixer.html` redirect to this one approved screen. Source: https://github.com/masarray/arsonmix. Windows x64 native packages: [Windows Actions workflow](https://github.com/masarray/arsonmix/actions/workflows/p1-windows.yml). Download only a successful exact-source-SHA artifact; verify `BUILD_PROVENANCE.json` and EXE SHA-256, install WebView2/real device driver, test at safe headphone volume. Use owner CSS `web/styles-src/**` and deterministic `scripts/build_ui_css.py` regeneration; avoid manual generated HTML drift. Read full failing CI logs, run targeted tests, then one Windows/CTest and Chromium gate at meaningful vertical checkpoints. For physical clicks use SIGNAL CHECK → MARK CRACKLE → COPY FULL REPORT. Real-device 0FX and loaded-FX performance must be signed off before release. diff --git a/docs/ARD_WIRE_FIRST_ZERO_ADDED_LATENCY_20261104.md b/docs/ARD_WIRE_FIRST_ZERO_ADDED_LATENCY_20261104.md index 372a1890c..c64141c11 100644 --- a/docs/ARD_WIRE_FIRST_ZERO_ADDED_LATENCY_20261104.md +++ b/docs/ARD_WIRE_FIRST_ZERO_ADDED_LATENCY_20261104.md @@ -6,7 +6,7 @@ ## A. Verified current-state inventory — main 0215986fbbe2c67971680952f75f069950ac653e -- GUI reference site/preview-v2/index.html is simulated. Current JS stores routes in wireEdges, track.output, sendSlots/activeSend and track.input split markers. wireDisplayRoutes excludes default CH->MAIN. wireIsCycle does not traverse all legacy sends. Sends-on-Faders and Copy/Paste/Scene can bypass unified cycle/duplicate validation. A screen that looks linked can differ from the actual intended signal graph. +- GUI reference site/preview/index.html is simulated. Current JS stores routes in wireEdges, track.output, sendSlots/activeSend and track.input split markers. wireDisplayRoutes excludes default CH->MAIN. wireIsCycle does not traverse all legacy sends. Sends-on-Faders and Copy/Paste/Scene can bypass unified cycle/duplicate validation. A screen that looks linked can differ from the actual intended signal graph. - WIRE SVG #wireLayer sits inside #viewport (banks), whereas pinned #master is a sibling. Current geometry cannot represent a true MAIN endpoint; MAIN receiver specifically omits incoming WIRE edge handling in wireTray/pointerdown. requestWireConnection blocks some drops and toggleDirectMain mutates track.output independently. - engine/core/DynamicChannelRoster.h has stable ChannelId and ChannelSendRef(primaryOutput). DynamicConsoleRoutingView.h is an accepted-session *projection*. DynamicPreparedMixerBlock.h is an offline prepared PCM kernel, NOT the installed callback. Current production remains 10 CH + 4 AUX/CH1 special VST path. ENGINE #266 is sole owner of native cutover; native GUI #389, FAT #270 are drafts; #15 physical 0FX crackle OPEN. - contracts/console-puzzle-v8.json schemaVersion 6 already defines native requestId, deviceEpoch, baseGraphRevision, baseRosterRevision, operation, targetChannelId, ACK and accepted graph snapshot. Preserve that envelope. Do not invent a parallel browser-native protocol. diff --git a/docs/workstreams/HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md b/docs/workstreams/HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md index 9b2c775c7..519e729de 100644 --- a/docs/workstreams/HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md +++ b/docs/workstreams/HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md @@ -3,8 +3,7 @@ **Final user decision:** https://masarray.github.io/arsonmix/preview/ is the **one and only** approved GUI/UX and the only publicly displayed preview. The previously referenced /preview-v2/ is rejected as a **separate GUI** and must not be published or used as native design target. The JUCE engine adapts to this finished GUI. This document's filename is historical for old links; its authority is **/preview/**. ## How the approved screen is currently built -- `site/preview/index.html` was a wrapper using iframe `../preview-buttons/index.html`, generated by `scripts/build_pages.py`. -- The **approved rendered visual** is the assembled PNG-button variant: internal `site/preview-v2/index.html` and its CSS/JS/WIRE/fader/meter/FX content combined with **approved** `site/preview-buttons/assets/mixer-control-keys.css`, `mixer-control-keys.js`, and PNG sprite `mute-solo-pfl-56x37.png`. +- The **only checked-in GUI source** is `site/preview/index.html` + `site/preview/assets/**`, including approved PNG MUTE/SOLO/PFL, WIRE, FX, faders and meters. Pages and native JUCE both compile exactly these assets through `scripts/build_pages.py`. Retired `site/preview-v2` and `site/preview-buttons` are removed; legacy URLs redirect only. - These names are **internal build inputs only**, not two product UI variants. Build/publish ONE assembled `/preview/` artifact, and optionally redirect old URLs to /preview/ without serving different GUI. Preserve approved source material until source migration is safe. All future native bundling must consume this assembled output, not the base HTML or the former `/preview-v2/` rendering. ## P0 milestones / real code work diff --git a/docs/workstreams/START_HERE_WIRE_FIRST_20261104.md b/docs/workstreams/START_HERE_WIRE_FIRST_20261104.md index 95dcfc4f7..fd9f138c7 100644 --- a/docs/workstreams/START_HERE_WIRE_FIRST_20261104.md +++ b/docs/workstreams/START_HERE_WIRE_FIRST_20261104.md @@ -2,7 +2,7 @@ **Final owner decision:** https://masarray.github.io/arsonmix/preview/ is the ONLY approved preview and Windows GUI/UX. **/preview-v2/ was explicitly rejected** and may not be shown as another public GUI or native design target. The actual approved /preview/ screen includes **PNG hardware MUTE/SOLO/PFL controls** that are not the bare preview-v2 rendering. -**How to source exactly the approved visual:** `scripts/build_pages.py` assembles ONE `/preview/` HTML+assets from internal `site/preview-v2/index.html` and shared FX/WIRE/fader/meter assets but overlays `site/preview-buttons/assets/mixer-control-keys.css`, `mixer-control-keys.js`, `mute-solo-pfl-56x37.png`. Internal source names are **not separate product GUIs**. The published /preview/ assembly, not /preview-v2/ alone, must be deterministically embedded in JUCE WebView2. Old public preview URLs are redirect-only. See [canonical handoff](HANDOFF_APPROVED_PREVIEW_V2_NATIVE_20261104.md) (filename historic), root AGENTS.md, PRD, ARD and P0 #389. +**How to source the approved visual:** the ONE checked-in source is `site/preview/index.html` with `site/preview/assets/**` (approved PNG keys included). `scripts/build_pages.py` publishes it; `scripts/build_approved_native_gui.py` consumes the same Pages output for JUCE. Do not resurrect retired preview-v2/buttons sources. ## Four meaningful milestones (do not re-plan) 1. **One public preview:** `python scripts/build_pages.py` generates /preview/index.html directly. `python tests/single_preview_publication_contract_test.py dist-pages` must verify PNG buttons, WIRE and all legacy redirects. Never serve a separate /preview-v2/ mixer. From 979ccba1ac0695a1a66f7dfd6907f557767fc728 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Wed, 4 Nov 2026 19:38:54 +0700 Subject: [PATCH 19/19] test(gui): fail CI when obsolete preview-v2/buttons/V33/V34 source directories reappear --- tests/single_preview_publication_contract_test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/single_preview_publication_contract_test.py b/tests/single_preview_publication_contract_test.py index 088c7b488..712e25e45 100644 --- a/tests/single_preview_publication_contract_test.py +++ b/tests/single_preview_publication_contract_test.py @@ -4,6 +4,10 @@ ROOT=Path(__file__).resolve().parents[1] DST=Path(sys.argv[1]).resolve() if len(sys.argv)>1 else ROOT/'dist-pages' gui=DST/'preview' +# There is exactly one checked-in renderer and one hardware-button asset owner. +for retired in ("preview-v2","preview-buttons","preview-v33","preview-v34"): + if (ROOT/"site"/retired).exists(): + raise AssertionError("REJECTED alternate source still checked in: site/"+retired) def require(ok,why): if not ok: raise AssertionError('SINGLE APPROVED PREVIEW FAILED: '+why) html=(gui/'index.html').read_text(encoding='utf-8')