From d3fdb5f94768d47ef9d88e6d7948017ff6c7b44f Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Fri, 13 Nov 2026 13:21:38 +0700 Subject: [PATCH 1/3] fix(gui): V66 brisk 330ms reel, amplified full-span OUT whip and freely swinging plug dot --- site/preview-v2/index.html | 64 +++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/site/preview-v2/index.html b/site/preview-v2/index.html index ec7f2b30f..74c5a5168 100644 --- a/site/preview-v2/index.html +++ b/site/preview-v2/index.html @@ -996,7 +996,11 @@ Single visual-only transient, no synthetic route or native DSP mutation. The travelling wave spans the shrinking jacket and the detached plug is a FREE end: it moves with the final wave rather than being pinned. */ -const WIRE_RETRACT_MS=520; +/* V66 fast, lively elastic recoil: OUT stays fixed while a travelling + whip reaches the entire shrinking cable. The disconnected dot is free: + a damped tip response makes it wobble rather than ride a rigid chord. + Visual-only; graph REMOVE always commits before this animation exists. */ +const WIRE_RETRACT_MS=330; let wireRetractToken=0,wireRetractOverlay=null; function stopWireRetraction(){ ++wireRetractToken; @@ -1004,46 +1008,56 @@ } function wireRetractPose(x0,y0,rx,ry,elapsedMs){ const p=Math.max(0,Math.min(1,elapsedMs/WIRE_RETRACT_MS)); - // 42% shorter than V64, brisk at the beginning and softly decelerating. - const remaining=Math.pow(1-p,2.25); + // Fast pull from the first frame, no preceding fall/hang/idle phase. + const remaining=Math.pow(1-p,2.65); const x=x0+(rx-x0)*remaining,y=y0+(ry-y0)*remaining; const chord=Math.hypot(rx-x0,ry-y0); - const length01=Math.max(0,Math.min(1,(chord-85)/270)); + const length01=Math.max(0,Math.min(1,(chord-90)/270)); const longMix=length01*length01*(3-2*length01); - // The pulse traverses the *whole* cable before reel-in is over. - // OUT -> FREE end, then leaves a short damped trailing tail. - const front=1.5*(1-Math.pow(1-Math.min(1,p/.55),1.35)); - const width=.62-.25*longMix; // fewer smoother lobes on short cables - const sag=Math.min(46,Math.max(9,Math.sqrt(chord)*2.1))* - Math.pow(remaining,.72); - const amplitude=Math.min(19,Math.max(7,Math.sqrt(chord)*.95))* - (.42+.58*longMix)*Math.pow(remaining,.47)*Math.min(1,p/.095); - return {x,y,remaining,sag,front,width,amplitude,phase:'reel'}; + // Front originates at OUT and reaches the loose tip early enough that + // the tip can swing repeatedly BEFORE the wire disappears. + const front=1.42*(1-Math.pow(1-Math.min(1,p/.40),1.35)); + const catchUp=Math.max(0,Math.min(1,(front-.78)/.30)); + const width=.59-.24*longMix; + const sag=Math.min(44,Math.max(10,Math.sqrt(chord)*2.1))* + Math.pow(remaining,.78); + const amplitude=Math.min(32,Math.max(14,Math.sqrt(chord)*1.5))* + (.46+.54*longMix)*Math.pow(remaining,.29)* + Math.min(1,p/.07)*Math.min(1,chord*remaining/55); + const recoil=amplitude*.13*catchUp* + Math.sin(2*Math.PI*Math.max(0,p-.19)/.26); + return {p,x,y,remaining,sag,front,catchUp,width,amplitude,recoil,phase:'reel'}; } function wireRetractWave(pose,t){ - const passed=pose.front-t; // first near OUT, then all along the cable - if(passed<=0)return 0; - const sourceAnchor=Math.min(1,t/.035); - // Unlike the connected socket, the unplugged end is not tethered: - // the sine displaces the plug itself, so it never looks rigid. - return -pose.amplitude*Math.sin(2*Math.PI*passed/pose.width)* - Math.exp(-1.05*passed-.32*t)*sourceAnchor; + const passed=pose.front-t; + const travelling=passed>0? + -Math.sin(2*Math.PI*passed/pose.width)* + Math.exp(-.77*passed-.35*t):0; + // The travelling pulse excites an inertial after-swing at the FREE tip. + // Its influence smoothly increases toward that end, without moving OUT. + const lag=Math.max(0,pose.p-.19); + const tipSwing=1.15*pose.catchUp*Math.sin(2*Math.PI*lag/.26)* + Math.exp(-1.25*lag)*Math.pow(t,1.65); + return pose.amplitude*Math.min(1,t/.04)*(travelling+tipSwing); } function wireRetractPathData(x0,y0,rx,ry,elapsedMs){ const pose=wireRetractPose(x0,y0,rx,ry,elapsedMs); const dx=pose.x-x0,dy=pose.y-y0; const norm=Math.max(1,Math.hypot(dx,dy)); - const nx=-dy/norm,ny=dx/norm; + const nx=-dy/norm,ny=dx/norm,tx=dx/norm,ty=dy/norm; let d='M '+x0.toFixed(1)+' '+y0.toFixed(1); for(let i=1;i<=64;i++){ const t=i/64; const wave=wireRetractWave(pose,t); - const x=x0+dx*t+nx*wave; - const y=y0+dy*t+pose.sag*Math.sin(Math.PI*t)+ny*wave; + const surge=pose.recoil*t*t; + const x=x0+dx*t+nx*wave+tx*surge; + const y=y0+dy*t+pose.sag*Math.sin(Math.PI*t)+ny*wave+ty*surge; d+=' L '+x.toFixed(1)+' '+y.toFixed(1); } const endWave=wireRetractWave(pose,1); - return {d,pose:{...pose,tipX:pose.x+nx*endWave,tipY:pose.y+ny*endWave}}; + return {d,pose:{...pose, + tipX:pose.x+nx*endWave+tx*pose.recoil, + tipY:pose.y+ny*endWave+ty*pose.recoil}}; } function startWireRetraction(sourceId,releasePoint){ stopWireRetraction(); @@ -1091,7 +1105,7 @@ // Visual plug follows the same free endpoint as the final SVG sample. plug.setAttribute('cx',shape.pose.tipX.toFixed(1)); plug.setAttribute('cy',shape.pose.tipY.toFixed(1)); - plug.setAttribute('r',Math.max(0,5.2*Math.pow(shape.pose.remaining,.6)).toFixed(2)); + plug.setAttribute('r',Math.max(0,5.8*Math.pow(shape.pose.remaining,.48)).toFixed(2)); if(elapsed Date: Fri, 13 Nov 2026 13:23:15 +0700 Subject: [PATCH 2/3] test(chromium): prove 330ms reel, full-span oscillations and free dot whipping both directions --- tests/pages_v60_fader_wire_tactile_smoke.py | 138 ++++++++++---------- 1 file changed, 72 insertions(+), 66 deletions(-) diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index 50d8357a9..e43a3c322 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -23,7 +23,9 @@ def source_contract(): "gesture.unityLatched=true", "if(!ev.altKey&&Math.abs", "handleField({target:g.input,type:'change'", "WIRE_IMPACT_TRAVEL_MS=520,WIRE_IMPACT_SETTLE_MS=160", - "const WIRE_RETRACT_MS=520", + "const WIRE_RETRACT_MS=330", + "const tipSwing=1.15*pose.catchUp", + "const recoil=amplitude*.13*catchUp", "function wireRetractPose(x0,y0,rx,ry,elapsedMs)", "function wireRetractWave(pose,t)", "function wireRetractPathData(x0,y0,rx,ry,elapsedMs)", @@ -342,49 +344,52 @@ def test_replug_and_retract(page): new_jacket=page.locator('#wireLayer path.wire-outgoing-line[data-cable-key="1-5"],#wireLayer path.wire-incoming-line[data-cable-key="1-5"]').first assert " C " in new_jacket.get_attribute("d"),"replug must settle to canonical cubic" - # Drag receiver to a valid blank WIRE bay. The committed graph REMOVE - # is immediate; the detached jacket is visual-only and actively reels - # back to OUT. V64 intentionally has NO falling / hanging phase. + # Observe the actual detached SVG during an accepted pointer unplug. + # A 330ms reel MUST be measured with RAF/DOM evidence, not a sequence + # of slow locator reads that might miss a fast short-lived animation. + page.evaluate("""()=>{ + window.__v66ReelFrames=[]; + window.__v66ReelObserver=new MutationObserver(()=>{ + const layer=document.querySelector('#wireRetractLayer'); + const plug=layer?.querySelector('[data-wire-retract-plug]'); + const jacket=layer?.querySelector('[data-wire-retract-jacket]'); + if(!plug||!jacket)return; + const x=Number(plug.getAttribute('cx')),y=Number(plug.getAttribute('cy')); + if(Number.isFinite(x)&&Number.isFinite(y)) + window.__v66ReelFrames.push({x,y,r:Number(plug.getAttribute('r')), + phase:layer.dataset.wirePhase, + d:jacket.getAttribute('d')}); + }); + window.__v66ReelObserver.observe(document.getElementById('viewport'), + {childList:true,subtree:true,attributes:true,attributeFilter:['cx','cy','d']}); + }""") other=page.locator('#tracks .strip[data-id="4"] .wire-node-in') t=dst.bounding_box();q=other.bounding_box() blank_x=(cx(t)+cx(q))/2 blank_y=cy(t) page.mouse.move(cx(t),cy(t));page.mouse.down() page.mouse.move(blank_x,blank_y,steps=12);page.mouse.up() - assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0,\ - "unplug must remove committed edge immediately" - overlay=page.locator('#wireRetractLayer[data-wire-retract="1"]') - assert overlay.count()==1,"accepted unplug must have transient cable" - assert overlay.get_attribute("data-wire-phase")=="reel" - assert overlay.evaluate("(el)=>getComputedStyle(el).pointerEvents")=="none" - jacket=overlay.locator('[data-wire-retract-jacket]') - plug=overlay.locator('[data-wire-retract-plug]') - first=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") - first_path=jacket.get_attribute("d") - page.wait_for_timeout(175) - moved=plug.evaluate("(el)=>[Number(el.getAttribute('cx')),Number(el.getAttribute('cy'))]") + assert page.locator('#wireLayer path.wire-interaction-hit[data-cable-key="1-5"]').count()==0, \ + "unplug must REMOVE the graph edge immediately" + page.wait_for_timeout(450) + frames=page.evaluate("window.__v66ReelFrames") source_x=cx(src.bounding_box()) - assert abs(moved[0]-source_x){ - const path=el.querySelector('[data-wire-retract-jacket]'); - const plug=el.querySelector('[data-wire-retract-plug]'); - const end=path.getPointAtLength(path.getTotalLength()); - return Math.hypot(end.x-Number(plug.getAttribute('cx')), - end.y-Number(plug.getAttribute('cy'))); - }""") - assert tip_gap<.25,("free plug is detached from the wavy jacket",tip_gap) - assert jacket.get_attribute("d")!=first_path,"reel never animated the jacket" - assert overlay.evaluate("(el)=>getComputedStyle(el).clipPath")=="none" + assert len(frames)>=6,("fast plug-out never animated in real browser",frames[:2]) + distances=[abs(item["x"]-source_x) for item in frames] + assert distances[0]>max(25,distances[-1]*2.5), \ + ("free plug did not reel briskly toward OUT",distances) + delta=max(item["y"] for item in frames)-min(item["y"] for item in frames) + assert delta>12,("plug dot did not visibly swing with the WIRE",delta) + assert frames[-1]["r"]OUT plug-in behavior. - model=HTML[HTML.index("const WIRE_RETRACT_MS=520"): + # Exact production code evaluated in Chromium: a strong pulse starts at + # OUT, travels through the middle and far cable, then throws the loose + # plug from side to side. It fades to zero as remaining length runs out. + model=HTML[HTML.index("const WIRE_RETRACT_MS=330"): HTML.index("function startWireRetraction(")] physics=page.evaluate("()=>{\n"+model+"""\n const chord=400; @@ -392,45 +397,46 @@ def test_replug_and_retract(page): const {d,pose}=wireRetractPathData(0,0,chord,0,ms); const ys=d.match(/-?\d+(?:\.\d+)?/g).map(Number); const t=i/64; - const baseline=pose.sag*Math.sin(Math.PI*t); - return ys[2*i+1]-baseline; + return ys[2*i+1]-pose.sag*Math.sin(Math.PI*t); }; - const early=wireRetractPathData(0,0,chord,0,135); - const middle=wireRetractPathData(0,0,chord,0,220); - const flex=wireRetractPathData(0,0,chord,0,175); + const early=wireRetractPathData(0,0,chord,0,50); + const middle=wireRetractPathData(0,0,chord,0,120); + const crest=wireRetractPathData(0,0,chord,0,135); const finished=wireRetractPathData(0,0,chord,0,WIRE_RETRACT_MS); - const shortPose=wireRetractPose(0,0,80,0,115); - const longPose=wireRetractPose(0,0,chord,0,115); + const shortPose=wireRetractPose(0,0,80,0,95); + const longPose=wireRetractPose(0,0,chord,0,95); + const tip=ms=>wireRetractPathData(0,0,chord,0,ms).pose.tipY; + const svgTip=crest.d.match(/-?\d+(?:\.\d+)?/g).map(Number).slice(-2); return { - nearOutEarly:deviation(40,8),farEarly:deviation(40,51), - midAfter:deviation(125,32),farAfter:deviation(155,48), - freeTipWave:deviation(175,64), - sourceAnchor:deviation(175,0), - halfwayX:middle.pose.x,earlyX:early.pose.x, - tipX:flex.pose.tipX,tipY:flex.pose.tipY, + nearOut:deviation(20,8),farEarly:deviation(20,51), + middleSwing:deviation(60,32),farSwing:deviation(80,48), + tipFirst:tip(100),tipRebound:tip(135), + sourceAnchor:deviation(135,0),earlyX:early.pose.x, + middleX:middle.pose.x,tipX:crest.pose.tipX, + tipY:crest.pose.tipY,svgTip, completeX:finished.pose.tipX,completeY:finished.pose.tipY, shortAmplitude:shortPose.amplitude,longAmplitude:longPose.amplitude, startPhase:early.pose.phase,finishAmplitude:finished.pose.amplitude }; }""") - assert abs(physics["nearOutEarly"])>2,("reel has no abrupt OUT-origin whip",physics) - assert abs(physics["farEarly"])<.4,("free tip moves before OUT-origin front arrives",physics) - assert abs(physics["midAfter"])>2 and abs(physics["farAfter"])>2,\ - ("wavy must travel through the whole jacket, not just near OUT",physics) - assert abs(physics["freeTipWave"])>3,\ - ("loose plug remains rigid when wave arrives",physics) - assert abs(physics["sourceAnchor"])<.25,("OUT socket endpoint shifted",physics) - assert 03,("tip never reacts to wave",physics) + assert abs(physics["nearOut"])>3 and abs(physics["farEarly"])<.4, \ + ("impulse must start at OUT, not at the free plug",physics) + assert abs(physics["middleSwing"])>7 and abs(physics["farSwing"])>9, \ + ("wave fails to excite the entire shortening cable",physics) + assert abs(physics["tipFirst"])>10 and abs(physics["tipRebound"])>17, \ + ("dot/loose plug does not swing enough",physics) + assert physics["tipFirst"]*physics["tipRebound"]<0, \ + ("free dot must whip back in the opposite direction",physics) + assert abs(physics["sourceAnchor"])<.25,"source OUT socket cannot move" + assert 0 Date: Fri, 13 Nov 2026 13:24:46 +0700 Subject: [PATCH 3/3] test(gui): update V66 source contract to new OUT-front wave statement --- tests/pages_v60_fader_wire_tactile_smoke.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pages_v60_fader_wire_tactile_smoke.py b/tests/pages_v60_fader_wire_tactile_smoke.py index e43a3c322..20d4a6ad1 100644 --- a/tests/pages_v60_fader_wire_tactile_smoke.py +++ b/tests/pages_v60_fader_wire_tactile_smoke.py @@ -31,7 +31,7 @@ def source_contract(): "function wireRetractPathData(x0,y0,rx,ry,elapsedMs)", "const endWave=wireRetractWave(pose,1)", "plug.setAttribute('cy',shape.pose.tipY.toFixed(1))", - "const passed=pose.front-t; // first near OUT, then all along the cable", + "const passed=pose.front-t;", "svg.style.clipPath='none'", "const width=.65-.29*longMix", "const length01=Math.max(0,Math.min(1,(chord-95)/300))",