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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ jobs:
device-green-on-palette-review.png
mixer-design-review.png
mixer-design-review-1440.png
native-input-patch-review-1680.png
native-input-patch-review-1440.png
mixer-master-clip-review.png
mixer-pro-view-review.png
mixer-master-dual-metric-left-rail.png
Expand Down
17 changes: 17 additions & 0 deletions docs/R1_NATIVE_INPUT_PATCH_MATRIX_20261029.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# R1 — Production-style native input patchbay (2026-10-29)

**Reconciled base:** `main@369c2a9c1fbf827815afb3f4866672ee47f554bf`, including approved GPU hover-inert optimization; merged R0A #144. **R0B dual-mode engine lifecycle is not complete.**

## Implemented

- Native ROUTING opens from toolbar **in one click** (existing SIGNAL FLOW action); no extra diagram or operator-facing START LAB. Original ArSonMix metallic charcoal / aquatic green UI, 1100px bounded panel, horizontal paging of eight fixed-size matrix columns per page (unused hardware input slots are disabled, never stretched into oversized tiles), 10 fixed CH rows.
- Matrix gets real physical source list from `dryRoutingLab.ports` on the active JUCE DIRECT device, not static assumptions or browser localStorage. Escaped device names; malformed, duplicate or invalid physical port descriptors ignored.
- MONO: click a physical input to patch; click again to clear; new choice replaces old. STEREO: independent visible L/R selectors; incomplete, duplicate-side or stale hardware port rejects before native call. NONE and BUS remain explicit. Physical fan-out to several channels is allowed by existing native routing plan.
- User edits are DRAFT only (amber). LIVE/green only if the device-epoch-matched acknowledged `acceptedRoute` reports that exact physical assignment. A removed cell displays old-live-until-APPLY status. REVERT reinstates native ACK, not a browser snapshot. Native `routingDryApply` and exact `arMixRoutingLabAck` are reused; no backend duplication. No automatic unmute; output must be MUTED.
- Input matrix redraw only on edit/tab/page, native ACK, device epoch/hotplug, and open. Delegated click/change and hover handlers, no per-cell listeners, no blur, no filter, no animation or audio-thread changes. Hardware status/peaks continue from existing 12Hz telemetry without full-grid repaint.
- INTERNAL/SENDS tab preserves existing CH/AUX/VST3 PRE/POST editor for R2 full internal matrix; OUTPUT tab exposes actual MAIN L/R device output mapping as read-only and accurately describes R3 as incomplete. No invented group/DCA/multi-output feature.
- Existing backend `dryRoutingLab`, `routingDryApply` and old JS alias remain for compatibility while R0B migrates CH1 FX ADD/REMOVE/MOVE/Orbit to the one default live native topology. UI no longer presents LAB as a product feature; **does not mean R0B is done**.

## Verification and limits

