Skip to content

Commit 3ab35d3

Browse files
authored
R1: real native INPUT PATCH matrix, low-cost hover and acknowledged device routing
* R1: add polished native input patchbay surface and routing workspaces * R1: delegate physical input patch grid to ACK/epoch SSOT with mono-stereo preflight and rollback * R1: correct grid subrow layout and open patchbay from ROUTING toolbar * R1: test native patch click/draft/ACK/stereo/hotplug and document backend boundaries * R1: preserve standalone app byte-parity; handle one-click ROUTING in native monitor adapter * R1: guard optional status badge across native WebView shells during ACK refresh * R1 polish: stable eight-column native patch grid with responsive screenshot/geometry QA
1 parent 369c2a9 commit 3ab35d3

5 files changed

Lines changed: 401 additions & 14 deletions

File tree

‎.github/workflows/ui-smoke.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ jobs:
9595
device-green-on-palette-review.png
9696
mixer-design-review.png
9797
mixer-design-review-1440.png
98+
native-input-patch-review-1680.png
99+
native-input-patch-review-1440.png
98100
mixer-master-clip-review.png
99101
mixer-pro-view-review.png
100102
mixer-master-dual-metric-left-rail.png
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# R1 — Production-style native input patchbay (2026-10-29)
2+
3+
**Reconciled base:** `main@369c2a9c1fbf827815afb3f4866672ee47f554bf`, including approved GPU hover-inert optimization; merged R0A #144. **R0B dual-mode engine lifecycle is not complete.**
4+
5+
## Implemented
6+
7+
- 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.
8+
- 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.
9+
- 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.
10+
- 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.
11+
- 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.
12+
- 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.
13+
- 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**.
14+
15+
## Verification and limits
16+
17+
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.

