rig-review 1.5.4 → 1.7.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.
@@ -0,0 +1,37 @@
1
+ /** Read-only embedding of the existing atlas inspector. No browser-supplied filesystem paths or verdict writes. */
2
+ import {readFile} from 'node:fs/promises';
3
+ import {appRoot,buildWeb} from './build.ts';
4
+ import type {ReviewPackage} from './manifest.ts';
5
+ import {loadPartsAtlas,assertPartsUnchanged,partsViewJson,servedImage} from './parts-view.ts';
6
+ import {serveReference,assertReviewUnchanged} from './reference.ts';
7
+ export function stagePartsRoutes(packages:{single:ReviewPackage}|{a:ReviewPackage;b:ReviewPackage},loadAtlas:typeof loadPartsAtlas=loadPartsAtlas) {
8
+ const loaded=new Map<string,ReturnType<typeof loadPartsAtlas>>();let bundle:Promise<Blob>|undefined;
9
+ const headers={'X-Content-Type-Options':'nosniff','Cache-Control':'no-store','Referrer-Policy':'no-referrer','Content-Security-Policy':"default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; connect-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'self'"};
10
+ return async(req:Request):Promise<Response|null>=>{
11
+ const url=new URL(req.url),path=url.pathname,read=req.method==='GET'||req.method==='HEAD';
12
+ if(!read)return null;
13
+ if(['/stage-parts.html','/parts.js','/parts.css'].includes(path)){
14
+ if(path==='/parts.js'){bundle??=buildWeb('parts');return new Response(req.method==='HEAD'?null:await bundle,{headers:{...headers,'Content-Type':'text/javascript'}});}
15
+ return new Response(req.method==='HEAD'?null:await readFile(appRoot+'web/'+(path==='/stage-parts.html'?'parts.html':'parts.css')),{headers:{...headers,'Content-Type':path.endsWith('.css')?'text/css':'text/html; charset=utf-8'}});
16
+ }
17
+ const match=('single' in packages?/^\/api\/stage-parts(?:\/(image|page)\/(\d+))?$/:/^\/api\/compare\/(a|b)\/stage-parts(?:\/(image|page)\/(\d+))?$/).exec(path);
18
+ if(!match)return null;
19
+ const key='single' in packages?'single':match[1] as 'a'|'b',p='single' in packages?packages.single:packages[key as 'a'|'b'];
20
+ const kind=match['single' in packages?1:2] as 'image'|'page'|undefined,index=match['single' in packages?2:3];
21
+ try{
22
+ let promise=loaded.get(key);
23
+ const initializing=!promise;
24
+ if(!promise){
25
+ // Publish only a promise whose resolved value has passed BOTH sides of loading.
26
+ // Keeping a rejected promise prevents an unchecked failed load becoming a usable pin.
27
+ promise=(async()=>{await assertReviewUnchanged(p);const pkg=await loadAtlas(p);await assertReviewUnchanged(p);await assertPartsUnchanged(pkg);return pkg;})();
28
+ loaded.set(key,promise);
29
+ }
30
+ const pkg=await promise;if(!pkg.pages.length||!pkg.items.length)throw new Error('Atlas regions unavailable');
31
+ if(!kind&&!initializing){await assertReviewUnchanged(p);await assertPartsUnchanged(pkg);}
32
+ if(kind){const model=pkg.files[0]!;await serveReference(new Request(req.url,{method:'HEAD'}),model.abs,model.sha256,headers);}
33
+ if(kind){const file=servedImage(pkg,kind,Number(index));if(!file)return Response.json({error:'PARTS_IMAGE_UNAVAILABLE'},{status:404,headers});const pinned=pkg.files.find(f=>f.abs===file);if(!pinned)throw new Error('Unbound atlas page');return await serveReference(req,file,pinned.sha256,headers);}
34
+ return Response.json({...partsViewJson(pkg,{verdict:null,stale:null}),readOnly:true,inspectionSourceHash:p.sourceHash},{headers});
35
+ }catch{return Response.json({error:'PARTS_ATLAS_UNAVAILABLE: the inspected package has no usable atlas or its source changed.'},{status:409,headers});}
36
+ };
37
+ }
@@ -1,7 +1,7 @@
1
1
  /** Fit-relative inspection cameras. Images and world geometry retain their own units. */
2
2
  export interface CameraPoint {x:number;y:number}
3
3
  export interface PaneCamera {zoom:number;center:CameraPoint|null}
4
- export interface CameraFrame {space:'image'|'world';center:CameraPoint;baseScale:number;width:number;height:number}
4
+ export interface CameraFrame {space:'image'|'world';center:CameraPoint;baseScale:number;width:number;height:number;fitScale?:number}
5
5
  export interface CameraSignature {zoom:number;pan:CameraPoint}
6
6
  export const clampZoom=(zoom:number):number=>Math.max(.25,Math.min(8,zoom));
7
7
  export function cameraFrame(space:CameraFrame['space'],box:{x:number;y:number;width:number;height:number},width:number,height:number,marginX=0,marginY=0):CameraFrame|null {
@@ -13,20 +13,21 @@ export function cameraSignature(camera:PaneCamera,frame:CameraFrame):CameraSigna
13
13
  return {zoom:camera.zoom,pan:{x:(frame.center.x-center.x)*scale/frame.width,y:(frame.space==='world'?center.y-frame.center.y:frame.center.y-center.y)*scale/frame.height}};
14
14
  }
15
15
  /** Match the closed numeric observation before a candidate can replace a live camera. */
