rig-review 0.25.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/PANELS.md CHANGED
@@ -397,6 +397,10 @@ are supported. No degrees or range are inferred from the art or the bone name.
397
397
 
398
398
  **Applied** is the eased value sent through published Play's `player.adjust` /
399
399
  `BoneAdjust`, before constraints and physics; **target** is the pointer's value.
400
+ Each readout reserves monospace character width from its dial's own `[min, max]`
401
+ range and display precision (rounded to two decimals, or scaled for sub-unit
402
+ spans) so live values never change the pad's row wrapping or height; the number
403
+ field and `data-value` retain the exact value.
400
404
  The number field edits the target, applies that exact value immediately and turns
401
405
  **Hold** on. Hold freezes the current applied values and cancels pending travel;
402
406
  **Reset 0** applies zero and holds it. Neither operation changes inspection time.
@@ -422,7 +426,7 @@ remains independent, temporary and unrecorded.
422
426
 
423
427
  ## Stage comments
424
428
 
425
- The visible **Comment · C (n)** stage button is the single comment control on both the review and compare toolbars (rig, compare A/B and reference video). Turning it on enters comment mode and opens the **Comments** list; turning it off, or pressing Escape, leaves both. In comment mode, drag a rectangle (or click a point), type in the inline composer, and press Enter. Playback pauses, turn is held, and the composer receives focus; Escape cancels and leaves comment mode and the list. Text is the only required input. An active Edit Mesh keeps its Create shortcut C; leave the editor before using Comment. With Comment off, selection, turn and camera gestures keep their normal behavior.
429
+ The visible **Comment · C (n)** stage button is the single comment control on both the review and compare toolbars (rig, compare A/B and reference video). Turning it on enters comment mode and opens the **Comments** list below the view bar at any width, so an open list covers no bar control; turning it off, or pressing Escape, leaves both. In comment mode, drag a rectangle (or click a point), type in the inline composer, and press Enter. Playback pauses, turn is held, and the composer receives focus; Escape cancels and leaves comment mode and the list. Text is the only required input. An active Edit Mesh keeps its Create shortcut C; leave the editor before using Comment. With Comment off, selection, turn and camera gestures keep their normal behavior.
426
430
 
427
431
  The **Comments** list shows numbered marks with their placement mode. Setup and Animate marks appear on the stage only in that mode; the compare page always records Compare. Returning to a mode shows its marks again at their captured pose. Pins stay visible on the stage when comment mode is off, and clicking a pin enters comment mode and opens the list. Clicking either a pin or a list row restores its captured mode before its exact frame/time, camera and turn and opens that comment in the same inline composer. Rows have no separate Edit button; **Delete** lives inside the composer for unsubmitted comments, and submitted marks open read-only in the composer and list. Placement mode is captured when the gesture begins, before asynchronous crop/save; changing mode cancels the pending drag or composer and never rebinds it. Pins and rectangles use world coordinates (reference pixels, Y down, for the video), follow zoom and pan, and appear only at the captured frame/time and dial state. Reference letterboxing is included in its camera mapping. The list is also a way back to a mark hidden in another mode or pose. JSON exports index every canonical feedback comment by mode; Markdown places the full comments under their mode headings. Missing mode refuses `COMMENT_MODE_MISSING`, unknown mode refuses `COMMENT_MODE_UNKNOWN`, and a mode incompatible with the saved page/inspector refuses `COMMENT_MODE_MISMATCH`; no missing-mode guess or migration is made. Ordinary feedback and legacy text context are unchanged.
428
432
 
@@ -587,7 +587,7 @@ Browser players retain play's default DOM mode and default mesh backend. Rigid
587
587
  parts remain DOM images; a WebGL mesh label does not claim full-frame GL drawing.
588
588
  WebGL is requested by the published default, with Canvas2D as the supported mesh
589
589
  fallback. Accurate public actual-flush telemetry requires play 1.11.1 or later;
590
- this checkout consumes pinned 1.14.0. The consumer does not probe GL or inspect
590
+ this checkout consumes pinned 1.22.1. The consumer does not probe GL or inspect
591
591
  private renderer state. The separate Node strip exporter remains Canvas2D.
592
592
 
593
593
  The backend badge is sampled only after successful draw/frame calls. Fresh mesh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-review",
3
- "version": "0.25.1",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "Local human rig inspection and structured feedback export",
6
6
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@napi-rs/canvas": "1.0.11",
22
- "@rig-c/play": "1.14.0"
22
+ "@rig-c/play": "1.22.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/bun": "^1.3.0",
package/src/front.ts CHANGED
@@ -164,7 +164,7 @@ export function startFront(options:{control:string;port:number;nonce:string;fing
164
164
  }});
165
165
  return {origin,stop:()=>server.stop(true),idleMs:()=>performance.now()-last,active:()=>active};
166
166
  }