‎tests/live_routing_ui_contract_test.mjs‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test("P1E is opt-in; all native VST3/clock/diagnostic paths protected",()=>{
2828
assert.match(lab,/std::array<const float\*,armix::device::LiveInputPortRegistry::limit>/);
2929
});
3030
test("GUI exposes only truthful dry device routes and acknowledged commit",()=>{
31-
assert.match(ui,/ROUTING LAB · 10 CH/);
31+
assert.match(ui,/ROUTING · 10 CH/);
3232
assert.match(ui,/routingDryApply/);
3333
assert.match(ui,/routingDryStop/);
3434
assert.match(ui,/arMixRoutingLabAck/);
@@ -175,3 +175,20 @@ test("P1K truly keeps ten physical INPUT strips and adds four independent native
175175
assert.match(cmake,/P1KTenIndependentInputsAndFourDedicatedAuxReturns/);
176176
assert.match(workflow,/ARMixDedicatedAuxBusTests/);
177177
});
178+
179+
180+
test("R1 matrix edits only device-bound draft and honors native revision ACK",()=>{
181+
assert.match(ui,/data-patch-tab="input"/);
182+
assert.match(ui,/patchPageSize=8/);
183+
assert.match(ui,/patchPorts\(\)/);
184+
assert.match(ui,/Number\.isInteger\(n\)/);
185+
assert.match(ui,/data-patch-state/);
186+
assert.match(ui,/patchPreflight\(\)/);
187+
assert.match(ui,/patchPending=true/);
188+
assert.match(ui,/hydrateAcceptedRoute/);
189+
assert.match(ui,/arMixRoutingLabAck/);
190+
assert.match(ui,/selectPatchTab\("input"\)/);
191+
assert.match(ui,/window\.__arMixOpenRouting=openRoutingLab/);
192+
assert.doesNotMatch(ui,/filter\s*:\s*blur\(/);
193+
assert.match(ui,/document\.addEventListener\("click",event=>/);
194+
});

‎tests/ui_smoke.py‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,107 @@ async def image_for(selector):
12211221
return Number.parseFloat(l.style.getPropertyValue('--led-lit'))>7 &&
12221222
Number.parseFloat(r.style.getPropertyValue('--led-lit'))>7;
12231223
}""",timeout=3000)
1224+
1225+
# R1: native-backed Waves-style INPUT PATCH, not an image or browser
1226+
# mock-routing claim. Test real panel interaction against native ACKs.
1227+
await native.evaluate("""()=>{
1228+
window.__arMixSent=[];
1229+
window.__JUCE__.backend.emitEvent=(name,payload)=>
1230+
window.__arMixSent.push({name,payload});
1231+
}""")
1232+
await native.add_script_tag(path=str(project/"web/monitor.js"))
1233+
await native.evaluate("""()=>{
1234+
window.__arPatchRows=Array.from({length:10},()=>({
1235+
mode:"NONE",left:-1,right:-1,gain:.25,pan:0,main:true,
1236+
mute:false,solo:false,fxId:""
1237+
}));
1238+
window.__arPatchStatus={
1239+
connected:true,driver:"ASIO",rate:48000,buffer:128,monitor:false,
1240+
masterMute:false,channelMute:false,diagnosticRoute:"NORMAL",chainCount:0,
1241+
dryRoutingLab:{active:false,ready:false,epoch:77,revision:0,
1242+
ports:[{port:2,callback:0,label:"Input <Mic> & One"},
1243+
{port:5,callback:1,label:"USB Input Six"}],
1244+
outputPorts:[0,1],channelControls:[],fxCount:0}
1245+
};
1246+
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
1247+
}""")
1248+
await native.locator('[data-view="SIGNAL FLOW"]').click()
1249+
assert await native.locator("#arRoutingLabOverlay").evaluate(
1250+
"(e)=>e.classList.contains('open')")
1251+
assert await native.locator("#arPatchGrid [data-patch-row][data-patch-port]").count()==20
1252+
assert await native.locator("#arPatchGrid .arPatchCell").count()==80
1253+
patch_visual=await native.evaluate("""()=>{
1254+
const grid=document.querySelector('#arPatchGrid').getBoundingClientRect();
1255+
const cols=[...document.querySelectorAll('#arPatchGrid .arPatchPort')]
1256+
.map(x=>x.getBoundingClientRect().width);
1257+
const panel=document.querySelector('#arRoutingLabPanel').getBoundingClientRect();
1258+
return {grid:Math.round(grid.width),panel:Math.round(panel.width),
1259+
cols:cols.map(Math.round),rowCount:
1260+
document.querySelectorAll('#arPatchGrid .arPatchChan').length};
1261+
}""")
1262+
assert patch_visual['rowCount']==10 and len(patch_visual['cols'])==8,patch_visual
1263+
assert max(patch_visual['cols'])-min(patch_visual['cols'])<=1,patch_visual
1264+
assert all(58<=w<=140 for w in patch_visual['cols']),patch_visual
1265+
await native.screenshot(path=str(project/"native-input-patch-review-1680.png"))
1266+
await native.set_viewport_size({"width":1440,"height":820})
1267+
await native.screenshot(path=str(project/"native-input-patch-review-1440.png"))
1268+
await native.set_viewport_size({"width":1680,"height":920})
1269+
assert await native.locator("#arPatchGrid .arPatchRow").first.evaluate(
1270+
"(e)=>getComputedStyle(e).display")=="contents"
1271+
assert await native.locator(".arPatchPort").first.get_attribute("title")=="Input <Mic> & One"
1272+
cell=native.locator('[data-patch-row="0"][data-patch-port="2"].arPatchCell')
1273+
assert await cell.get_attribute("data-patch-state")=="off"
1274+
await cell.click()
1275+
assert await cell.get_attribute("data-patch-state")=="draft"
1276+
assert await cell.inner_text()=="M"
1277+
assert await native.evaluate(
1278+
"()=>window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply').length")==0
1279+
await native.locator('[data-patch-mode="1"]').select_option("STEREO")
1280+
await native.locator('[data-patch-row="1"][data-patch-port="2"].arPatchCell').click()
1281+
await native.locator('[data-patch-row="1"][data-patch-side="right"]').click()
1282+
await native.locator('[data-patch-row="1"][data-patch-port="2"].arPatchCell').click()
1283+
assert "cannot use the same" in await native.locator("#arRouteFeedback").inner_text()
1284+
await native.locator('[data-patch-row="1"][data-patch-port="5"].arPatchCell').click()
1285+
assert await native.locator('[data-patch-row="1"][data-patch-port="5"].arPatchCell').inner_text()=="R"
1286+
await native.locator("#arRouteApply").click()
1287+
action=await native.evaluate("""()=>{
1288+
const actions=window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply');
1289+
return actions.at(-1)?.payload?.value;
1290+
}""")
1291+
assert action["deviceEpoch"]==77 and action["revision"]==0,action
1292+
assert action["channels"][0]["left"]==2 and action["channels"][0]["mode"]=="MONO",action
1293+
assert action["channels"][1]["left"]==2 and action["channels"][1]["right"]==5,action
1294+
assert await native.locator("#arRouteApply").is_disabled()
1295+
await native.evaluate("""()=>{
1296+
const d=window.__arPatchStatus.dryRoutingLab;
1297+
d.active=true;d.ready=true;d.revision=1;
1298+
d.acceptedRoute={deviceEpoch:77,revision:0,
1299+
channels:window.__arMixSent.filter(x=>x.payload?.action==='routingDryApply').at(-1).payload.value.channels,
1300+
auxes:[],sends:[]};
1301+
window.__arMixMockEvents.arMixRoutingLabAck({ok:true,state:d});
1302+
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
1303+
}""")
1304+
assert await cell.get_attribute("data-patch-state")=="live"
1305+
assert await native.locator("#arRouteApply").is_enabled()
1306+
await native.locator('[data-patch-row="0"][data-patch-port="5"].arPatchCell').click()
1307+
assert await native.locator('[data-patch-row="0"][data-patch-port="5"].arPatchCell').get_attribute("data-patch-state")=="draft"
1308+
await native.locator("#arPatchRevert").click()
1309+
assert await cell.get_attribute("data-patch-state")=="live"
1310+
await native.locator('[data-patch-tab="output"]').click()
1311+
assert "READ-ONLY" in await native.locator("#arPatchOutputPanel").inner_text()
1312+
assert await native.locator(".arPatchOutput").count()==2
1313+
await native.locator('[data-patch-tab="input"]').click()
1314+
await native.evaluate("""()=>{
1315+
const d=window.__arPatchStatus.dryRoutingLab;
1316+
d.epoch=78;d.revision=1;d.ready=false;d.active=false;
1317+
d.ports=[{port:9,callback:0,label:"Other interface"}];
1318+
d.acceptedRoute=null;
1319+
window.__arMixMockEvents.arMixStatus(window.__arPatchStatus);
1320+
}""")
1321+
assert await native.locator('[data-patch-row][data-patch-port]').count()==10
1322+
assert await native.locator('[data-patch-row="0"][data-patch-port="9"]').get_attribute("data-patch-state")=="off"
1323+
assert "DEVICE CHANGED" in await native.locator("#arRouteFeedback").inner_text()
1324+
12241325
assert not native_errors,native_errors
12251326
await native.close()
12261327
await browser.close()

0 commit comments

Comments
 (0)