Native-mock Playwright exercises ASIO sparse port 2/5, escaped label, direct top nav, status DRAFT/LIVE/REVERT, stereo L/R duplicate prevention, exact epoch/revision APPLY, pending ACK, output read-only, device epoch 77→78 invalidation. Previous native/JS smoke tests preserved. Windows MSVC/CTest and native physical hardware FAT are separate; P0 #15 no-FX crackle remains open.
19 changes: 18 additions & 1 deletion tests/live_routing_ui_contract_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test("P1E is opt-in; all native VST3/clock/diagnostic paths protected",()=>{
assert.match(lab,/std::array<const float\*,armix::device::LiveInputPortRegistry::limit>/);
});
test("GUI exposes only truthful dry device routes and acknowledged commit",()=>{
assert.match(ui,/ROUTING LAB · 10 CH/);
assert.match(ui,/ROUTING · 10 CH/);
assert.match(ui,/routingDryApply/);
assert.match(ui,/routingDryStop/);
assert.match(ui,/arMixRoutingLabAck/);
Expand Down Expand Up @@ -175,3 +175,20 @@ test("P1K truly keeps ten physical INPUT strips and adds four independent native
assert.match(cmake,/P1KTenIndependentInputsAndFourDedicatedAuxReturns/);
assert.match(workflow,/ARMixDedicatedAuxBusTests/);
});


test("R1 matrix edits only device-bound draft and honors native revision ACK",()=>{
assert.match(ui,/data-patch-tab="input"/);
assert.match(ui,/patchPageSize=8/);
assert.match(ui,/patchPorts\(\)/);
assert.match(ui,/Number\.isInteger\(n\)/);
assert.match(ui,/data-patch-state/);
assert.match(ui,/patchPreflight\(\)/);
assert.match(ui,/patchPending=true/);
assert.match(ui,/hydrateAcceptedRoute/);
assert.match(ui,/arMixRoutingLabAck/);
assert.match(ui,/selectPatchTab\("input"\)/);
assert.match(ui,/window\.__arMixOpenRouting=openRoutingLab/);
assert.doesNotMatch(ui,/filter\s*:\s*blur\(/);
assert.match(ui,/document\.addEventListener\("click",event=>/);
});
101 changes: 101 additions & 0 deletions tests/ui_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,107 @@ async def image_for(selector):
return Number.parseFloat(l.style.getPropertyValue('--led-lit'))>7 &&
Number.parseFloat(r.style.getPropertyValue('--led-lit'))>7;
}""",timeout=3000)

# R1: native-backed Waves-style INPUT PATCH, not an image or browser
# mock-routing claim. Test real panel interaction against native ACKs.
await native.evaluate("""()=>{
window.__arMixSent=[];
window.__JUCE__.backend.emitEvent=(name,payload)=>
window.__arMixSent.push({name,payload});
}""")
await native.add_script_tag(path=str(project/"web/monitor.js"))
await native.evaluate("""()=>{
window.__arPatchRows=Array.from({length:10},()=>({
mode:"NONE",left:-1,right:-1,gain:.25,pan:0,main:true,
mute:false,solo:false,fxId:""
}));
window.__arPatchStatus={
connected:true,driver:"ASIO",rate:48000,buffer:128,monitor:false,
masterMute:false,channelMute:false,diagnosticRoute:"NORMAL",chainCount:0,
dryRoutingLab:{active:false,ready:false,epoch:77,revision:0,
ports:[{port:2,callback:0,label:"Input <Mic> & One"},
{port:5,callback:1,label:"USB Input Six"}],
outputPorts:[0,1],channelControls:[],fxCount:0}
};
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
}""")
await native.locator('[data-view="SIGNAL FLOW"]').click()
assert await native.locator("#arRoutingLabOverlay").evaluate(
"(e)=>e.classList.contains('open')")
assert await native.locator("#arPatchGrid [data-patch-row][data-patch-port]").count()==20
assert await native.locator("#arPatchGrid .arPatchCell").count()==80
patch_visual=await native.evaluate("""()=>{
const grid=document.querySelector('#arPatchGrid').getBoundingClientRect();
const cols=[...document.querySelectorAll('#arPatchGrid .arPatchPort')]
.map(x=>x.getBoundingClientRect().width);
const panel=document.querySelector('#arRoutingLabPanel').getBoundingClientRect();
return {grid:Math.round(grid.width),panel:Math.round(panel.width),
cols:cols.map(Math.round),rowCount:
document.querySelectorAll('#arPatchGrid .arPatchChan').length};
}""")
assert patch_visual['rowCount']==10 and len(patch_visual['cols'])==8,patch_visual
assert max(patch_visual['cols'])-min(patch_visual['cols'])<=1,patch_visual
assert all(58<=w<=140 for w in patch_visual['cols']),patch_visual
await native.screenshot(path=str(project/"native-input-patch-review-1680.png"))
await native.set_viewport_size({"width":1440,"height":820})
await native.screenshot(path=str(project/"native-input-patch-review-1440.png"))
await native.set_viewport_size({"width":1680,"height":920})
assert await native.locator("#arPatchGrid .arPatchRow").first.evaluate(
"(e)=>getComputedStyle(e).display")=="contents"
assert await native.locator(".arPatchPort").first.get_attribute("title")=="Input <Mic> & One"
cell=native.locator('[data-patch-row="0"][data-patch-port="2"].arPatchCell')
assert await cell.get_attribute("data-patch-state")=="off"
await cell.click()
assert await cell.get_attribute("data-patch-state")=="draft"
assert await cell.inner_text()=="M"
assert await native.evaluate(
"()=>window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply').length")==0
await native.locator('[data-patch-mode="1"]').select_option("STEREO")
await native.locator('[data-patch-row="1"][data-patch-port="2"].arPatchCell').click()
await native.locator('[data-patch-row="1"][data-patch-side="right"]').click()
await native.locator('[data-patch-row="1"][data-patch-port="2"].arPatchCell').click()
assert "cannot use the same" in await native.locator("#arRouteFeedback").inner_text()
await native.locator('[data-patch-row="1"][data-patch-port="5"].arPatchCell').click()
assert await native.locator('[data-patch-row="1"][data-patch-port="5"].arPatchCell').inner_text()=="R"
await native.locator("#arRouteApply").click()
action=await native.evaluate("""()=>{
const actions=window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply');
return actions.at(-1)?.payload?.value;
}""")
assert action["deviceEpoch"]==77 and action["revision"]==0,action
assert action["channels"][0]["left"]==2 and action["channels"][0]["mode"]=="MONO",action
assert action["channels"][1]["left"]==2 and action["channels"][1]["right"]==5,action
assert await native.locator("#arRouteApply").is_disabled()
await native.evaluate("""()=>{
const d=window.__arPatchStatus.dryRoutingLab;
d.active=true;d.ready=true;d.revision=1;
d.acceptedRoute={deviceEpoch:77,revision:0,
channels:window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply').at(-1).payload.value.channels,
auxes:[],sends:[]};
window.__arMixMockEvents.arMixRoutingLabAck({ok:true,state:d});
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
}""")
assert await cell.get_attribute("data-patch-state")=="live"
assert await native.locator("#arRouteApply").is_enabled()
await native.locator('[data-patch-row="0"][data-patch-port="5"].arPatchCell').click()
assert await native.locator('[data-patch-row="0"][data-patch-port="5"].arPatchCell').get_attribute("data-patch-state")=="draft"
await native.locator("#arPatchRevert").click()
assert await cell.get_attribute("data-patch-state")=="live"
await native.locator('[data-patch-tab="output"]').click()
assert "READ-ONLY" in await native.locator("#arPatchOutputPanel").inner_text()
assert await native.locator(".arPatchOutput").count()==2
await native.locator('[data-patch-tab="input"]').click()
await native.evaluate("""()=>{
const d=window.__arPatchStatus.dryRoutingLab;
d.epoch=78;d.revision=1;d.ready=false;d.active=false;
d.ports=[{port:9,callback:0,label:"Other interface"}];
d.acceptedRoute=null;
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
}""")
assert await native.locator('[data-patch-row][data-patch-port]').count()==10
assert await native.locator('[data-patch-row="0"][data-patch-port="9"]').get_attribute("data-patch-state")=="off"
assert "DEVICE CHANGED" in await native.locator("#arRouteFeedback").inner_text()

assert not native_errors,native_errors
await native.close()
await browser.close()
Expand Down
Loading
Loading