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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
python tests/native_harmony_assembly_test.py
node --check site/preview-v2/assets/mixer-native-vocal-throw.js
python tests/native_peq_assembly_test.py
python tests/native_v60_fader_assembly_contract.py
python tests/approved_operator_ux_smoke.py
python scripts/build_ui_css.py --check
python tests/gui_baseline_lock_test.py
Expand Down
20 changes: 11 additions & 9 deletions scripts/build_approved_native_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ def accepted_pages_html() -> str:
"}\n"),
("scaleTopPct(v,-60,gainMax)",
"(100.0-faderPercent(v,isSend))"),
(" const gain=Math.round((max-(max-min)*frac)*10)/10;\n",
" const gain=Math.round(faderDbFromTravelPercent(100*(1-frac),max===6)*10)/10;\n"),
(" let gain=Math.round((max-(max-min)*frac)*10)/10;\n",
" let gain=Math.round(faderDbFromTravelPercent(100*(1-frac),max===6)*10)/10;\n"),
# The native fader has a calibrated logarithmic travel (unity is 77%),
# while the public reference uses a linear dB scale. The detent MUST
# snap at the visual/PCM unity position of the native tapered curve.
(" const unityY=travel.top+travel.height*(max/(max-min));\n",
" const unityY=travel.top+travel.height*(1-faderPercent(0,max===6)/100);\n"),
# Only the compiled Windows WebView gets verified native driver inputs.
# Public /preview/ continues to show its labeled simulated reference.
("const channelOptions=(t,type)=>{\n",
Expand Down Expand Up @@ -158,13 +163,10 @@ def accepted_pages_html() -> str:
("function fxNativeTransactionRequired(){\n",
"function fxNativeTransactionRequired(){\n"
" if(window.__JUCE__?.backend)return true;\n"),
# Source's pointerup clears faderGesture BEFORE the later deferred bridge
# listener runs. Dispatch exactly once at the actual gesture commit point.
(" const g=faderGesture;faderGesture=null;\n"
" g.box.releasePointerCapture?.(ev.pointerId);\n",
" const g=faderGesture;faderGesture=null;\n"
" g.box.releasePointerCapture?.(ev.pointerId);\n"
" if(window.__ARMIX_NATIVE_M2__?.consumeField?.({target:g.input,type:'change'}))return;\n"),
# V60 source sends the final change through handleField() exactly once
# on pointer release. The existing native-only handleField interception
# below/above takes that committed target to the ACK/readback dispatcher.
# Do NOT install a second synthetic pointerup native event.
# Stage B: retain the approved exact V51 portrait meter gradient/peak hold
# and dBFS calibration. Only elide redundant WebView2 style mutations:
# these are authoritative native telemetry writes, NOT simulated signal.
Expand Down
7 changes: 6 additions & 1 deletion tests/approved_native_gui_bundle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ def test_native_is_exact_assembled_public_pages_plus_nonvisual_native_seam(self)
self.assertIn("make,render,findTrack,displayMeterDbfs", native)
self.assertIn("installGraph(channels,main,edges)", native)
self.assertIn("if(window.__JUCE__?.backend)return true;", native)
self.assertIn("consumeField?.({target:g.input,type:'change'})", native)
# V60 public pointerup emits exactly one final change. The
# native-only handleField seam owns that event/ACK; a second
# synthetic callback here would duplicate the release.
self.assertEqual(native.count("handleField({target:g.input,type:'change',altKey:!!ev.altKey});"),1)
self.assertIn("window.__ARMIX_NATIVE_M2__?.consumeField?.(event);return;", native)
self.assertNotIn("consumeField?.({target:g.input,type:'change'})", native)
self.assertEqual(manifest["approvedPagesHtmlSha256"], bundle.sha256((source / "index.html").read_bytes()))
self.assertNotEqual(native, (ROOT / "web/index.html").read_text("utf-8"))
self.assertIn("approved-native-bridge.js", native)
Expand Down
12 changes: 9 additions & 3 deletions tests/approved_native_m2_contract.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1562,11 +1562,17 @@ test("P0 native hardware IN remains selectable after ChannelId ownership, failed
assert.equal(sourceCommands()[1].payload.graphRevision,base.graph.revision);
assert.notEqual(sourceCommands()[1].payload.requestId,id);
});
test("M3 Windows bundle owns pointerup fader gesture and fences native FX keyboard reorder",()=>{
test("M3/V60 Windows bundle dispatches exactly one fader release through native ACK and fences FX reorder",()=>{
const builder=read("scripts/build_approved_native_gui.py");
const preview=read("site/preview-v2/index.html");
const bridge=read("web/approved-native-bridge.js");
assert.ok(builder.includes("const g=faderGesture;faderGesture=null;"));
assert.ok(builder.includes("consumeField?.({target:g.input,type:'change'})"));
assert.ok(preview.includes("const g=faderGesture;faderGesture=null;"));
assert.equal(preview.split("handleField({target:g.input,type:'change',altKey:!!ev.altKey});").length-1,1);
assert.ok(builder.includes("window.__ARMIX_NATIVE_M2__?.consumeField?.(event);return;"));
assert.ok(!builder.includes("consumeField?.({target:g.input,type:'change'})"),
"V60 source already emits the final change; native must not double-publish");
assert.ok(builder.includes("faderDbFromTravelPercent(100*(1-frac),max===6)"));
assert.ok(builder.includes("faderPercent(0,max===6)/100"));
assert.ok(builder.includes("function fxNativeTransactionRequired"));
assert.ok(builder.includes("__ARMIX_NATIVE_SCOPE__"));
assert.ok(bridge.includes("scope.installGraph(nextTracks,nextMaster,edges)"));
Expand Down
33 changes: 33 additions & 0 deletions tests/native_v60_fader_assembly_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""V60 native WebView2 fader contract: reversible exact Pages source and one ACK.

No audio hardware is claimed. This cheap assembly gate prevents pointer-source
changes from silently breaking JUCE HTML or moving the native unity detent.
"""
import importlib.util
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
spec = importlib.util.spec_from_file_location(
"arsonmix_native_v60_bundle", ROOT / "scripts/build_approved_native_gui.py")
bundle = importlib.util.module_from_spec(spec)
spec.loader.exec_module(bundle)


def run():
public = bundle.accepted_pages_html()
native = bundle.native_html(public)
assert bundle.public_from_native(native) == public, "Native Pages not reversible"
assert " let gain=Math.round((max-(max-min)*frac)*10)/10;" in public
assert " let gain=Math.round(faderDbFromTravelPercent(100*(1-frac),max===6)*10)/10;" in native
assert " const unityY=travel.top+travel.height*(max/(max-min));" in public
assert " const unityY=travel.top+travel.height*(1-faderPercent(0,max===6)/100);" in native
assert "FADER_TAPER=Object.freeze" in native
assert native.count("handleField({target:g.input,type:'change',altKey:!!ev.altKey});")==1
assert native.count("if(window.__JUCE__?.backend){window.__ARMIX_NATIVE_M2__?.consumeField?.(event);return;}")==1
assert "consumeField?.({target:g.input,type:'change'})" not in native
assert native.count("FADER_UNITY_CAPTURE_PX=7,FADER_UNITY_RELEASE_PX=12")==1
print("PASS V60 native fader taper/zero detent/final native ACK and reversible Pages")


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