167
- async function liveInstances(control:string):Promise<boolean>{for(const name of await readdir(control)){if(/^[a-f0-9]{64}\.claim$/.test(name))return true;if(/^[a-f0-9]{64}\.json$/.test(name)){const row=await readRecord(join(control,name),name.slice(0,64)).catch(()=>null);if(row&&running(row.pid))return true;}}return false;}
167
+ async function liveInstances(control:string):Promise<boolean>{let names:string[];try{names=await readdir(control);}catch(e){if((e as NodeJS.ErrnoException).code==='ENOENT')return false;throw e;}for(const name of names){if(/^[a-f0-9]{64}\.claim$/.test(name))return true;if(/^[a-f0-9]{64}\.json$/.test(name)){const row=await readRecord(join(control,name),name.slice(0,64)).catch(()=>null);if(row&&running(row.pid))return true;}}return false;}
168
168
  export async function runFront(requestPath:string):Promise<void>{
169
169
  const spec=await smallJson(requestPath) as FrontRequest;if(spec?.schema!=='rig-review-front-request/1'||!uuid.test(spec.nonce??'')||!hex64.test(spec.fingerprint??'')||!Number.isSafeInteger(spec.port)||spec.port<1||spec.port>65535||!Number.isSafeInteger(spec.idleMs)||spec.idleMs<100)throw new Error('front: invalid request');
170
170
  const control=await realpath(spec.control);if(dirname(await realpath(requestPath))!==control||spec.request!==requestPath||spec.record!==join(control,frontName(spec.port)+'.json'))throw new Error('front: invalid state locations');
package/src/turn-pad.ts CHANGED
@@ -33,6 +33,23 @@ export function pointerPosition(x:number,y:number,rect:{left:number;top:number;w
33
33
  return rect.width>0&&rect.height>0?[clamp((x-rect.left)/rect.width*2-1,-1,1),clamp(1-(y-rect.top)/rect.height*2,-1,1)]:[0,0];
34
34
  }
35
35
  export function normalizedDial(n:number,range:{min:number;max:number}):number {const v=clamp(n,-1,1),zero=clamp(0,range.min,range.max);return clamp(zero+Math.abs(v)*((v<0?range.min:range.max)-zero),range.min,range.max);}
36
+ /** Display precision for `<output>` readouts: 2 decimals for spans >= 1, scaled up (at most 6) for sub-unit ranges. */
37
+ export function turnDialPrecision(range:{min:number;max:number},precision?:number):number {
38
+ if(precision!==undefined){if(!Number.isInteger(precision)||precision<0||precision>6)throw new Error('TURN_PRECISION_INVALID');return precision;}
39
+ const span=Math.abs(range.max-range.min);
40
+ return span>0&&span<1?Math.min(6,Math.max(2,Math.ceil(-Math.log10(span))+2)):2;
41
+ }
42
+ /** Rounded display text for `<output>`; the number input and `dataset.value` keep the exact value. */
43
+ export function formatTurnValue(value:number,range:{min:number;max:number},precision=turnDialPrecision(range)):string {
44
+ const p=turnDialPrecision(range,precision);
45
+ return String(Number(value.toFixed(p))||0);
46
+ }
47
+ /** Widest character count (`ch`) reachable in `[range.min, range.max]` at `precision`, including minus sign and decimal point. */
48
+ export function turnDialWidthCh(range:{min:number;max:number},precision=turnDialPrecision(range)):number {
49
+ if(!finite(range.min)||!finite(range.max)||range.min>=range.max)throw new Error('TURN_RANGE_INVALID');
50
+ const p=turnDialPrecision(range,precision);
51
+ return Math.max(range.min.toFixed(p).length,range.max.toFixed(p).length);
52
+ }
36
53
  /** Exact critically damped solution from https://rig-c.org/demos/head-turn/bundle/app.js (HEAD_SPRING_OMEGA0=20). */
37
54
  export function springStep(s:{x:number;v:number},target:number,dt:number,omega=20):void {
38
55
  if(!(dt>0)||!finite(dt))return;const e=s.x-target,tau=omega*dt,exp=Math.exp(-tau),x=target+(e*(1+tau)+s.v*dt)*exp,v=(s.v*(1-tau)-omega*omega*dt*e)*exp;
package/web/catalog-en.ts CHANGED
@@ -2953,4 +2953,53 @@ export const enCatalog: Readonly<Record<string, string>> = {
2953
2953
  "Comment {0}: {1}": "Comment {0}: {1}",
2954
2954
  "Comment {0}:": "Comment {0}:",
2955
2955
  "{0} s (seconds basis) · frame is unavailable: no explicit producer frame index at this time (COMMENT_FRAME_UNAVAILABLE)": "{0} s (seconds basis) · frame is unavailable: no explicit producer frame index at this time (COMMENT_FRAME_UNAVAILABLE)",
2956
+ "{0} split at": "{0} split at",
2957
+ "{0} split into": "{0} split into",
2958
+ "{0} hold tip": "{0} hold tip",
2959
+ "{0} length ratio": "{0} length ratio",
2960
+ "{0} strength trunk": "{0} strength trunk",
2961
+ "{0} strength branch": "{0} strength branch",
2962
+ "{0} strength edge": "{0} strength edge",
2963
+ "{0} alternate damping": "{0} alternate damping",
2964
+ "{0} wind [root, tip]": "{0} wind [root, tip]",
2965
+ "{0} gravity [root, tip]": "{0} gravity [root, tip]",
2966
+ "{0} swing scales": "{0} swing scales",
2967
+ "{0} influence across": "{0} influence across",
2968
+ "{0} influence max": "{0} influence max",
2969
+ "{0} influence shape": "{0} influence shape",
2970
+ "{0} influence radius": "{0} influence radius",
2971
+ "built by {0}": "built by {0}",
2972
+ "{0} regions": "{0} regions",
2973
+ "{0} stops": "{0} stops",
2974
+ "blink": "blink",
2975
+ "Inspect {0}": "Inspect {0}",
2976
+ " · region {0}": " · region {0}",
2977
+ " · sequence {0}": " · sequence {0}",
2978
+ "region {0}": "region {0}",
2979
+ "sequence {0}": "sequence {0}",
2980
+ " · bone · parent {0} · bones[{1}]": " · bone · parent {0} · bones[{1}]",
2981
+ " · chain · parent {0} · bones[{1}]": " · chain · parent {0} · bones[{1}]",
2982
+ " · physics · bone {0} · {1}": " · physics · bone {0} · {1}",
2983
+ "Apex L, Cleavage": "Apex L, Cleavage",
2984
+ "Apex R, Cleavage": "Apex R, Cleavage",
2985
+ "Apex R, Apex L": "Apex R, Apex L",
2986
+ "baseline: not run — {0}": "baseline: not run — {0}",
2987
+ "baseline: not run — {0} ({1} s)": "baseline: not run — {0} ({1} s)",
2988
+ "baseline: reproduced — rig.json {0}… = inspected {1}…": "baseline: reproduced — rig.json {0}… = inspected {1}…",
2989
+ "baseline: reproduced — rig.json {0}… = inspected {1}… ({2} s)": "baseline: reproduced — rig.json {0}… = inspected {1}… ({2} s)",
2990
+ "baseline: not reproduced — {0}": "baseline: not reproduced — {0}",
2991
+ "baseline: not reproduced — {0} ({1} s)": "baseline: not reproduced — {0} ({1} s)",
2992
+ "baseline: unavailable — MODELING_INPUT_UNAVAILABLE: {0}": "baseline: unavailable — MODELING_INPUT_UNAVAILABLE: {0}",
2993
+ "image · {0}": "image · {0}",
2994
+ "{0} · image": "{0} · image",
2995
+ "video · {0}": "video · {0}",
2996
+ "{0} · video": "{0} · video",
2997
+ "pose · {0}": "pose · {0}",
2998
+ "{0} · pose": "{0} · pose",
2999
+ "maxInfluences (influences)": "maxInfluences (influences)",
3000
+ "absent": "absent",
3001
+ "front": "front",
3002
+ "back": "back",
3003
+ "@rig-c/pose is not installed beside the package or beside review, and review does not install it — bun add -d @rig-c/pose": "@rig-c/pose is not installed beside the package or beside review, and review does not install it — bun add -d @rig-c/pose",
3004
+ "CHEST_REGION_VALUE_INVALID contour tolerance": "CHEST_REGION_VALUE_INVALID contour tolerance",
2956
3005
  };
package/web/catalog-ko.ts CHANGED
@@ -2953,4 +2953,53 @@ export const koCatalog: Readonly<Record<string, string>> = {
2953
2953
  "Comment {0}: {1}": "코멘트 {0}: {1}",
2954
2954
  "Comment {0}:": "코멘트 {0}:",
2955
2955
  "{0} s (seconds basis) · frame is unavailable: no explicit producer frame index at this time (COMMENT_FRAME_UNAVAILABLE)": "{0}초 (초 기준) · 프레임을 사용할 수 없음: 현재 시간에 명시적 프로듀서 프레임 인덱스가 없습니다 (COMMENT_FRAME_UNAVAILABLE)",
2956
+ "{0} split at": "{0} 분할 지점(split at)",
2957
+ "{0} split into": "{0} 분할 개수(split into)",
2958
+ "{0} hold tip": "{0} 팁 고정(hold tip)",
2959
+ "{0} length ratio": "{0} 길이 비율",
2960
+ "{0} strength trunk": "{0} 줄기 강도(strength trunk)",
2961
+ "{0} strength branch": "{0} 가지 강도(strength branch)",
2962
+ "{0} strength edge": "{0} 가장자리 강도(strength edge)",
2963
+ "{0} alternate damping": "{0} 교차 감쇠(alternate damping)",
2964
+ "{0} wind [root, tip]": "{0} 바람 [루트, 팁]",
2965
+ "{0} gravity [root, tip]": "{0} 중력 [루트, 팁]",
2966
+ "{0} swing scales": "{0} 스윙 배율(swing scales)",
2967
+ "{0} influence across": "{0} 가로 영향력(influence across)",
2968
+ "{0} influence max": "{0} 최대 영향력(influence max)",
2969
+ "{0} influence shape": "{0} 영향 형태(influence shape)",
2970
+ "{0} influence radius": "{0} 영향 반경(influence radius)",
2971
+ "built by {0}": "빌드 방식: {0}",
2972
+ "{0} regions": "영역 {0}개",
2973
+ "{0} stops": "스톱 {0}개",
2974
+ "blink": "눈 깜빡임",
2975
+ "Inspect {0}": "{0} 점검",
2976
+ " · region {0}": " · 영역 {0}",
2977
+ " · sequence {0}": " · 시퀀스 {0}",
2978
+ "region {0}": "영역 {0}",
2979
+ "sequence {0}": "시퀀스 {0}",
2980
+ " · bone · parent {0} · bones[{1}]": " · 본 · 부모 {0} · bones[{1}]",
2981
+ " · chain · parent {0} · bones[{1}]": " · 체인 · 부모 {0} · bones[{1}]",
2982
+ " · physics · bone {0} · {1}": " · 물리 · 본 {0} · {1}",
2983
+ "Apex L, Cleavage": "왼쪽 정점(Apex L), 골(Cleavage)",
2984
+ "Apex R, Cleavage": "오른쪽 정점(Apex R), 골(Cleavage)",
2985
+ "Apex R, Apex L": "오른쪽 정점(Apex R), 왼쪽 정점(Apex L)",
2986
+ "baseline: not run — {0}": "베이스라인: 실행 안 됨 — {0}",
2987
+ "baseline: not run — {0} ({1} s)": "베이스라인: 실행 안 됨 — {0} ({1}초)",
2988
+ "baseline: reproduced — rig.json {0}… = inspected {1}…": "베이스라인: 재현됨 — rig.json {0}… = 점검 대상 {1}…",
2989
+ "baseline: reproduced — rig.json {0}… = inspected {1}… ({2} s)": "베이스라인: 재현됨 — rig.json {0}… = 점검 대상 {1}… ({2}초)",
2990
+ "baseline: not reproduced — {0}": "베이스라인: 재현되지 않음 — {0}",
2991
+ "baseline: not reproduced — {0} ({1} s)": "베이스라인: 재현되지 않음 — {0} ({1}초)",
2992
+ "baseline: unavailable — MODELING_INPUT_UNAVAILABLE: {0}": "베이스라인: 사용 불가 — MODELING_INPUT_UNAVAILABLE: {0}",
2993
+ "image · {0}": "이미지 · {0}",
2994
+ "{0} · image": "{0} · 이미지",
2995
+ "video · {0}": "비디오 · {0}",
2996
+ "{0} · video": "{0} · 비디오",
2997
+ "pose · {0}": "포즈 · {0}",
2998
+ "{0} · pose": "{0} · 포즈",
2999
+ "maxInfluences (influences)": "최대 영향 수(maxInfluences)",
3000
+ "absent": "없음",
3001
+ "front": "앞",
3002
+ "back": "뒤",
3003
+ "@rig-c/pose is not installed beside the package or beside review, and review does not install it — bun add -d @rig-c/pose": "패키지 또는 리뷰 옆에 @rig-c/pose가 설치되어 있지 않으며 리뷰가 직접 설치하지 않습니다 — bun add -d @rig-c/pose",
3004
+ "CHEST_REGION_VALUE_INVALID contour tolerance": "CHEST_REGION_VALUE_INVALID: 윤곽 허용 오차(contour tolerance)",
2956
3005
  };
package/web/compare.css CHANGED
@@ -127,13 +127,13 @@ body{display:grid;grid-template-rows:auto minmax(0,1fr) auto}.layout{grid-templa
127
127
  .turn-pad{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;padding:8px 12px}
128
128
  .turn-pad>span{color:var(--fg-muted);font-size:11px}
129
129
  .turn-pad label{display:flex;align-items:center;gap:5px;font-size:11px;white-space:nowrap}
130
- .turn-pad input[type=number]{width:78px;color:var(--fg);background:var(--rv-control);border:1px solid var(--border-strong);padding:4px}
131
- .turn-pad output{font-variant-numeric:tabular-nums;color:var(--fg-strong)}
130
+ .turn-pad input[type=number]{width:64px;color:var(--fg);background:var(--rv-control);border:1px solid var(--border-strong);padding:4px}
131
+ .turn-pad output{display:inline-block;font-family:var(--font-mono);font-variant-numeric:tabular-nums;text-align:right;color:var(--fg-strong)}
132
132
  .turn-pad button[aria-pressed=true]{border-color:var(--pass);color:var(--pass)}
133
133
  #turn-pad-host>p{margin:0 12px 6px}
134
134
 
135
135
  /* Source-bound stage comments; the layer never intercepts ordinary inspection. */
136
- main{position:relative}.stage-comment-mode{cursor:crosshair}.stage-comment-mode video{pointer-events:none}.stage-comment-layer{position:absolute;inset:0;pointer-events:none;z-index:20;overflow:hidden}.stage-comment-region{position:absolute;border:2px solid var(--link);pointer-events:none}.stage-comment-pin{position:absolute;transform:translate(-50%,-50%);border-radius:50%;min-width:26px;height:26px;padding:2px 5px;background:var(--link);color:var(--btn-fg);pointer-events:auto}.stage-comment-composer{position:absolute;z-index:30;width:286px;padding:10px;background:var(--rv-panel);border:1px solid var(--link);border-radius:6px;box-shadow:0 4px 20px var(--rv-backdrop)}.stage-comment-composer input{width:100%}.stage-comment-composer small{display:block;margin-top:6px;color:var(--fg-muted)}.stage-comment-composer p{color:var(--fail);margin:4px 0}.stage-comment-list{position:absolute;z-index:40;right:8px;top:55px;width:310px;max-width:90%;max-height:60%;overflow:auto;background:var(--rv-panel);border:1px solid var(--border-strong);padding:12px;border-radius:6px}.stage-comment-item{padding:8px 0;border-bottom:1px solid var(--border)}.stage-comment-item>button:first-child{display:block;width:100%;text-align:left;overflow-wrap:anywhere}.stage-comment-item span{display:block;color:var(--fg-muted)}
136
+ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-comment{white-space:nowrap;flex:none}#stage-comment-refusal{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.stage-comment-refusal-note{display:block;margin-top:4px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--fg-muted)}.stage-comment-mode{cursor:crosshair}.stage-comment-mode video{pointer-events:none}.stage-comment-layer{position:absolute;inset:0;pointer-events:none;z-index:20;overflow:hidden}.stage-comment-region{position:absolute;border:2px solid var(--link);pointer-events:none}.stage-comment-pin{position:absolute;transform:translate(-50%,-50%);border-radius:50%;min-width:26px;height:26px;padding:2px 5px;background:var(--link);color:var(--btn-fg);pointer-events:auto}.stage-comment-composer{position:absolute;z-index:30;width:286px;padding:10px;background:var(--rv-panel);border:1px solid var(--link);border-radius:6px;box-shadow:0 4px 20px var(--rv-backdrop)}.stage-comment-composer input{width:100%}.stage-comment-composer small{display:block;margin-top:6px;color:var(--fg-muted)}.stage-comment-composer p{color:var(--fail);margin:4px 0}.stage-comment-list{position:absolute;position-anchor:--stage-comment-bar;z-index:40;right:8px;top:calc(anchor(bottom,50px) + 5px);width:310px;max-width:90%;max-height:60%;overflow:auto;background:var(--rv-panel);border:1px solid var(--border-strong);padding:12px;border-radius:6px}.stage-comment-item{padding:8px 0;border-bottom:1px solid var(--border)}.stage-comment-item>button:first-child{display:block;width:100%;text-align:left;overflow-wrap:anywhere}.stage-comment-item span{display:block;color:var(--fg-muted)}
137
137
 
138
138
  /* Top mode switch and picked-build Setup/Animate panels (#234). */
139
139
  .mode-switch{display:flex;gap:3px;padding:3px;border:1px solid var(--border-strong);border-radius:8px;background:var(--rv-segmented)}
@@ -171,7 +171,6 @@ main{position:relative}.stage-comment-mode{cursor:crosshair}.stage-comment-mode
171
171
  .applied-records{padding:12px 15px;border-bottom:1px solid var(--border);background:var(--rv-panel);font-size:11px}.applied-records .row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}.applied-records .eyebrow{margin:0}.applied-records button{padding:4px 9px;font-size:11px}.applied-list{margin:0 0 6px;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:3px}.applied-list li{font:11px var(--font-mono);color:var(--fg-muted);overflow-wrap:anywhere}.applied-list li.on-stage{color:var(--fg-strong)}#applied-status{margin:0}#applied-status.error{color:var(--fail)}
172
172
  .density-strip{margin-top:12px;padding-top:10px;border-top:1px solid var(--border)}.density-strip-form label{display:inline-flex;align-items:center;gap:4px}.density-strip-form input[type=number]{width:64px}.density-strip-table{overflow-x:auto;max-width:100%}.density-strip-rows{width:100%;border-collapse:collapse;font:11px var(--font-mono);font-variant-numeric:tabular-nums}.density-strip-rows th,.density-strip-rows td{padding:4px 6px;border-top:1px solid var(--border);text-align:left;vertical-align:top}.density-strip-rows th{color:var(--fg-muted);font-weight:500;white-space:nowrap}.density-strip-rows tr.pending td{background:var(--rv-pressed-bg)}.density-strip-rows tr.refused td{color:var(--fg-muted)}.density-strip-value strong{display:block;color:var(--fg-strong)}.density-strip-label{display:block;margin-top:3px;padding:1px 5px;border:1px solid var(--rv-pressed-border);border-radius:4px;color:var(--fg-strong);white-space:nowrap;font-family:var(--font-sans)}.density-strip-bars div{white-space:nowrap}.density-strip-verdict{min-width:140px;max-width:340px;overflow-wrap:anywhere}.density-strip-verdict.pass{color:var(--pass)}.density-strip-actions{white-space:nowrap}.density-strip-actions button{margin:0 4px 4px 0}
173
173
  /* Key inspection and dopesheet editing (#235): tokens only. */
174
- #stage-comment-refusal{flex:0 1 180px;min-width:0;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--fg-muted)}
175
174
  .inspector-body{display:flex;flex-direction:column;min-height:0;overflow:hidden}
176
175
  .inspector-body>[data-inspector-panel]{flex:1 1 0;min-height:0}
177
176
  .applied-records:not([hidden]){display:flex;align-items:center;gap:8px;padding:1px 10px;height:20px;min-height:20px;max-height:20px;box-sizing:border-box;overflow:hidden;flex:none}
package/web/i18n.ts CHANGED
@@ -170,6 +170,12 @@ function ensureMaps(): { enToKo: Map<string, string>; koToEn: Map<string, string
170
170
  if (!enToKoMap.has(enSub)) enToKoMap.set(enSub, koSub);
171
171
  if (!koToEnMap.has(koSub)) koToEnMap.set(koSub, enSub);
172
172
  }
173
+ if (/^ \([^(){}]+\)$/.test(en) && /^ \([^(){}]+\)$/.test(ko)) {
174
+ const enPre = `{0}${en}`;
175
+ const koPre = `{0}${ko}`;
176
+ if (!enToKoMap.has(enPre)) enToKoMap.set(enPre, koPre);
177
+ if (!koToEnMap.has(koPre)) koToEnMap.set(koPre, enPre);
178
+ }
173
179
  const enCode = /^([A-Z][A-Z0-9_]{2,}):\s+([\s\S]+)$/.exec(en);
174
180
  const koCode = /^([A-Z][A-Z0-9_]{2,}):\s+([\s\S]+)$/.exec(ko);
175
181
  if (enCode && koCode && enCode[1] === koCode[1]) {
@@ -184,6 +190,14 @@ function ensureMaps(): { enToKo: Map<string, string>; koToEn: Map<string, string
184
190
  if (!enToKoMap.has(enTrim)) enToKoMap.set(enTrim, koTrim);
185
191
  if (!koToEnMap.has(koTrim)) koToEnMap.set(koTrim, enTrim);
186
192
  }
193
+ if (en.endsWith('.') && !en.endsWith('..') && ko.endsWith('.') && !ko.endsWith('..')) {
194
+ const enNoDot = en.slice(0, -1);
195
+ const koNoDot = ko.slice(0, -1);
196
+ if (enNoDot && koNoDot) {
197
+ if (!enToKoMap.has(enNoDot)) enToKoMap.set(enNoDot, koNoDot);
198
+ if (!koToEnMap.has(koNoDot)) koToEnMap.set(koNoDot, enNoDot);
199
+ }
200
+ }
187
201
  }
188
202
  return { enToKo: enToKoMap, koToEn: koToEnMap };
189
203
  }
@@ -215,33 +229,67 @@ function buildPatterns(fromCatalog: Readonly<Record<string, string>>, toCatalog:
215
229
  if (!srcPattern || !dstPattern || srcPattern === dstPattern) continue;
216
230
  if (!srcPattern.includes('{0}')) continue;
217
231
  const literalOnly = srcPattern.replace(tokenRe, '').trim();
232
+ const alphaKoOnly = literalOnly.replace(/[^A-Za-z가-힣]+/g, '');
218
233
  // Skip bare structural patterns that have no alphabetic or Korean words of their own
219
- if (!/[A-Za-z가-힣]{2,}/.test(literalOnly)) continue;
234
+ if (alphaKoOnly.length === 0 || alphaKoOnly === '의') {
235
+ continue;
236
+ }
220
237
  const paramOrder: number[] = [];
238
+ const hasDotSep = srcPattern.includes(' · ') && literalOnly.length > 8;
239
+ const charUnit = hasDotSep
240
+ ? '[\\s\\S]'
241
+ : alphaKoOnly.length < 2
242
+ ? '(?:(?!\\. |\\n| · )[\\s\\S])'
243
+ : '(?:(?! · )[\\s\\S])';
221
244
  const isShortOpenEnded =
222
- /^\{\d+\}/.test(srcPattern) &&
223
- /\{\d+\}$/.test(srcPattern) &&
245
+ /^\{\d+\} [A-Za-z가-힣()/+-]+ \{\d+\}$/.test(srcPattern) &&
224
246
  literalOnly.length < 10 &&
225
247
  !literalOnly.includes('·') &&
226
248
  !literalOnly.includes(':');
227
249
  let regexBody = '^';
228
250
  let lastIndex = 0;
229
251
  let match: RegExpExecArray | null;
252
+ let prevWasOptionalPrefix = false;
230
253
  tokenRe.lastIndex = 0;
231
254
  while ((match = tokenRe.exec(srcPattern)) !== null) {
232
255
  const literalChunk = srcPattern.slice(lastIndex, match.index);
233
256
  regexBody += literalChunk.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
234
257
  paramOrder.push(Number(match[1]));
258
+ const tokenStart = match.index;
235
259
  lastIndex = match.index + match[0].length;
236
260
  const isAtEnd = lastIndex === srcPattern.length;
237
- const nextIsToken = srcPattern.slice(lastIndex).startsWith('{');
261
+ const afterToken = srcPattern.slice(lastIndex);
262
+ const beforeToken = srcPattern.slice(0, tokenStart);
263
+ const nextIsToken = afterToken.startsWith('{');
264
+ const isOptionalPrefix: boolean =
265
+ (tokenStart === 0 || (beforeToken.endsWith('}') && prevWasOptionalPrefix)) &&
266
+ (afterToken.startsWith('Readings of ') ||
267
+ afterToken.startsWith('retarget ') ||
268
+ afterToken.startsWith('build ') ||
269
+ afterToken.startsWith('빌드 ') ||
270
+ /^\{\d+\}(?: op\b| ops\b| 작업\b|build |빌드 | \{\d+\} \+ (?:compile|컴파일) | 측정: )/.test(afterToken));
271
+ const prevIsNonPrefixToken = beforeToken.endsWith('}') && !prevWasOptionalPrefix;
272
+ const isAttachedAfterWord = /(?:[a-z가-힣]|[A-Z]{2}|[)\]]|\}\u2026)$/.test(beforeToken);
273
+ const isAttachedBeforePunct = /^(?:[.,):;]| · | — )/.test(afterToken);
274
+ const isOptionalSuffix =
275
+ prevIsNonPrefixToken ||
276
+ (isAttachedAfterWord && (isAttachedBeforePunct || nextIsToken || isAtEnd));
277
+ // A bare space opens a suffix only after a literal: beside another placeholder it would split that placeholder's value.
278
+ const spaceDelim = beforeToken.endsWith('}') ? '' : '| ';
279
+ const optDelim = '(?:|(?: · | — | \\(|, |; |\\[| —' + spaceDelim + ')' + charUnit + '*?)';
280
+ const optDelimEnd = '(?:|(?: · | — | \\(|, |; |\\[| —' + spaceDelim + ')' + charUnit + '*)';
238
281
  regexBody += isShortOpenEnded