16
- export function assertCameraView(camera:PaneCamera,frame:CameraFrame):void {
16
+ export function assertCameraView(camera:PaneCamera,frame:CameraFrame,range={min:.25,max:8}):void {
17
17
  const center=camera.center??frame.center,scale=frame.baseScale*camera.zoom,width=frame.width/scale,height=frame.height/scale;
18
18
  const coordinate=(value:number)=>Number.isFinite(value)&&Math.abs(value)<=Number.MAX_SAFE_INTEGER;
19
- if(![center.x,center.y,center.x-width/2,center.y-height/2,(frame.center.x-center.x)*scale,(frame.center.y-center.y)*scale].every(coordinate)||![width,height].every(value=>Number.isFinite(value)&&value>0&&value<=Number.MAX_SAFE_INTEGER)||!Number.isFinite(scale)||scale<=0||!Number.isFinite(camera.zoom)||camera.zoom<.25||camera.zoom>8||![frame.width,frame.height].every(value=>Number.isFinite(value)&&value>0&&value<=65536))throw new Error('VIEW_CAMERA_RANGE: derived camera exceeds numeric source-coordinate limits');
19
+ if(![center.x,center.y,center.x-width/2,center.y-height/2,(frame.center.x-center.x)*scale,(frame.center.y-center.y)*scale].every(coordinate)||![width,height].every(value=>Number.isFinite(value)&&value>0&&value<=Number.MAX_SAFE_INTEGER)||!Number.isFinite(scale)||scale<=0||!Number.isFinite(camera.zoom)||camera.zoom<range.min||camera.zoom>range.max||![frame.width,frame.height].every(value=>Number.isFinite(value)&&value>0&&value<=65536))throw new Error('VIEW_CAMERA_RANGE: derived camera exceeds numeric source-coordinate limits');
20
20
  }
21
- export function cameraFromSignature(value:CameraSignature,frame:CameraFrame):PaneCamera {
22
- if(![value.zoom,value.pan.x,value.pan.y].every(Number.isFinite)||value.zoom<.25||value.zoom>8)throw new Error('Camera signature requires finite pan and zoom 0.25..8');
21
+ export function cameraFromSignature(value:CameraSignature,frame:CameraFrame,range={min:.25,max:8}):PaneCamera {
22
+ if(![value.zoom,value.pan.x,value.pan.y].every(Number.isFinite)||value.zoom<range.min||value.zoom>range.max)throw new Error('Camera signature requires finite pan and zoom 0.25..8');
23
23
  const scale=frame.baseScale*value.zoom;
24
24
  const camera={zoom:value.zoom,center:{x:frame.center.x-value.pan.x*frame.width/scale,y:frame.center.y+(frame.space==='world'?1:-1)*value.pan.y*frame.height/scale}};
25
- assertCameraView(camera,frame);return camera;
25
+ assertCameraView(camera,frame,range);return camera;
26
26
  }
27
27
  /** Zoom preserves the point under the cursor when frame and point are given, or the viewport center otherwise. */
28
- export function zoomSignature(value:CameraSignature,factor:number,frame?:Pick<CameraFrame,'width'|'height'>|null,point?:CameraPoint|null):CameraSignature {
29
- const zoom=clampZoom(value.zoom*factor),ratio=zoom/value.zoom;
28
+ export function zoomSignature(value:CameraSignature,factor:number,frame?:Pick<CameraFrame,'width'|'height'>|null,point?:CameraPoint|null,range?:{min:number;max:number}):CameraSignature {
29
+ const candidate=value.zoom*factor;if(range&&(!Number.isFinite(candidate)||candidate<range.min||candidate>range.max))throw new Error('PARTS_CAMERA_RANGE: native zoom outside supported range');
30
+ const zoom=range?candidate:clampZoom(candidate),ratio=zoom/value.zoom;
30
31
  const ox=frame&&point&&frame.width>0&&Number.isFinite(point.x)?(point.x-frame.width/2)/frame.width*(ratio-1):0;
31
32
  const oy=frame&&point&&frame.height>0&&Number.isFinite(point.y)?(point.y-frame.height/2)/frame.height*(ratio-1):0;
32
33
  return {zoom,pan:{x:value.pan.x*ratio-ox,y:value.pan.y*ratio-oy}};
package/web/catalog-en.ts CHANGED
@@ -1,4 +1,19 @@
1
1
  export const enCatalog: Readonly<Record<string, string>> = {
2
+ "Atlas source build": "Atlas source build",
3
+ "1 Parts + mesh": "1 Parts + mesh",
4
+ "2 Interview": "2 Interview",
5
+ "3 Rig + animation": "3 Rig + animation",
6
+ "4 Direction": "4 Direction",
7
+ "Inspection stages": "Inspection stages",
8
+ "Open setup mesh instruments": "Open setup mesh instruments",
9
+ "Parts and atlas inspection": "Parts and atlas inspection",
10
+ "INTERVIEW_UNAVAILABLE: no interview consumer contract is installed.": "INTERVIEW_UNAVAILABLE: no interview consumer contract is installed.",
11
+ "DIRECTION_UNAVAILABLE: no direction inspection contract is installed.": "DIRECTION_UNAVAILABLE: no direction inspection contract is installed.",
12
+ "MODEL_UNAVAILABLE: no compiled model is supplied in this inspection.": "MODEL_UNAVAILABLE: no compiled model is supplied in this inspection.",
13
+ "Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.": "Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.",
14
+ "Embedded atlas inspection is read-only. Use the parts command for a separate sign-off.": "Embedded atlas inspection is read-only. Use the parts command for a separate sign-off.",
15
+ "PARTS_ATLAS_UNAVAILABLE: the inspected package has no usable atlas or its source changed.": "PARTS_ATLAS_UNAVAILABLE: the inspected package has no usable atlas or its source changed.",
16
+
2
17
  " (Apply's default pack flags)": " (Apply's default pack flags)",
3
18
  " (No playback reference · time display only)": " (No playback reference · time display only)",
4
19
  " (before this change)": " (before this change)",
@@ -3082,7 +3097,45 @@ export const enCatalog: Readonly<Record<string, string>> = {
3082
3097
  "{gate} {status} on {part}": "{gate} {status} on {part}",
3083
3098
  "Check line {path}": "Check line {path}",
3084
3099
  "Producer line": "Producer line",
3100
+ "Block {gate}: {status} · {part}": "Block {gate}: {status} · {part}",
3101
+ "{root} · 1 row": "{root} · 1 row",
3102
+ "{root} · {count} rows": "{root} · {count} rows",
3103
+ "mesh {mesh} · check {check}": "mesh {mesh} · check {check}",
3104
+ "mesh {mesh}": "mesh {mesh}",
3105
+ "check {check}": "check {check}",
3106
+ "Grouped by source and producer root; counts are rows, not a classification of defects.": "Grouped by source and producer root; counts are rows, not a classification of defects.",
3085
3107
  "Page {name}: {width}×{height} px, 1 region. The background shows through padding; a region box is the packer's, and pixels outside it are bleed.": "Page {name}: {width}×{height} px, 1 region. The background shows through padding; a region box is the packer's, and pixels outside it are bleed.",
3086
3108
  "Tinted: the footprint of the part drawn in front ({names}).": "Tinted: the footprint of the part drawn in front ({names}).",
3087
3109
  "The saved sign-off is for different producer flags; this review starts fresh.": "The saved sign-off is for different producer flags; this review starts fresh.",
3110
+ "mesh from rig.json UVs": "mesh from rig.json UVs",
3111
+ "Mesh geometry": "Mesh geometry",
3112
+ "not reported": "not reported",
3113
+ "Pink: art pixels outside every triangle.": "Pink: art pixels outside every triangle.",
3114
+ "Mesh outcome": "Mesh outcome",
3115
+ "Mesh note": "Mesh note",
3116
+ "1:1": "1:1",
3117
+ "Export issue": "Export issue",
3118
+ "PARTS_COMMENT_UNAVAILABLE: original part image required": "PARTS_COMMENT_UNAVAILABLE: original part image required",
3119
+ "PARTS_REFERENCE_UNAVAILABLE: supply --painting to compare the original painting": "PARTS_REFERENCE_UNAVAILABLE: supply --painting to compare the original painting",
3120
+ "PARTS_COMMENT_STALE_SOURCE: reopen the bound source": "PARTS_COMMENT_STALE_SOURCE: reopen the bound source",
3121
+ "PARTS_COMMENT_STALE_SOURCE: original PNG changed": "PARTS_COMMENT_STALE_SOURCE: original PNG changed",
3122
+ "PARTS_COMMENT_OUT_OF_BOUNDS: region exceeds original image": "PARTS_COMMENT_OUT_OF_BOUNDS: region exceeds original image",
3123
+ "PARTS_COMMENT_EMPTY: positive region required": "PARTS_COMMENT_EMPTY: positive region required",
3124
+ "PARTS_CAMERA_RANGE: native zoom outside {0}..{1}": "PARTS_CAMERA_RANGE: native zoom outside {0}..{1}",
3125
+ "PARTS_COMMENT_CROP_LIMIT: native crop exceeds 16 million pixels": "PARTS_COMMENT_CROP_LIMIT: native crop exceeds 16 million pixels",
3126
+ "Export JSON": "Export JSON",
3127
+ "PARTS_CAMERA_RANGE: native zoom outside supported range": "PARTS_CAMERA_RANGE: native zoom outside supported range",
3128
+ "Comments on this part: {count}": "Comments on this part: {count}",
3129
+ "COMMENT_CROP_STATE_UNAVAILABLE: stored crop cannot be read": "COMMENT_CROP_STATE_UNAVAILABLE: stored crop cannot be read",
3130
+ "PARTS_COMMENT_NATIVE_CROP_TAMPERED: native crop differs from bound original": "PARTS_COMMENT_NATIVE_CROP_TAMPERED: native crop differs from bound original",
3131
+ "PARTS_VERDICT_READ: saved verdict cannot be read": "PARTS_VERDICT_READ: saved verdict cannot be read",
3132
+ "PARTS_VERDICT_INVALID: saved verdict is not valid JSON": "PARTS_VERDICT_INVALID: saved verdict is not valid JSON",
3133
+ "PARTS_VERDICT_INVALID: saved verdict schema or binding is invalid": "PARTS_VERDICT_INVALID: saved verdict schema or binding is invalid",
3134
+ "PARTS_VERDICT_INVALID: saved verdict date is invalid": "PARTS_VERDICT_INVALID: saved verdict date is invalid",
3135
+ "Painting comparison": "Painting comparison",
3136
+ "Overlay": "Overlay",
3137
+ "Part opacity": "Part opacity",
3138
+ "PARTS_COMPARISON_UNAVAILABLE: original painting required": "PARTS_COMPARISON_UNAVAILABLE: original painting required",
3139
+ "PARTS_COMPARISON_INVALID: part/overlay mode and opacity 0..1 required": "PARTS_COMPARISON_INVALID: part/overlay mode and opacity 0..1 required",
3140
+ "PARTS_PAINT_FAILED: view could not be rendered; select the part to retry": "PARTS_PAINT_FAILED: view could not be rendered; select the part to retry",
3088
3141
  };
package/web/catalog-ko.ts CHANGED
@@ -1,4 +1,19 @@
1
1
  export const koCatalog: Readonly<Record<string, string>> = {
2
+ "Atlas source build": "아틀라스 소스 빌드",
3
+ "1 Parts + mesh": "1 파츠 + 메시",
4
+ "2 Interview": "2 인터뷰",
5
+ "3 Rig + animation": "3 리그 + 애니메이션",
6
+ "4 Direction": "4 연출",
7
+ "Inspection stages": "검사 단계",
8
+ "Open setup mesh instruments": "Setup 메시 도구 열기",
9
+ "Parts and atlas inspection": "파츠 및 아틀라스 검사",
10
+ "INTERVIEW_UNAVAILABLE: no interview consumer contract is installed.": "INTERVIEW_UNAVAILABLE: 인터뷰 소비자 계약이 설치되어 있지 않습니다.",
11
+ "DIRECTION_UNAVAILABLE: no direction inspection contract is installed.": "DIRECTION_UNAVAILABLE: 연출 검사 계약이 설치되어 있지 않습니다.",
12
+ "MODEL_UNAVAILABLE: no compiled model is supplied in this inspection.": "MODEL_UNAVAILABLE: 이 검사에 컴파일된 모델이 제공되지 않았습니다.",
13
+ "Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.": "검사 입력 패키지의 아틀라스 · 읽기 전용. 적용된 임시 빌드의 아틀라스, 리깅 전 파츠, 메시 승인, 초안 수정 기능은 이 화면에서 사용할 수 없습니다.",
14
+ "Embedded atlas inspection is read-only. Use the parts command for a separate sign-off.": "내장 아틀라스 검사는 읽기 전용입니다. 별도 승인은 parts 명령을 사용하세요.",
15
+ "PARTS_ATLAS_UNAVAILABLE: the inspected package has no usable atlas or its source changed.": "PARTS_ATLAS_UNAVAILABLE: 검사 패키지에 사용 가능한 아틀라스가 없거나 원본이 변경되었습니다.",
16
+
2
17
  " (Apply's default pack flags)": " (적용의 기본 패킹 플래그)",
3
18
  " (No playback reference · time display only)": " (재생 레퍼런스 없음 · 시간 표시 전용)",
4
19
  " (before this change)": " (이 변경 이전)",
@@ -3082,7 +3097,45 @@ export const koCatalog: Readonly<Record<string, string>> = {
3082
3097
  "{gate} {status} on {part}": "{part}에서 {gate} {status}",
3083
3098
  "Check line {path}": "체크 줄 {path}",
3084
3099
  "Producer line": "프로듀서 원문",
3100
+ "Block {gate}: {status} · {part}": "블록 {gate}: {status} · {part}",
3101
+ "{root} · 1 row": "{root} · 1행",
3102
+ "{root} · {count} rows": "{root} · {count}행",
3103
+ "mesh {mesh} · check {check}": "메시 {mesh} · 체크 {check}",
3104
+ "mesh {mesh}": "메시 {mesh}",
3105
+ "check {check}": "체크 {check}",
3106
+ "Grouped by source and producer root; counts are rows, not a classification of defects.": "출처와 프로듀서 루트별로 묶었습니다. 수치는 행 수이며 결함 분류가 아닙니다.",
3085
3107
  "Page {name}: {width}×{height} px, 1 region. The background shows through padding; a region box is the packer's, and pixels outside it are bleed.": "페이지 {name}: {width}×{height} px, 영역 1개. 패딩에는 배경이 비쳐 보이고, 영역 상자는 패커가 정한 것이며 상자 밖의 픽셀은 블리드입니다.",
3086
3108
  "Tinted: the footprint of the part drawn in front ({names}).": "색칠된 부분: 앞에 그려지는 파츠의 풋프린트({names}).",
3087
3109
  "The saved sign-off is for different producer flags; this review starts fresh.": "저장된 승인은 다른 프로듀서 플래그에 대해 내려진 것이라, 이번 검수는 처음부터 시작합니다.",
3110
+ "mesh from rig.json UVs": "rig.json UV로 계산한 메시",
3111
+ "Mesh geometry": "메시 형상",
3112
+ "not reported": "보고되지 않음",
3113
+ "Pink: art pixels outside every triangle.": "분홍색: 모든 삼각형 밖의 원화 픽셀.",
3114
+ "Mesh outcome": "메시 판정",
3115
+ "Mesh note": "메시 메모",
3116
+ "1:1": "1:1",
3117
+ "Export issue": "이슈 내보내기",
3118
+ "PARTS_COMMENT_UNAVAILABLE: original part image required": "PARTS_COMMENT_UNAVAILABLE: 원본 파트 이미지가 필요해요",
3119
+ "PARTS_REFERENCE_UNAVAILABLE: supply --painting to compare the original painting": "PARTS_REFERENCE_UNAVAILABLE: 원화 비교에는 --painting 입력이 필요해요",
3120
+ "PARTS_COMMENT_STALE_SOURCE: reopen the bound source": "PARTS_COMMENT_STALE_SOURCE: 연결된 원본을 다시 열어 주세요",
3121
+ "PARTS_COMMENT_STALE_SOURCE: original PNG changed": "PARTS_COMMENT_STALE_SOURCE: 원본 PNG가 변경됐어요",
3122
+ "PARTS_COMMENT_OUT_OF_BOUNDS: region exceeds original image": "PARTS_COMMENT_OUT_OF_BOUNDS: 영역이 원본 이미지 밖이에요",
3123
+ "PARTS_COMMENT_EMPTY: positive region required": "PARTS_COMMENT_EMPTY: 넓이가 있는 영역이 필요해요",
3124
+ "PARTS_CAMERA_RANGE: native zoom outside {0}..{1}": "PARTS_CAMERA_RANGE: 네이티브 배율이 {0}..{1} 범위 밖이에요",
3125
+ "PARTS_COMMENT_CROP_LIMIT: native crop exceeds 16 million pixels": "PARTS_COMMENT_CROP_LIMIT: 네이티브 크롭이 1,600만 픽셀을 넘어요",
3126
+ "Export JSON": "JSON 내보내기",
3127
+ "PARTS_CAMERA_RANGE: native zoom outside supported range": "PARTS_CAMERA_RANGE: 네이티브 배율이 지원 범위 밖이에요",
3128
+ "Comments on this part: {count}": "이 파트의 코멘트: {count}",
3129
+ "COMMENT_CROP_STATE_UNAVAILABLE: stored crop cannot be read": "COMMENT_CROP_STATE_UNAVAILABLE: 저장된 크롭을 읽을 수 없어요",
3130
+ "PARTS_COMMENT_NATIVE_CROP_TAMPERED: native crop differs from bound original": "PARTS_COMMENT_NATIVE_CROP_TAMPERED: 네이티브 크롭이 연결된 원본과 달라요",
3131
+ "PARTS_VERDICT_READ: saved verdict cannot be read": "PARTS_VERDICT_READ: 저장된 판정을 읽을 수 없어요",
3132
+ "PARTS_VERDICT_INVALID: saved verdict is not valid JSON": "PARTS_VERDICT_INVALID: 저장된 판정이 올바른 JSON이 아니에요",
3133
+ "PARTS_VERDICT_INVALID: saved verdict schema or binding is invalid": "PARTS_VERDICT_INVALID: 저장된 판정의 스키마나 원본 연결이 잘못됐어요",
3134
+ "PARTS_VERDICT_INVALID: saved verdict date is invalid": "PARTS_VERDICT_INVALID: 저장된 판정의 날짜가 잘못됐어요",
3135
+ "Painting comparison": "원화 비교",
3136
+ "Overlay": "오버레이",
3137
+ "Part opacity": "파츠 불투명도",
3138
+ "PARTS_COMPARISON_UNAVAILABLE: original painting required": "PARTS_COMPARISON_UNAVAILABLE: 원본 원화가 필요해요",
3139
+ "PARTS_COMPARISON_INVALID: part/overlay mode and opacity 0..1 required": "PARTS_COMPARISON_INVALID: 파트/오버레이 모드와 0..1 불투명도가 필요해요",
3140
+ "PARTS_PAINT_FAILED: view could not be rendered; select the part to retry": "PARTS_PAINT_FAILED: 화면을 그리지 못했어요. 파츠를 선택해 다시 시도해 주세요",
3088
3141
  };
package/web/compare.css CHANGED
@@ -276,3 +276,19 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
276
276
  .settings-toggle::before{content:"▾";font-size:10px;line-height:1}
277
277
  .settings-toggle[aria-expanded=true]::before{content:"▴"}
278
278
  :root:lang(ko){word-break:keep-all;overflow-wrap:break-word}
279
+
280
+ /* Stage navigation retains mounted inspection tools and their state. */
281
+ .review-stage-nav{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
282
+ .review-stage-nav button{font:inherit;white-space:nowrap;padding:5px 8px}
283
+ .review-stage-nav [aria-current="step"]{font-weight:700;text-decoration:underline;text-underline-offset:4px}
284
+ .review-stage-panel{position:fixed;inset:0;z-index:90;display:flex;flex-direction:column;padding:12px;background:var(--bg);color:inherit;overflow:auto}
285
+ .review-stage-panel[hidden]{display:none}
286
+ .review-stage-panel iframe{width:100%;flex:1;min-height:240px;border:0;background:var(--bg)}
287
+ .review-stage-panel iframe[hidden]{display:none}
288
+ .topbar,.pv-top{flex-wrap:wrap}
289
+
290
+ /* Setup/Animate/Compare are instruments within stage 3, never additional primary stages. */
291
+ :root[data-inspection-stage]:not([data-inspection-stage="3"]) .mode-switch{display:none}
292
+ :root[data-inspection-stage="1"] #mode-build-picker{display:flex!important}
293
+ :root[data-inspection-stage="1"] #mode-build-picker>.eyebrow{display:none}
294
+ :root[data-inspection-stage="2"] #mode-build-picker,:root[data-inspection-stage="4"] #mode-build-picker{display:none!important}
package/web/compare.html CHANGED
@@ -1,7 +1,7 @@
1
1
  <!doctype html>
2
2
  <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>rig review · compare</title><link rel="stylesheet" href="styles.css"></head><body>
3
- <header><div class="brand">rig review <span>COMPARE</span></div><div><h1 id="title">A / B comparison</h1><span id="animation" class="hint"></span></div><div class="mode-switch" role="group" aria-label="Mode"><button type="button" data-mode="rig" aria-pressed="false">Setup</button><button type="button" data-mode="playback" aria-pressed="false">Animate</button><button type="button" data-mode="compare" aria-pressed="true">Compare</button></div><div id="mode-build-picker" class="mode-build-picker" role="group" aria-label="Picked build for Setup and Animate" hidden><span class="eyebrow">Editing</span><button type="button" data-build-side="a" aria-pressed="true">Build A</button><button type="button" data-build-side="b" aria-pressed="false">Build B</button><span id="picked-build-label" class="picked-build-label" role="status" aria-live="polite">Build A</span></div><div class="actions"><span id="save-state" class="hint">Loading…</span><button id="export-json">Feedback JSON</button><button id="export-markdown">Issue Markdown</button><button id="submit" class="primary" disabled>Submit review</button></div></header>
3
+ <header><div class="brand">rig review <span>COMPARE</span></div><div><h1 id="title">A / B comparison</h1><span id="animation" class="hint"></span></div><div class="mode-switch" role="group" aria-label="Mode"><button type="button" data-mode="rig" aria-pressed="false">Setup</button><button type="button" data-mode="playback" aria-pressed="false">Animate</button><button type="button" data-mode="compare" aria-pressed="true">Compare</button></div><div id="mode-build-picker" class="mode-build-picker" role="group" aria-label="Picked build for Setup and Animate" hidden><span class="eyebrow">Editing</span><button type="button" data-build-side="a" aria-pressed="true">Build A</button><button type="button" data-build-side="b" aria-pressed="false">Build B</button><span id="picked-build-label" class="picked-build-label" role="status" aria-live="polite">Build A</span></div><div class="actions"><span id="save-state" class="hint">Loading…</span><button id="export-json">Feedback JSON</button><button id="export-markdown">Issue Markdown</button><button id="submit" class="primary" disabled>Submit review</button></div><nav data-stage-nav class="review-stage-nav" aria-label="Inspection stages"></nav></header>
4
4
  <div class="layout"><main><div class="toolbar"><button id="stage-comment" type="button" aria-pressed="false" aria-expanded="false" aria-controls="stage-comment-list" title="Comment · C (active mesh editor keeps C)">Comment · C (0)</button><span id="toolbar-mode-hint">Inspect A and B at the reference video time</span><!-- shared:view-tools --><div class="row"><label class="camera-sync"><input id="camera-sync" type="checkbox" checked>Sync cameras</label><button id="zoom-out" aria-label="Zoom active view out">−</button><output id="zoom-label">100%</output><button id="zoom-in" aria-label="Zoom active view in">+</button><button id="fit">Fit synchronized views</button></div></div><!-- shared:stage-bars -->
5
5
  <div id="stage-layout" class="stages"><section id="reference-pane" class="pane"><div class="pane-head"><strong>REFERENCE</strong><span id="reference-name"></span></div><div id="reference-viewport" class="reference-viewport"><video id="reference-video" preload="auto" playsinline muted></video><p id="reference-empty" class="empty">Loading reference video…</p></div><div class="pane-foot"><span id="reference-time">— s</span><label><input id="reference-audio" type="checkbox">Video audio</label></div></section><section id="a-pane" class="pane"><div class="pane-head"><strong class="side-label">A</strong><span id="a-title"></span></div><div id="a-viewport" class="rig-viewport"><div id="a-root" class="rig-root"></div><canvas id="a-overlay" class="rig-overlay" aria-label="A actual rig mesh and bone overlay"></canvas><!-- shared:stage-handles --><p id="a-empty" class="empty">Loading rig…</p></div><div class="pane-foot"><span id="a-time">— s</span><span id="a-frame">rate unknown</span><span id="a-renderer" aria-label="A last draw backend" title="DOM images for rigid parts; WebGL meshes when available, Canvas2D fallback.">Not rendered</span></div></section><section id="b-pane" class="pane"><div class="pane-head"><strong class="side-label">B</strong><span id="b-title"></span></div><div id="b-viewport" class="rig-viewport"><div id="b-root" class="rig-root"></div><canvas id="b-overlay" class="rig-overlay" aria-label="B actual rig mesh and bone overlay"></canvas><p id="b-empty" class="empty">Loading rig…</p></div><div class="pane-foot"><span id="b-time">— s</span><span id="b-frame">rate unknown</span><span id="b-renderer" aria-label="B last draw backend" title="DOM images for rigid parts; WebGL meshes when available, Canvas2D fallback.">Not rendered</span></div></section></div>
6
- <section class="inspector" aria-label="Inspection controls"><div class="inspector-heading"><strong>INSPECTOR</strong><div role="tablist" aria-label="Inspector sections"><button role="tab" id="tab-view" data-inspector="view" aria-controls="inspector-view" aria-selected="true" tabindex="0">View</button><button role="tab" id="tab-rig" data-inspector="rig" aria-controls="inspector-rig" aria-selected="false" tabindex="-1">Rig</button><button role="tab" id="tab-playback" data-inspector="playback" aria-controls="inspector-playback" aria-selected="false" tabindex="-1">Playback</button><button role="tab" id="tab-feedback" data-inspector="feedback" aria-controls="inspector-feedback" aria-selected="false" tabindex="-1">Feedback</button></div><span class="hint">Local view controls · source files stay unchanged</span></div><div class="draft-notice"><span id="draft-state" role="status" aria-live="polite"></span><div id="draft-recovery"></div></div><div class="inspector-body"><!-- shared:applied-records --><section id="inspector-view" role="tabpanel" aria-labelledby="tab-view" data-inspector-panel="view"><div class="view-link-controls"><button id="copy-view" type="button">Copy view link</button><span class="hint">Numeric source region · opening this link restores a paused inspection</span></div><pre id="view-coordinates" class="numeric-view" aria-label="Current numeric inspection region"></pre><div class="inspection-controls" aria-label="Inspection display controls"><label>Appearance <select id="appearance"><option value="system">System</option><option value="dark">Dark</option><option value="light">Light</option></select></label><label><input id="idle-repeat" type="checkbox" checked>Repeat idle</label><span id="idle-state" class="hint" role="status">Idle preview unavailable</span><span id="control-state" class="hint" role="status"></span></div><p class="hint">Sync cameras links fit-relative zoom and viewport-relative pan across visible panes. Turn it off for independent Reference, A and B views. Toolbar zoom and Fit use the last active pane.</p></section><section id="inspector-rig" role="tabpanel" aria-labelledby="tab-rig" data-inspector-panel="rig" hidden><!-- shared:setup-block-row --><section id="selected-part" role="tabpanel" aria-labelledby="block-tab-selected-part" aria-label="Selected part" aria-live="polite"></section><div class="rig-layer-controls"><fieldset id="layer-controls"><legend>Rig layers</legend><label><input id="layer-images" type="checkbox" checked disabled>Images</label><label><input id="layer-mesh" type="checkbox" disabled>Mesh edges</label><label><input id="layer-bones" type="checkbox" disabled>Bone points</label></fieldset><span id="layer-state" class="hint">No rig supplied</span></div><p id="rig-inspector-hint" class="hint">These controls show actual images, last-drawn mesh edges and named bone points. Both builds use the fixed animation named above. This inspector does not author geometry or motion.</p><!-- shared:setup-panels --></section><section id="inspector-playback" role="tabpanel" aria-labelledby="tab-playback" data-inspector-panel="playback" hidden><div id="animation-dock" class="animation-dock-panel" role="region" aria-label="Animation timeline"><section id="transport" class="transport"><button id="play" aria-label="Play reference video and both rigs" disabled>▶</button><input id="scrub" type="range" min="0" max="1" step="0.0001" value="0" aria-label="Shared comparison time" disabled><output id="time">— / — s</output><label for="time-input" class="sr-only">Reference video time to inspect</label><input id="time-input" type="number" min="0" step="0.0001" placeholder="Seconds" disabled><button id="seek" disabled>Go to time</button><!-- shared:transport-strips --></section><section id="animation-inspection" aria-label="Read-only animation inspection"></section></div><div id="animate-blocks" class="animate-blocks-panel" data-inspector-scroll><!-- shared:animate-block-row --><div class="compare-info"><output id="sync-status">Presentation pending</output><span id="sync-warning"></span></div><div class="compare-info"><label for="frame-basis">Review frame</label><select id="frame-basis"><option value="a">A explicit samples</option><option value="b">B explicit samples</option></select><input id="frame-input" type="number" min="0" step="1" aria-label="Explicit producer frame" disabled><button id="frame-seek" type="button" disabled>Inspect frame</button><span id="frame-index-status">Loading reference timestamp index…</span></div><div class="compare-info"><span id="domain">Checking shared playback range…</span><span id="clock-source">Waiting for video time</span></div><details class="trace"><summary>Synchronization trace</summary><pre id="trace">No frame presented yet.</pre></details><p id="playback-inspector-hint" class="boundary">Motion is read only. The reference video FPS is not used to infer the pose frame clock.</p><!-- shared:animate-panels --></div></section><section id="inspector-feedback" role="tabpanel" aria-labelledby="tab-feedback" data-inspector-panel="feedback" hidden><div class="review-summary"><div class="eyebrow">COMPARE REVIEW</div><label for="status">Review status</label><select id="status"><option value="pending">Pending</option><option value="approved">Approved</option><option value="changes-requested">Changes requested</option></select><section class="provenance"><h2>Source provenance</h2><div id="provenance-brief"></div><details><summary>Both builds, versions and reference video hash</summary><pre id="provenance-full"></pre></details></section></div><section class="feedback-form"><h2>Frame-range feedback</h2><label for="side">Target build</label><select id="side"><option value="">Select A or B</option><option value="a">A</option><option value="b">B</option></select><div class="frame-range"><label>Start frame<input id="frame-start" type="number" min="0" step="1" inputmode="numeric"></label><label>End frame<input id="frame-end" type="number" min="0" step="1" inputmode="numeric"></label></div><p id="feedback-range-hint" class="hint">Select A or B to check frame bounds.</p><label for="target-kind">Target type</label><select id="target-kind"><option value="">Select</option><option value="bone">Bone</option><option value="slot">Slot</option><option value="rig">Entire rig</option></select><label for="target-name">Actual target name</label><input id="target-name" type="text" list="target-names" autocomplete="off"><datalist id="target-names"></datalist><p id="target-hint" class="hint">Select a target build and type.</p><label for="category">Category</label><select id="category"><option value="">Select</option><option value="defect">Defect</option><option value="quality">Quality</option></select><label for="summary">One-line summary</label><input id="summary" type="text" maxlength="1000" placeholder="What looks wrong, and over which frames?"><button id="add-feedback" class="block" disabled>Add feedback</button><p id="feedback-warnings" class="hint" role="status" hidden></p><div id="feedback-list"></div></section><details id="strip-panel" class="trace"><summary>Export frame strip</summary><p class="hint">Uses the feedback form start and end frames, inclusive. Exports Reference / A / B rows without changing inspection time.</p><label for="strip-scope">Export range</label><select id="strip-scope"><option value="interval">Entered start–end frames</option><option value="feedback">All feedback ranges</option></select><label for="strip-basis">Report defining the range frames</label><select id="strip-basis"><option value="">Select A or B as frame basis</option><option value="a">A report frameTimes</option><option value="b">B report frameTimes</option></select><label for="strip-format">Format</label><select id="strip-format"><option value="png">PNG strip</option><option value="json">JSON frames and provenance</option></select><p class="hint">The same frame number in A and B is not assumed to mean the same time. Batch export uses each feedback side as its frame basis. Without frameTimes, PNG is refused and JSON preserves time: null.</p><button id="strip-export" type="button" disabled>Download strip</button><p id="strip-status" class="hint" role="status" aria-live="polite">Loading comparison provenance…</p></details></section></div></section></main><aside id="parts-explorer" class="parts-explorer" aria-label="Parts explorer"><div class="parts-tools"><h2>PARTS</h2><button type="button" data-part-whole aria-pressed="true">Whole rig</button><label for="part-search">Find slot</label><input id="part-search" data-part-search type="search" autocomplete="off" placeholder="Exact slot name or text"><label class="part-solo"><input id="part-solo" data-part-solo type="checkbox" disabled>Solo selected slot</label><p data-part-status class="hint" role="status">Loading actual slots…</p></div><ul data-part-list aria-label="Actual rig slots"></ul><p class="hint">Select in context or enable Solo. Thumbnails are each slot's declared page region; a type icon stands in where the model declares none. Atlas pages are not part thumbnails.</p></aside>
6
+ <section class="inspector" aria-label="Inspection controls"><div class="inspector-heading"><strong>INSPECTOR</strong><div role="tablist" aria-label="Inspector sections"><button role="tab" id="tab-view" data-inspector="view" aria-controls="inspector-view" aria-selected="true" tabindex="0">View</button><button role="tab" id="tab-rig" data-inspector="rig" aria-controls="inspector-rig" aria-selected="false" tabindex="-1">Rig</button><button role="tab" id="tab-playback" data-inspector="playback" aria-controls="inspector-playback" aria-selected="false" tabindex="-1">Playback</button><button role="tab" id="tab-feedback" data-inspector="feedback" aria-controls="inspector-feedback" aria-selected="false" tabindex="-1">Feedback</button></div><span class="hint">Local view controls · source files stay unchanged</span></div><div class="draft-notice"><span id="draft-state" role="status" aria-live="polite"></span><div id="draft-recovery"></div></div><div class="inspector-body"><!-- shared:applied-records --><section id="inspector-view" role="tabpanel" aria-labelledby="tab-view" data-inspector-panel="view"><div class="view-link-controls"><button id="copy-view" type="button">Copy view link</button><span class="hint">Numeric source region · opening this link restores a paused inspection</span></div><pre id="view-coordinates" class="numeric-view" aria-label="Current numeric inspection region"></pre><div class="inspection-controls" aria-label="Inspection display controls"><label>Appearance <select id="appearance"><option value="system">System</option><option value="dark">Dark</option><option value="light">Light</option></select></label><label><input id="idle-repeat" type="checkbox" checked>Repeat idle</label><span id="idle-state" class="hint" role="status">Idle preview unavailable</span><span id="control-state" class="hint" role="status"></span></div><p class="hint">Sync cameras links fit-relative zoom and viewport-relative pan across visible panes. Turn it off for independent Reference, A and B views. Toolbar zoom and Fit use the last active pane.</p></section><section id="inspector-rig" role="tabpanel" aria-labelledby="tab-rig" data-inspector-panel="rig" hidden><!-- shared:setup-block-row --><section id="selected-part" role="tabpanel" aria-labelledby="block-tab-selected-part" aria-label="Selected part" aria-live="polite"></section><div class="rig-layer-controls"><fieldset id="layer-controls"><legend>Rig layers</legend><label><input id="layer-images" type="checkbox" checked disabled>Images</label><label><input id="layer-mesh" type="checkbox" disabled>Mesh edges</label><label><input id="layer-bones" type="checkbox" disabled>Bone points</label></fieldset><span id="layer-state" class="hint">No rig supplied</span></div><p id="rig-inspector-hint" class="hint">These controls show actual images, last-drawn mesh edges and named bone points. Both builds use the fixed animation named above. This inspector does not author geometry or motion.</p><!-- shared:setup-panels --></section><section id="inspector-playback" role="tabpanel" aria-labelledby="tab-playback" data-inspector-panel="playback" hidden><div id="animation-dock" class="animation-dock-panel" role="region" aria-label="Animation timeline"><section id="transport" class="transport"><button id="play" aria-label="Play reference video and both rigs" disabled>▶</button><input id="scrub" type="range" min="0" max="1" step="0.0001" value="0" aria-label="Shared comparison time" disabled><output id="time">— / — s</output><label for="time-input" class="sr-only">Reference video time to inspect</label><input id="time-input" type="number" min="0" step="0.0001" placeholder="Seconds" disabled><button id="seek" disabled>Go to time</button><!-- shared:transport-strips --></section><section id="animation-inspection" aria-label="Read-only animation inspection"></section></div><div id="animate-blocks" class="animate-blocks-panel" data-inspector-scroll><!-- shared:animate-block-row --><section id="compare-transport-context"><div class="compare-info"><output id="sync-status">Presentation pending</output><span id="sync-warning"></span></div><div class="compare-info"><label for="frame-basis">Review frame</label><select id="frame-basis"><option value="a">A explicit samples</option><option value="b">B explicit samples</option></select><input id="frame-input" type="number" min="0" step="1" aria-label="Explicit producer frame" disabled><button id="frame-seek" type="button" disabled>Inspect frame</button><span id="frame-index-status">Loading reference timestamp index…</span></div><div class="compare-info"><span id="domain">Checking shared playback range…</span><span id="clock-source">Waiting for video time</span></div><details class="trace"><summary>Synchronization trace</summary><pre id="trace">No frame presented yet.</pre></details><p id="playback-inspector-hint" class="boundary">Motion is read only. The reference video FPS is not used to infer the pose frame clock.</p></section><!-- shared:animate-panels --></div></section><section id="inspector-feedback" role="tabpanel" aria-labelledby="tab-feedback" data-inspector-panel="feedback" hidden><div class="review-summary"><div class="eyebrow">COMPARE REVIEW</div><label for="status">Review status</label><select id="status"><option value="pending">Pending</option><option value="approved">Approved</option><option value="changes-requested">Changes requested</option></select><section class="provenance"><h2>Source provenance</h2><div id="provenance-brief"></div><details><summary>Both builds, versions and reference video hash</summary><pre id="provenance-full"></pre></details></section></div><section class="feedback-form"><h2>Frame-range feedback</h2><label for="side">Target build</label><select id="side"><option value="">Select A or B</option><option value="a">A</option><option value="b">B</option></select><div class="frame-range"><label>Start frame<input id="frame-start" type="number" min="0" step="1" inputmode="numeric"></label><label>End frame<input id="frame-end" type="number" min="0" step="1" inputmode="numeric"></label></div><p id="feedback-range-hint" class="hint">Select A or B to check frame bounds.</p><label for="target-kind">Target type</label><select id="target-kind"><option value="">Select</option><option value="bone">Bone</option><option value="slot">Slot</option><option value="rig">Entire rig</option></select><label for="target-name">Actual target name</label><input id="target-name" type="text" list="target-names" autocomplete="off"><datalist id="target-names"></datalist><p id="target-hint" class="hint">Select a target build and type.</p><label for="category">Category</label><select id="category"><option value="">Select</option><option value="defect">Defect</option><option value="quality">Quality</option></select><label for="summary">One-line summary</label><input id="summary" type="text" maxlength="1000" placeholder="What looks wrong, and over which frames?"><button id="add-feedback" class="block" disabled>Add feedback</button><p id="feedback-warnings" class="hint" role="status" hidden></p><div id="feedback-list"></div></section><details id="strip-panel" class="trace"><summary>Export frame strip</summary><p class="hint">Uses the feedback form start and end frames, inclusive. Exports Reference / A / B rows without changing inspection time.</p><label for="strip-scope">Export range</label><select id="strip-scope"><option value="interval">Entered start–end frames</option><option value="feedback">All feedback ranges</option></select><label for="strip-basis">Report defining the range frames</label><select id="strip-basis"><option value="">Select A or B as frame basis</option><option value="a">A report frameTimes</option><option value="b">B report frameTimes</option></select><label for="strip-format">Format</label><select id="strip-format"><option value="png">PNG strip</option><option value="json">JSON frames and provenance</option></select><p class="hint">The same frame number in A and B is not assumed to mean the same time. Batch export uses each feedback side as its frame basis. Without frameTimes, PNG is refused and JSON preserves time: null.</p><button id="strip-export" type="button" disabled>Download strip</button><p id="strip-status" class="hint" role="status" aria-live="polite">Loading comparison provenance…</p></details></section></div></section></main><aside id="parts-explorer" class="parts-explorer" aria-label="Parts explorer"><div class="parts-tools"><h2>PARTS</h2><button type="button" data-part-whole aria-pressed="true">Whole rig</button><label for="part-search">Find slot</label><input id="part-search" data-part-search type="search" autocomplete="off" placeholder="Exact slot name or text"><label class="part-solo"><input id="part-solo" data-part-solo type="checkbox" disabled>Solo selected slot</label><p data-part-status class="hint" role="status">Loading actual slots…</p></div><ul data-part-list aria-label="Actual rig slots"></ul><p class="hint">Select in context or enable Solo. Thumbnails are each slot's declared page region; a type icon stands in where the model declares none. Atlas pages are not part thumbnails.</p></aside>
7
7
  </div><footer><span id="message" role="status" aria-live="polite">Loading comparison provenance from the server…</span><span>Source files remain unchanged.</span></footer><script type="module" src="main.js"></script></body></html>
package/web/compare.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import {bindStageNav} from './stage-nav.ts';
1
2
  import {requireFeedbackFrames} from '../src/stage-comment.ts';
2
3
  import {bindStageComments,type CommentPose} from './stage-comments.ts';
3
4
  import {sharedTurnDials,type TurnDial} from '../src/turn-pad.ts';
@@ -432,7 +433,9 @@ function bind(): void {
432
433
  input('idle-repeat').onchange=()=>{renderIdle();if(canRepeatIdle())void playComparison().catch(error=>message(describe(error),true));};
433
434
  el('inspector-feedback').addEventListener('focusin',()=>{idleHeld=true;const current=lastPresented?.time;stop();if(current!==undefined&&!seeking)void seekTo(current);});
434
435
  bindInspector();
436
+ const transportBlock=document.querySelector<HTMLElement>('#animate-blocks [data-block-target="motion-tools"]');if(transportBlock)transportBlock.dataset.blockIncludes=[transportBlock.dataset.blockIncludes,'compare-transport-context'].filter(Boolean).join(' ');
435
437
  pickedTools=mountComparePickedTools({data:()=>data,readOnly:()=>readOnly,players,assets,rigScales,layers,parts:()=>parts,time:()=>trace?.reference??presentation.snapshot().lastDrawn?.reference??0,duration:()=>domain?.end??0,playing:()=>!video.paused,pause:()=>{idleHeld=true;stop();},seekTo:seconds=>seekTo(seconds),api,route:access.route,swapSideRig,redrawOverlays,fit,syncLayout:()=>{renderPairLayout();const mode=pickedTools?.mode()??'compare',picked=pickedTools?.pickedSide()??'a';if(mode!=='compare'&&activeCamera!=='reference'&&activeCamera!==picked)activeCamera=picked;fit();},saveDraft:()=>{persistence?.save();},message,download,turnAdjustFor:side=>turnAdjusts[side]??null,syncFeedbackSide:side=>{if(select('side').value!==side&&!input('summary').value.trim()){select('side').value=side;renderFeedbackSelection();}}});
438
+ viewDisposers.push(bindStageNav({model:true,side:()=>pickedTools?.pickedSide()??'a',setup:()=>pickedTools?.setMode('setup')}));
436
439
  document.addEventListener('visibilitychange',()=>{if(document.hidden){suspendedPreview=!video.paused;stop();}else if(suspendedPreview&&!idleHeld){suspendedPreview=false;void playComparison().catch(error=>message(describe(error),true));}});
437
440
  const observer = new ResizeObserver(fit); observer.observe(el('a-viewport')); observer.observe(el('b-viewport'));observer.observe(el('reference-viewport'));
438
441
  window.addEventListener('beforeunload', event => { if (dirty) { event.preventDefault(); event.returnValue = ''; } });