239
282
  ? '([^\\s]+)'
240
- : isAtEnd
241
- ? '([\\s\\S]*)'
242
- : nextIsToken
243
- ? '([\\s\\S]*?)'
244
- : '([\\s\\S]+?)';
283
+ : isOptionalPrefix
284
+ ? `(${charUnit}*?)`
285
+ : isOptionalSuffix
286
+ ? isAtEnd
287
+ ? `(${optDelimEnd})`
288
+ : `(${optDelim})`
289
+ : isAtEnd
290
+ ? `(${charUnit}*)`
291
+ : `(${charUnit}+?)`;
292
+ prevWasOptionalPrefix = isOptionalPrefix;
245
293
  }
246
294
  regexBody += srcPattern.slice(lastIndex).replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '$';
247
295
  try {
@@ -307,6 +355,7 @@ const KNOWN_SHORT_PROSE = new Set([
307
355
  'pass',
308
356
  'error',
309
357
  'none',
358
+ 'blink',
310
359
  'not read',
311
360
  'not drawn',
312
361
  'not loaded',
@@ -363,6 +412,26 @@ function translateCore(text: string, lang: ResolvedLanguage, depth: number): str
363
412
  }
364
413
  }
365
414
 
415
+ // Preserve required-field ' *' suffix across translation
416
+ if (text.endsWith(' *')) {
417
+ const stem = text.slice(0, -2);
418
+ if (stem) {
419
+ const translatedStem = translateCore(stem, lang, depth + 1);
420
+ if (translatedStem !== stem) {
421
+ return `${translatedStem} *`;
422
+ }
423
+ }
424
+ }
425
+
426
+ // Bare seconds readout '<number> s' <-> '<number>초'
427
+ if (lang === 'ko') {
428
+ const secMatch = /^(-?\d+(?:\.\d+)?) s$/.exec(text);
429
+ if (secMatch) return `${secMatch[1]}초`;
430
+ } else {
431
+ const secMatch = /^(-?\d+(?:\.\d+)?)초$/.exec(text);
432
+ if (secMatch) return `${secMatch[1]} s`;
433
+ }
434
+
366
435
  // Preserve ERROR_CODE: <detail> prefix before wildcard pattern matching
367
436
  const codeMatch = /^([A-Z][A-Z0-9_]{2,}):\s+([\s\S]+)$/.exec(text);
368
437
  if (codeMatch) {
@@ -403,7 +472,10 @@ function translateCore(text: string, lang: ResolvedLanguage, depth: number): str
403
472
  sep === ' · ' && /^(?:[◈◇]\s+)?[AB]$/.test(parts[0]?.trim() ?? '');
404
473
  const slotIdx = sep === ' · ' ? (sidePrefix ? 1 : 0) : -1;
405
474
  const mapped = parts.map((part, idx) => {
406
- if (idx === slotIdx && /^[a-z0-9_.-]+$/.test(part.trim()) && !KNOWN_SHORT_PROSE.has(part.trim())) {
475
+ if (
476
+ (idx === slotIdx && /^[a-z0-9_.-]+$/.test(part.trim()) && !KNOWN_SHORT_PROSE.has(part.trim())) ||
477
+ (sep === ' · ' && CONTEXT_LOWER_KEYS.has(part.trim()))
478
+ ) {
407
479
  return part;
408
480
  }
409
481
  if (sep === ' · ' && idx > slotIdx) {
@@ -447,7 +519,20 @@ function normalizeHtmlKey(html: string): string {
447
519
  return html.replace(/\s+/g, ' ').trim();
448
520
  }
449
521
 
450
- const CONTEXT_LOWER_KEYS = new Set(['bone', 'box', 'from', 'root', 'silhouette', 'slot', 'tip', 'to', 'vs']);
522
+ const CONTEXT_LOWER_KEYS = new Set([
523
+ 'back',
524
+ 'bone',
525
+ 'box',
526
+ 'from',
527
+ 'front',
528
+ 'root',
529
+ 'silhouette',
530
+ 'slot',
531
+ 'tip',
532
+ 'to',
533
+ 'turbulence',
534
+ 'vs'
535
+ ]);
451
536
 
452
537
  function isExemptElement(el: Element | null): boolean {
453
538
  let cur: Element | null = el;
@@ -498,7 +583,9 @@ function isExemptElement(el: Element | null): boolean {
498
583
  selectId === 'mesh-segment-bone' ||
499
584
  selectId === 'chest-0-bone' ||
500
585
  selectId === 'chest-1-bone' ||
501
- selectId === 'person-select') &&
586
+ selectId === 'person-select' ||
587
+ parentSelect?.getAttribute?.('data-cuts-add') === 'from' ||
588
+ Boolean(parentSelect?.closest?.('#rig-fields-region'))) &&
502
589
  (cur as HTMLOptionElement).value !== ''
503
590
  ) {
504
591
  return true;
@@ -588,13 +675,19 @@ function applyTextNodeI18n(node: Node, lang: ResolvedLanguage): void {
588
675
  enText = existing.en;
589
676
  }
590
677
 
591
- const enTrimmed = enText.trim();
678
+ const enTrimmed = enText.trim().replace(/ \*$/, '');
592
679
  if (CONTEXT_LOWER_KEYS.has(enTrimmed) || (/^[a-z0-9_.-]+$/.test(enTrimmed) && enTrimmed !== 'none')) {
593
680
  const parentTag = parent.tagName?.toUpperCase();
594
681
  const allow =
595
682
  parentTag === 'LABEL' ||
596
- (parentTag === 'SPAN' && enTrimmed === 'vs') ||
597
- (parentTag === 'OPTION' && (enTrimmed === 'silhouette' || enTrimmed === 'box'));
683
+ (parentTag === 'SPAN' && (enTrimmed === 'vs' || Boolean(parent.parentElement?.classList?.contains('cloth-field')))) ||
684
+ (parentTag === 'OPTION' &&
685
+ (enTrimmed === 'silhouette' ||
686
+ enTrimmed === 'box' ||
687
+ enTrimmed === 'front' ||
688
+ enTrimmed === 'back' ||
689
+ parent.parentElement?.id === 'cuts-add' ||
690
+ parent.parentElement?.getAttribute?.('data-cuts-add') === 'draw'));
598
691
  if (!allow) return;
599
692
  }
600
693
 
@@ -1152,3 +1245,306 @@ export function checkWebHardcodedStrings(
1152
1245
  exemptions
1153
1246
  };
1154
1247
  }
1248
+
1249
+ export interface KoreanDomViolation {
1250
+ readonly kind: 'text' | 'title' | 'aria-label' | 'placeholder';
1251
+ readonly reason: 'half-translated' | 'untranslated-english';
1252
+ readonly tag: string;
1253
+ readonly id: string;
1254
+ readonly text: string;
1255
+ }
1256
+
1257
+ export interface KoreanDomContext {
1258
+ readonly kind?: 'text' | 'title' | 'aria-label' | 'placeholder';
1259
+ readonly tag?: string;
1260
+ readonly id?: string;
1261
+ readonly cls?: string;
1262
+ }
1263
+
1264
+ const SINGLE_WORD_FIELD_IDS = new Set([
1265
+ 'strength',
1266
+ 'damping',
1267
+ 'inertia',
1268
+ 'mass',
1269
+ 'wind',
1270
+ 'gravity',
1271
+ 'mix',
1272
+ 'limit',
1273
+ 'chains',
1274
+ 'links',
1275
+ 'translate',
1276
+ 'part',
1277
+ 'parts',
1278
+ 'grid',
1279
+ 'stray',
1280
+ 'exponent',
1281
+ 'rule',
1282
+ 'floor',
1283
+ 'amp',
1284
+ 'period',
1285
+ 'phase',
1286
+ 'base',
1287
+ 'lag',
1288
+ 'squash',
1289
+ 'brow_drop',
1290
+ 'loop',
1291
+ 'legs',
1292
+ 'rest',
1293
+ 'as',
1294
+ 'short',
1295
+ 'bends',
1296
+ 'stance',
1297
+ 'x',
1298
+ 'y',
1299
+ 'rotate',
1300
+ 'rx',
1301
+ 'ry',
1302
+ 'rz',
1303
+ 'tx',
1304
+ 'ty',
1305
+ 'sx',
1306
+ 'sy',
1307
+ 'dx',
1308
+ 'dy'
1309
+ ]);
1310
+
1311
+ const ENGLISH_PROSE_WORDS = new Set([
1312
+ 'no',
1313
+ 'not',
1314
+ 'the',
1315
+ 'by',
1316
+ 'of',
1317
+ 'in',
1318
+ 'to',
1319
+ 'for',
1320
+ 'with',
1321
+ 'from',
1322
+ 'at',
1323
+ 'on',
1324
+ 'is',
1325
+ 'are',
1326
+ 'was',
1327
+ 'were',
1328
+ 'be',
1329
+ 'or',
1330
+ 'and',
1331
+ 'then',
1332
+ 'into',
1333
+ 'across',
1334
+ 'built',
1335
+ 'accepts',
1336
+ 'installed',
1337
+ 'reader',
1338
+ 'compiled',
1339
+ 'binding',
1340
+ 'regions',
1341
+ 'stops',
1342
+ 'sequence',
1343
+ 'absent',
1344
+ 'blink',
1345
+ 'image',
1346
+ 'video',
1347
+ 'pose',
1348
+ 'inspect',
1349
+ 'planted',
1350
+ 'untranslated'
1351
+ ]);
1352
+
1353
+ let koCatalogValueSet: Set<string> | null = null;
1354
+ function getKoCatalogValueSet(): Set<string> {
1355
+ if (!koCatalogValueSet) {
1356
+ const vals: string[] = [];
1357
+ for (const v of Object.values(koCatalog)) {
1358
+ vals.push(v.replace(/\s+/g, ' ').trim());
1359
+ if (v.includes('<') || v.includes('&')) {
1360
+ vals.push(
1361
+ decodeHtmlEntities(v.replace(/<[^>]+>/g, ''))
1362
+ .replace(/\s+/g, ' ')
1363
+ .trim()
1364
+ );
1365
+ }
1366
+ }
1367
+ koCatalogValueSet = new Set(vals);
1368
+ }
1369
+ return koCatalogValueSet;
1370
+ }
1371
+
1372
+ function isAllowedPureEnglishSegment(s: string, ctx?: KoreanDomContext): boolean {
1373
+ const t = s.trim().replace(/^[◈◇●·]\s*/, '').replace(/\s*\*$/, '');
1374
+ if (!t || !/[A-Za-z]/.test(t)) return true;
1375
+ const tagUpper = ctx?.tag?.toUpperCase();
1376
+ if (tagUpper === 'CODE' || tagUpper === 'KBD') return true;
1377
+ if (tr(t, 'ko') !== t) {
1378
+ if (ctx?.kind === 'text' && (CONTEXT_LOWER_KEYS.has(t) || (/^[a-z0-9_.-]+$/.test(t) && t !== 'none'))) {
1379
+ const allow =
1380
+ tagUpper === 'LABEL' ||
1381
+ (tagUpper === 'SPAN' && t === 'vs') ||
1382
+ (tagUpper === 'OPTION' &&
1383
+ (t === 'silhouette' || t === 'box' || t === 'front' || t === 'back' || ctx.id === 'cuts-add'));
1384
+ if (!allow) return true;
1385
+ }
1386
+ return false;
1387
+ }
1388
+ if (/^[A-Z][A-Z0-9_]{2,}(?::\s*[\s\S]*|\*?)$/.test(t)) return true;
1389
+ if (
1390
+ t === 'a, b, …' ||
1391
+ /^(?:Space|Shift|Alt|Ctrl|Cmd|Meta|Tab|Enter|Esc|Escape|Backspace|Delete|Home|End|English|WebGL|Canvas2D|CLEAN|RETARGET|FPS|JSON|PNG|SVG)$/.test(
1392
+ t
1393
+ )
1394
+ ) {
1395
+ return true;
1396
+ }
1397
+ if (/^-?\d+(?:\.\d+)?\s*(?:px|ms|fps|Hz|s⁻¹|%|°|×)$/.test(t)) return true;
1398
+ if (/^(?:yaw|pitch|body) · [a-z0-9_]+ \[-?\d+, -?\d+\] °$/.test(t)) return true;
1399
+ if (/^[a-z0-9_]+ -?\d+(?:\.\d+)?°$/.test(t)) return true;
1400
+ if (/^[a-z0-9_.-]+ → [a-z0-9_.-]+$/.test(t)) return true;
1401
+ if (/^(?:rotate|x|y) \(-?\d+(?:\.\d+)?\)$/.test(t)) return true;
1402
+ if (
1403
+ /^(?:back hair|front hair|rig --config|rig-parts build|rig-parts rig|default \/ [a-z0-9_.-]+|[a-z0-9_.-]+ \/ default \/ [a-z0-9_.-]+)$/.test(
1404
+ t
1405
+ )
1406
+ ) {
1407
+ return true;
1408
+ }
1409
+ const fieldMatch = /^(?:[a-z0-9_.-]+|back hair|front hair) ([a-z0-9_.-]+)$/i.exec(t);
1410
+ if (fieldMatch && SINGLE_WORD_FIELD_IDS.has(fieldMatch[1]!)) return true;
1411
+ if (/^(?:#\d+ )?[a-z0-9_.-]+(?: · [a-zA-Z0-9_.-]+)+$/.test(t)) {
1412
+ const parts = t.replace(/^#\d+ /, '').split(' · ');
1413
+ if (parts.every((p) => /^[a-zA-Z0-9_.-]+$/.test(p) && !ENGLISH_PROSE_WORDS.has(p.toLowerCase()))) {
1414
+ return true;
1415
+ }
1416
+ }
1417
+ if (!t.includes(' ')) {
1418
+ if (ENGLISH_PROSE_WORDS.has(t.toLowerCase())) return false;
1419
+ if (/^[A-Z][a-z]{2,}$/.test(t)) return false;
1420
+ return true;
1421
+ }
1422
+ return false;
1423
+ }
1424
+
1425
+ export function classifyKoreanDomString(
1426
+ rawText: string,
1427
+ ctx?: KoreanDomContext
1428
+ ): 'ok' | 'half-translated' | 'untranslated-english' {
1429
+ const t = rawText.replace(/\s+/g, ' ').trim();
1430
+ if (!t || !/[A-Za-z]/.test(t)) return 'ok';
1431
+ if (!/[가-힣]/.test(t)) {
1432
+ return isAllowedPureEnglishSegment(t, ctx) ? 'ok' : 'untranslated-english';
1433
+ }
1434
+ if (getKoCatalogValueSet().has(t)) return 'ok';
1435
+ const enRound = tr(t, 'en');
1436
+ if (enRound === t || tr(enRound, 'ko') !== t) return 'half-translated';
1437
+ const segments = t.split(' · ');
1438
+ for (let i = 0; i < segments.length; i++) {
1439
+ const cleanSeg = segments[i]!.trim().replace(/^[◈◇●]\s*/, '');
1440
+ if (!cleanSeg || !/[A-Za-z]/.test(cleanSeg)) continue;
1441
+ if (!/[가-힣]/.test(cleanSeg)) {
1442
+ if (i === 0 && /^[a-z0-9_.-]+$/.test(cleanSeg) && !ENGLISH_PROSE_WORDS.has(cleanSeg)) continue;
1443
+ if (!isAllowedPureEnglishSegment(cleanSeg, ctx)) return 'half-translated';
1444
+ continue;
1445
+ }
1446
+ const stripped = cleanSeg
1447
+ .replace(/\([^()]*\)/g, ' ')
1448
+ .replace(/@[a-z0-9_-]+\/[a-z0-9_-]+/gi, ' ')
1449
+ .replace(/[a-z0-9_]+(?:[/.][a-z0-9_]+)+/gi, ' ')
1450
+ .replace(/--[a-z0-9-]+/g, ' ')
1451
+ .replace(/<[a-z0-9_-]+>/g, ' ');
1452
+ const words = stripped.match(/\b[A-Za-z]{2,}\b/g) ?? [];
1453
+ for (const w of words) {
1454
+ if (ENGLISH_PROSE_WORDS.has(w.toLowerCase()) || w === 'hold') return 'half-translated';
1455
+ }
1456
+ }
1457
+ return 'ok';
1458
+ }
1459
+
1460
+ export function checkKoreanDomI18n(root: Document | Element): {
1461
+ readonly ok: boolean;
1462
+ readonly violations: readonly KoreanDomViolation[];
1463
+ } {
1464
+ const violations: KoreanDomViolation[] = [];
1465
+ const rootEl: Element | null =
1466
+ 'documentElement' in root && root.documentElement
1467
+ ? root.documentElement
1468
+ : 'body' in root && (root as Document).body
1469
+ ? (root as Document).body
1470
+ : 'getAttribute' in root
1471
+ ? (root as Element)
1472
+ : null;
1473
+ if (!rootEl) return { ok: true, violations };
1474
+
1475
+ function nearestId(el: Element | null): string {
1476
+ let cur = el;
1477
+ while (cur) {
1478
+ if (cur.id) return cur.id;
1479
+ cur = cur.parentElement;
1480
+ }
1481
+ return '';
1482
+ }
1483
+
1484
+ const allElements: Element[] = [rootEl];
1485
+ if (typeof rootEl.querySelectorAll === 'function') {
1486
+ allElements.push(...Array.from(rootEl.querySelectorAll('*')));
1487
+ } else if ('children' in rootEl) {
1488
+ const stack: Element[] = [...Array.from(rootEl.children)];
1489
+ while (stack.length > 0) {
1490
+ const cur = stack.shift()!;
1491
+ allElements.push(cur);
1492
+ if (cur.children) stack.push(...Array.from(cur.children));
1493
+ }
1494
+ }
1495
+
1496
+ for (const el of allElements) {
1497
+ if (isExemptElement(el)) continue;
1498
+ const tag = el.tagName?.toUpperCase() ?? '';
1499
+ if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'PRE' || tag === 'TEXTAREA') continue;
1500
+ const id = nearestId(el);
1501
+ const cls = typeof el.className === 'string' ? el.className : '';
1502
+ for (const attr of ['title', 'aria-label', 'placeholder'] as const) {
1503
+ const val = el.getAttribute(attr);
1504
+ if (!val || !val.trim()) continue;
1505
+ const verdict = classifyKoreanDomString(val, { kind: attr, tag, id, cls });
1506
+ if (verdict !== 'ok') {
1507
+ violations.push({ kind: attr, reason: verdict, tag, id, text: val.replace(/\s+/g, ' ').trim() });
1508
+ }
1509
+ }
1510
+ }
1511
+
1512
+ function walkTextNodes(el: Element): void {
1513
+ if (isExemptElement(el)) return;
1514
+ const tag = el.tagName?.toUpperCase() ?? '';
1515
+ if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'PRE' || tag === 'TEXTAREA') return;
1516
+ if (tag === 'P' && el.classList?.contains('hint') && el.children.length > 0) {
1517
+ const txt = el.textContent ?? '';
1518
+ if (txt.trim()) {
1519
+ const id = nearestId(el);
1520
+ const cls = typeof el.className === 'string' ? el.className : '';
1521
+ const verdict = classifyKoreanDomString(txt, { kind: 'text', tag, id, cls });
1522
+ if (verdict !== 'ok') {
1523
+ violations.push({ kind: 'text', reason: verdict, tag, id, text: txt.replace(/\s+/g, ' ').trim() });
1524
+ }
1525
+ }
1526
+ return;
1527
+ }
1528
+ const id = nearestId(el);
1529
+ const cls = typeof el.className === 'string' ? el.className : '';
1530
+ for (const child of Array.from(el.childNodes ?? [])) {
1531
+ if (child.nodeType === 3) {
1532
+ const raw = child.nodeValue ?? '';
1533
+ if (!raw.trim()) continue;
1534
+ const verdict = classifyKoreanDomString(raw, { kind: 'text', tag, id, cls });
1535
+ if (verdict !== 'ok') {
1536
+ violations.push({ kind: 'text', reason: verdict, tag, id, text: raw.replace(/\s+/g, ' ').trim() });
1537
+ }
1538
+ } else if (child.nodeType === 1) {
1539
+ walkTextNodes(child as Element);
1540
+ }
1541
+ }
1542
+ }
1543
+
1544
+ walkTextNodes(rootEl);
1545
+
1546
+ return {
1547
+ ok: violations.length === 0,
1548
+ violations
1549
+ };
1550
+ }
@@ -58,7 +58,7 @@ export function copyPartIdentity(snapshot:SlotIdentitySnapshot,frame:PosedFrame,
58
58
  for(const row of frame.order){const identity=bySlot.get(row.slot);if(!identity||identity.reason!==null||identity.z!==row.z||row.z<=lastZ)throw new Error(`PART_IDENTITY_FRAME_MISMATCH: slot "${row.slot}" does not match held frame order`);lastZ=row.z;}
59
59
  // Identity-known slots need not have a visible primitive (zero alpha/empty
60
60
  // geometry/nonvisual setup). A known key is not a pixel or fit guarantee.
61
- return {generation:snapshot.generation,set:snapshot.set,skin:snapshot.skin,slots};
61
+ return {generation:snapshot.generation,set:snapshot.set,sets:[...snapshot.sets],skin:snapshot.skin,slots};
62
62
  }
63
63
  export function orderedParts(entries:readonly PartEntry[],frame:PosedFrame|null,identity:SlotIdentitySnapshot|null=null):PartEntry[]{
64
64
  const z=new Map(identity?.slots.map(row=>[row.slot,row.z])??frame?.order.map(row=>[row.slot,row.z])??[]),setup=new Map(entries.map((entry,i)=>[entry.slot,i]));
@@ -54,8 +54,10 @@ export function bindStageComments(host:Host):{refresh:()=>void;dispose:()=>void;
54
54
  const toggle=document.getElementById('stage-comment') as HTMLButtonElement;Object.assign(toggle.style,{whiteSpace:'nowrap',flex:'none'});
55
55
  const list=document.createElement('section');list.id='stage-comment-list';list.className='stage-comment-list stage-comment-ui';list.setAttribute('aria-label',t('Stage comments'));list.hidden=true;
56
56
  // An absolute overlay is not stage chrome: workspace measures stack children
57
- // to allocate Inspector height. Keep the list in its positioned main instead.
57
+ // to allocate Inspector height. Keep the list in its positioned main instead,
58
+ // anchored below the toolbar even when the bar wraps (#284).
58
59
  const workspace=host.toolbar.closest('main');if(workspace)workspace.append(list);else host.toolbar.after(list);
60
+ const placeList=()=>{const bar=host.toolbar.getBoundingClientRect?.(),parent=(workspace??host.toolbar).getBoundingClientRect?.();if(bar&&parent&&Number.isFinite(bar.bottom)&&Number.isFinite(parent.top)&&bar.bottom>parent.top){const topPx=`${Math.ceil(bar.bottom-parent.top)+5}px`;if(list.style.top!==topPx)list.style.top=topPx;}};
59
61
  const refusalNote=document.createElement('small');refusalNote.id='stage-comment-refusal';refusalNote.setAttribute('role','status');refusalNote.hidden=true;Object.assign(refusalNote.style,{position:'absolute',width:'1px',height:'1px',overflow:'hidden',clipPath:'inset(50%)',whiteSpace:'nowrap'});toggle.after(refusalNote);toggle.setAttribute('aria-describedby',refusalNote.id);toggle.setAttribute('aria-controls',list.id);toggle.setAttribute('aria-expanded','false');const originalTitle=toEn(toggle.title);
60
62
  const updateRefusal=()=>{const raw=host.refusal?.()??null,reason=raw?t(raw):null,prev=refusalNote.textContent||'',nextTitle=reason??t(originalTitle);toggle.disabled=false;if(toggle.title!==nextTitle)toggle.title=nextTitle;if(refusalNote.title!==(reason??''))refusalNote.title=reason??'';if(refusalNote.textContent!==(reason??''))refusalNote.textContent=reason??'';refusalNote.hidden=!reason;if(!list.hidden&&(reason??'')!==prev)renderList();return reason;};
61
63
  const layers=new Map<StageComment['viewport'],HTMLDivElement>();for(const [key,pane]of Object.entries(host.viewports)){const layer=document.createElement('div');layer.className='stage-comment-layer';pane!.append(layer);layers.set(key as StageComment['viewport'],layer);}
@@ -70,12 +72,12 @@ export function bindStageComments(host:Host):{refresh:()=>void;dispose:()=>void;
70
72
  if(host.shortcutBlocked?.()){host.error(t('COMMENT_BUSY: close the active editor or wait for the inspection to settle'));return;}
71
73
  const reason=updateRefusal();
72
74
  if(!reason&&host.blocked()){host.error(t('COMMENT_BUSY: close the active editor or wait for the inspection to settle'));return;}
73
- list.hidden=false;toggle.setAttribute('aria-expanded','true');renderList();
75
+ list.hidden=false;placeList();toggle.setAttribute('aria-expanded','true');renderList();
74
76
  if(reason){setCapture(false);host.error(reason);return;}
75
77
  setCapture(true);
76
78
  };
77
79
  const openComment=async(f:Feedback)=>{const mark=markOf(f);if(!mark)return;if(list.hidden)setOpen(true);if(list.hidden)return;if(await jump(f)){const reason=updateRefusal();setCapture(!reason&&!host.blocked());openComposer(mark.viewport,mark.screen,f,host.pose(mark.viewport)?.mode??mark.mode);}};
78
- const renderList=()=>{list.setAttribute('aria-label',t('Stage comments'));list.replaceChildren();const title=document.createElement('strong');title.textContent=t('Comments');list.append(title);const rawReason=host.refusal?.()??null,reason=rawReason?t(rawReason):null;if(reason){const note=document.createElement('small');note.className='stage-comment-refusal-note';note.title=reason;note.textContent=reason;Object.assign(note.style,{display:'block',marginTop:'4px',maxWidth:'100%',whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis'});list.append(note);}const all=host.feedback().filter(f=>markOf(f));toggle.textContent=t(`Comment · C (${all.length})`);if(!all.length){const empty=document.createElement('p');empty.textContent=t(reason?'Read only · Escape closes':'Mark a point or region, then type. Enter saves · Escape cancels.');list.append(empty);}for(const [i,f]of all.entries()){
80
+ const renderList=()=>{placeList();list.setAttribute('aria-label',t('Stage comments'));list.replaceChildren();const title=document.createElement('strong');title.textContent=t('Comments');list.append(title);const rawReason=host.refusal?.()??null,reason=rawReason?t(rawReason):null;if(reason){const note=document.createElement('small');note.className='stage-comment-refusal-note';note.title=reason;note.textContent=reason;Object.assign(note.style,{display:'block',marginTop:'4px',maxWidth:'100%',whiteSpace:'nowrap',overflow:'hidden',textOverflow:'ellipsis'});list.append(note);}const all=host.feedback().filter(f=>markOf(f));toggle.textContent=t(`Comment · C (${all.length})`);if(!all.length){const empty=document.createElement('p');empty.textContent=t(reason?'Read only · Escape closes':'Mark a point or region, then type. Enter saves · Escape cancels.');list.append(empty);}for(const [i,f]of all.entries()){
79
81
  const mark=markOf(f)!,row=document.createElement('div');row.className='stage-comment-item';row.dataset.commentId=f.id;
80
82
  const go=document.createElement('button');go.type='button';go.className='stage-comment-summary';go.textContent=`${i+1} · ${mark.mode.toUpperCase()} · ${mark.viewport.toUpperCase()} · ${mark.frame?`F${mark.frame.index} (${mark.frame.basis})`:t(feedbackTimingLabel(f))} · ${f.summary}`;go.onclick=()=>openComment(f);row.append(go);
81
83
  if(host.locked(f.id)){const submitted=document.createElement('span');submitted.textContent=t('Submitted');row.append(submitted);}
@@ -146,8 +148,9 @@ export function bindStageComments(host:Host):{refresh:()=>void;dispose:()=>void;
146
148
  disposers.push(()=>{pane!.removeEventListener('pointerdown',down,true);pane!.removeEventListener('pointermove',move,true);pane!.removeEventListener('pointerup',up,true);pane!.removeEventListener('pointercancel',abort,true);pane!.removeEventListener('lostpointercapture',abort,true);});
147
149
  }
148
150
  const key=(e:KeyboardEvent)=>{if(e.key==='Escape'&&(pending||composer||(enabled||!list.hidden)&&!host.shortcutBlocked?.()&&!textEntryFocused(e.target))){e.preventDefault();setOpen(false);return;}if(e.defaultPrevented||e.repeat||e.ctrlKey||e.metaKey||e.altKey||textEntryFocused(e.target)||host.shortcutBlocked?.())return;if(e.key.toLowerCase()==='c'){e.preventDefault();setOpen(list.hidden);}};
149
- window.addEventListener('blur',cancel);document.addEventListener('keydown',key);toggle.onclick=()=>setOpen(list.hidden);
150
- const renderPins=()=>{if(disposed)return;const refusal=updateRefusal();if(refusal&&(enabled||pending||composer&&!composerReadOnly)){cancel();setCapture(false);host.error(refusal);}const all=host.feedback().map(f=>({f,mark:markOf(f)})).filter(x=>x.mark);
151
+ window.addEventListener('blur',cancel);window.addEventListener('resize',placeList);document.addEventListener('keydown',key);toggle.onclick=()=>setOpen(list.hidden);
152
+ const ro=typeof ResizeObserver==='function'?new ResizeObserver(()=>{if(!disposed&&!list.hidden)placeList();}):null;if(ro){try{ro.observe(host.toolbar);if(workspace)ro.observe(workspace);}catch{}}
153
+ const renderPins=()=>{if(disposed)return;if(!list.hidden)placeList();const refusal=updateRefusal();if(refusal&&(enabled||pending||composer&&!composerReadOnly)){cancel();setCapture(false);host.error(refusal);}const all=host.feedback().map(f=>({f,mark:markOf(f)})).filter(x=>x.mark);
151
154
  const poses=new Map([...layers.keys()].map(view=>[view,host.pose(view)]));
152
155
  if(draftMark&&poses.get(draftMark.view)?.mode!==draftMark.mode||pending&&poses.get(pending.view)?.mode!==pending.mode)cancel();
153
156
  const signature=JSON.stringify([curLang(),refusal,all.map(({f,mark})=>[f.id,f.summary,mark!.mode,mark!.world]),[...poses].map(([view,p])=>[view,p?.mode,p?.animation,p?.frame,p?.timeBasis,p?.time,p?.turn,p?.camera,p?.referenceId,p?.referenceHash]),draftMark]);
@@ -157,5 +160,5 @@ export function bindStageComments(host:Host):{refresh:()=>void;dispose:()=>void;
157
160
  }if(draftMark)layers.get(draftMark.view)?.append(rectElement(draftMark.screen));}};
158
161
  const paint=()=>{if(disposed)return;renderPins();raf=requestAnimationFrame(paint);};
159
162
  const offLang=onLang(()=>{if(disposed)return;updateRefusal();renderList();syncComposerLang?.();last='';renderPins();});
160
- refresh();paint();return {active:()=>enabled,draft:()=>!!pending||!!composer&&!composerReadOnly,refresh,dispose:()=>{disposed=true;offLang();cancelAnimationFrame(raf);cancel();window.removeEventListener('blur',cancel);document.removeEventListener('keydown',key);for(const dispose of disposers)dispose();for(const layer of layers.values())layer.remove();list.remove();refusalNote.remove();}};
163
+ refresh();paint();return {active:()=>enabled,draft:()=>!!pending||!!composer&&!composerReadOnly,refresh,dispose:()=>{disposed=true;ro?.disconnect();offLang();cancelAnimationFrame(raf);cancel();window.removeEventListener('blur',cancel);window.removeEventListener('resize',placeList);document.removeEventListener('keydown',key);for(const dispose of disposers)dispose();for(const layer of layers.values())layer.remove();list.remove();refusalNote.remove();}};
161
164
  }
package/web/styles.css CHANGED
@@ -147,7 +147,7 @@ main{min-height:0;overflow:hidden;display:flex;flex-direction:column}
147
147
  .layer-toggle:has(input:focus-visible){outline:2px solid var(--rv-focus);outline-offset:2px}
148
148
  .layer-toggle kbd{font:10px var(--font-mono);padding:0 4px;border:1px solid var(--border-strong);border-radius:3px;color:var(--fg-muted)}
149
149
  /* View bar: layers, camera sync and zoom, then the View menu at the right end; wraps when the stage is narrow. */
150
- .viewbar{flex-wrap:wrap;justify-content:flex-start;gap:6px 8px;padding:8px 10px;min-width:0}
150
+ .viewbar{flex-wrap:wrap;justify-content:flex-start;gap:6px 8px;padding:8px 10px;min-width:0;anchor-name:--stage-comment-bar}
151
151
  .viewbar>.layer-toggles{flex:none}
152
152
  .viewbar .zoom-controls{flex:none}
153
153
  .view-menu{position:relative;margin-left:auto;flex:none;font-size:11px}
@@ -382,11 +382,11 @@ footer.status-bar{flex-wrap:nowrap}
382
382
  .turn-pad{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;padding:8px 12px}
383
383
  .turn-pad>span{color:var(--fg-muted);font-size:11px}
384
384
  .turn-pad label{display:flex;align-items:center;gap:5px;font-size:11px;white-space:nowrap}
385
- .turn-pad input[type=number]{width:78px;color:var(--fg);background:var(--rv-control);border:1px solid var(--border-strong);padding:4px}
386
- .turn-pad output{font-variant-numeric:tabular-nums;color:var(--fg-strong)}
385
+ .turn-pad input[type=number]{width:64px;color:var(--fg);background:var(--rv-control);border:1px solid var(--border-strong);padding:4px}
386
+ .turn-pad output{display:inline-block;font-family:var(--font-mono);font-variant-numeric:tabular-nums;text-align:right;color:var(--fg-strong)}
387
387
  .turn-pad button[aria-pressed=true]{border-color:var(--pass);color:var(--pass)}
388
388
  #turn-pad-host>p{margin:0 12px 6px}
389
389
 
390
390
  /* Source-bound stage comments; the layer never intercepts ordinary inspection. */
391
- main{position:relative}#stage-comment{white-space:nowrap;flex:none}#stage-comment-refusal{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.stage-comment-refusal-note{display:block;margin-top:4px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--fg-muted)}.stage-comment-mode{cursor:crosshair}.stage-comment-mode video{pointer-events:none}.stage-comment-layer{position:absolute;inset:0;pointer-events:none;z-index:20;overflow:hidden}.stage-comment-region{position:absolute;border:2px solid var(--link);pointer-events:none}.stage-comment-pin{position:absolute;transform:translate(-50%,-50%);border-radius:50%;min-width:26px;height:26px;padding:2px 5px;background:var(--link);color:var(--btn-fg);pointer-events:auto}.stage-comment-composer{position:absolute;z-index:30;width:286px;max-width:calc(100% - 8px);max-height:calc(100% - 8px);overflow:auto;overflow-wrap:anywhere;padding:10px;background:var(--rv-panel);border:1px solid var(--link);border-radius:6px;box-shadow:0 4px 20px var(--rv-backdrop)}.stage-comment-composer input{width:100%}.stage-comment-composer small{display:block;margin-top:6px;color:var(--fg-muted)}.stage-comment-composer p{color:var(--fail);margin:4px 0}.stage-comment-list{position:absolute;z-index:40;right:8px;top:55px;width:310px;max-width:90%;max-height:60%;overflow:auto;background:var(--rv-panel);border:1px solid var(--border-strong);padding:12px;border-radius:6px}.stage-comment-item{padding:8px 0;border-bottom:1px solid var(--border)}.stage-comment-item>button:first-child{display:block;width:100%;text-align:left;overflow-wrap:anywhere}.stage-comment-item span{display:block;color:var(--fg-muted)}
391
+ main{position:relative}.toolbar{anchor-name:--stage-comment-bar}#stage-comment{white-space:nowrap;flex:none}#stage-comment-refusal{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.stage-comment-refusal-note{display:block;margin-top:4px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--fg-muted)}.stage-comment-mode{cursor:crosshair}.stage-comment-mode video{pointer-events:none}.stage-comment-layer{position:absolute;inset:0;pointer-events:none;z-index:20;overflow:hidden}.stage-comment-region{position:absolute;border:2px solid var(--link);pointer-events:none}.stage-comment-pin{position:absolute;transform:translate(-50%,-50%);border-radius:50%;min-width:26px;height:26px;padding:2px 5px;background:var(--link);color:var(--btn-fg);pointer-events:auto}.stage-comment-composer{position:absolute;z-index:30;width:286px;max-width:calc(100% - 8px);max-height:calc(100% - 8px);overflow:auto;overflow-wrap:anywhere;padding:10px;background:var(--rv-panel);border:1px solid var(--link);border-radius:6px;box-shadow:0 4px 20px var(--rv-backdrop)}.stage-comment-composer input{width:100%}.stage-comment-composer small{display:block;margin-top:6px;color:var(--fg-muted)}.stage-comment-composer p{color:var(--fail);margin:4px 0}.stage-comment-list{position:absolute;position-anchor:--stage-comment-bar;z-index:40;right:8px;top:calc(anchor(bottom,50px) + 5px);width:310px;max-width:90%;max-height:60%;overflow:auto;background:var(--rv-panel);border:1px solid var(--border-strong);padding:12px;border-radius:6px}.stage-comment-item{padding:8px 0;border-bottom:1px solid var(--border)}.stage-comment-item>button:first-child{display:block;width:100%;text-align:left;overflow-wrap:anywhere}.stage-comment-item span{display:block;color:var(--fg-muted)}
392
392
  :root:lang(ko){word-break:keep-all;overflow-wrap:break-word}
package/web/turn-pad.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {TurnState,type TurnDial,type TurnSnapshot,type TurnAxis,pointerPosition} from '../src/turn-pad.ts';
1
+ import {TurnState,type TurnDial,type TurnSnapshot,type TurnAxis,pointerPosition,turnDialWidthCh,formatTurnValue} from '../src/turn-pad.ts';
2
2
  export interface TurnPad {state:TurnState;snapshot():TurnSnapshot;restore(value:unknown,redraw?:boolean):void;dispose():void}
3
3
  /** One pad owns the shared values. It never touches the model document or writes animation keys. */
4
4
  export function bindTurnPad(options:{host:HTMLElement;stages:HTMLElement[];dials:readonly TurnDial[];draw:(state:TurnState)=>void;save:()=>void;blocked?:()=>boolean;error:(text:string)=>void}):TurnPad|null {
@@ -10,9 +10,9 @@ export function bindTurnPad(options:{host:HTMLElement;stages:HTMLElement[];dials
10
10
  const reset=document.createElement('button');reset.type='button';reset.textContent='Reset 0';panel.append(reset);
11
11
  const smoothLabel=document.createElement('label'),smooth=document.createElement('input');smooth.type='checkbox';smooth.checked=true;smooth.setAttribute('aria-label','Turn smoothing');smoothLabel.append(smooth,' Smoothing ω₀ ');
12
12
  const omega=document.createElement('input');omega.type='number';omega.min='1';omega.max='100';omega.step='1';omega.value='20';omega.setAttribute('aria-label','Turn smoothing omega');smoothLabel.append(omega,' s⁻¹');panel.append(smoothLabel);
13
- const rows=new Map<TurnAxis,{number:HTMLInputElement;output:HTMLOutputElement;target:HTMLOutputElement}>();
14
- for(const d of dials){const label=document.createElement('label');label.textContent=`${d.axis} · ${d.bone} [${d.min}, ${d.max}] ${d.channel==='rotation'?'°':d.channel}`;const number=document.createElement('input');number.type='number';number.min=String(d.min);number.max=String(d.max);number.step='any';number.value='0';number.setAttribute('aria-label',`Turn ${d.axis} value`);label.title=d.provenance??'';const output=document.createElement('output');output.dataset.turnAxis=d.axis;output.setAttribute('aria-label',`Current ${d.axis}`);const target=document.createElement('output');target.dataset.turnTarget=d.axis;label.append(number,' Applied ',output,' · target ',target);panel.append(label);rows.set(d.axis,{number,output,target});number.onchange=()=>{try{if(!number.value.trim())throw new Error('TURN_VALUE_REQUIRED');state.exact(d.axis,Number(number.value));commit();}catch(error){options.error(String(error));render();}};}
15
- function render():void {hold.setAttribute('aria-pressed',String(state.held));smooth.checked=state.smoothing!==0;omega.disabled=!smooth.checked;if(state.smoothing)omega.value=String(state.smoothing);for(const [axis,row] of rows){const value=state.values[axis]!;row.output.value=String(Number(value.toFixed(6)));row.output.dataset.value=String(value);row.target.value=String(Number(state.targets[axis]!.toFixed(6)));if(document.activeElement!==row.number)row.number.value=String(state.targets[axis]);}}
13
+ const rows=new Map<TurnAxis,{dial:TurnDial;number:HTMLInputElement;output:HTMLOutputElement;target:HTMLOutputElement}>();
14
+ for(const d of dials){const label=document.createElement('label');label.textContent=`${d.axis} · ${d.bone} [${d.min}, ${d.max}] ${d.channel==='rotation'?'°':d.channel}`;const number=document.createElement('input');number.type='number';number.min=String(d.min);number.max=String(d.max);number.step='any';number.value='0';number.setAttribute('aria-label',`Turn ${d.axis} value`);label.title=d.provenance??'';const width=`${turnDialWidthCh(d)}ch`;const output=document.createElement('output');output.dataset.turnAxis=d.axis;output.style.width=width;output.style.minWidth=width;output.setAttribute('aria-label',`Current ${d.axis}`);const target=document.createElement('output');target.dataset.turnTarget=d.axis;target.style.width=width;target.style.minWidth=width;label.append(number,' Applied ',output,' · target ',target);panel.append(label);rows.set(d.axis,{dial:d,number,output,target});number.onchange=()=>{try{if(!number.value.trim())throw new Error('TURN_VALUE_REQUIRED');state.exact(d.axis,Number(number.value));commit();}catch(error){options.error(String(error));render();}};}
15
+ function render():void {hold.setAttribute('aria-pressed',String(state.held));smooth.checked=state.smoothing!==0;omega.disabled=!smooth.checked;if(state.smoothing)omega.value=String(state.smoothing);for(const [axis,row] of rows){const value=state.values[axis]!,targetValue=state.targets[axis]!;row.output.value=formatTurnValue(value,row.dial);row.output.dataset.value=String(value);row.target.value=formatTurnValue(targetValue,row.dial);row.target.dataset.value=String(targetValue);if(document.activeElement!==row.number)row.number.value=String(targetValue);}}
16
16
  let saveTimer:ReturnType<typeof setTimeout>|undefined;
17
17
  function commit():void {options.draw(state);render();if(saveTimer)clearTimeout(saveTimer);saveTimer=setTimeout(options.save,150);}
18
18
  hold.onclick=()=>{state.hold(!state.held);commit();};reset.onclick=()=>{state.reset();commit();};