rig-review 2.7.0 → 2.7.1

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.
@@ -75,6 +75,7 @@ export class PartInspection {
75
75
  register(side:ControlPart['side'],entries:PartEntry[],player:PartPlayer){this.refused.delete(side);this.sides.set(side,{entries,player,frame:null,identity:null});}
76
76
  /** The catalog for this side failed to load or hash: the rig still draws, the side offers no parts. */
77
77
  refuseCatalog(side:ControlPart['side'],error:unknown):void {this.sides.delete(side);this.refused.set(side,partRefusal(error,true));}
78
+ clear(side:ControlPart['side']):void {this.sides.delete(side);this.refused.delete(side);if(this.selected?.side===side)this.selected=null;}
78
79
  refusal(side:ControlPart['side']):PartRefusal|null {return this.refused.get(side)??null;}
79
80
  /** A selection on a refused side is retained for recovery but never exposed, drawn Solo or targeted. */
80
81
  protected live():ControlPart|null {const part=this.selected;return part&&!this.refused.has(part.side)?part:null;}
@@ -114,6 +115,7 @@ export class PartExplorer extends PartInspection {
114
115
  private get search(){return this.host.querySelector<HTMLInputElement>('[data-part-search]')!;}private get list(){return this.host.querySelector<HTMLElement>('[data-part-list]')!;}private get solo(){return this.host.querySelector<HTMLInputElement>('[data-part-solo]')!;}private get whole(){return this.host.querySelector<HTMLButtonElement>('[data-part-whole]')!;}
115
116
  register(side:ControlPart['side'],entries:PartEntry[],player:PartPlayer,thumbnails?:PartThumbnailSource){super.register(side,entries,player);if(thumbnails)this.thumbnails.set(side,thumbnails);else this.thumbnails.delete(side);this.renderList();}
116
117
  refuseCatalog(side:ControlPart['side'],error:unknown):void {super.refuseCatalog(side,error);this.renderList();this.renderDetail();}
118
+ clear(side:ControlPart['side']):void {super.clear(side);this.thumbnails.delete(side);this.renderList();this.renderDetail();}
117
119
  select(value:ControlPart|null):void {const previous=this.value();super.select(value);this.renderSelection();this.renderDetail();this.changed(previous);}
118
120
  setVisibleSide(side:ControlPart['side']|null):void {if(this.visibleSide===side)return;this.visibleSide=side;this.renderList();this.renderDetail();}
119
121
  setStatusHint(text:string|null):void {if(this.statusHint===text)return;this.statusHint=text;this.detailKey='';this.renderDetail();}
package/web/parts.ts CHANGED
@@ -580,7 +580,25 @@ async function restoreStageParts(saved:StagePartsState):Promise<void>{
580
580
  }
581
581
  if(typeof window!=='undefined')window.addEventListener('message',event=>{if(event.source===parent&&event.origin===location.origin&&event.data?.type==='review-stage-restore'&&event.data.state)void restoreStageParts(event.data.state);});
582
582
 
583
- if(typeof window!=='undefined')window.addEventListener('message',event=>{if(event.source!==parent||event.origin!==location.origin||event.data?.type!=='review-stage-revalidate')return;void (async()=>{
584
- try{const response=await fetch(access.route(partsApi),{headers:stageHeaders()}),data=await response.json() as ViewData&{error?:string};if(!response.ok||data.sourceHash!==state.data?.sourceHash)throw new Error(data.error??'STAGE_DRAFT_MISMATCH: separated parts and draft mesh identity differ.');if(event.data.state)await restoreStageParts(event.data.state);}
585
- catch(error){document.querySelector<HTMLElement>('.pv-verdict')!.hidden=true;if(state.data)delete state.data.joinedVerdictBinding;const status=$('pv-load');status.hidden=false;status.dataset.result='refused';status.textContent=t(error instanceof Error?error.message:String(error));document.querySelector<HTMLElement>('.pv-layout')!.hidden=true;}
586
- })();});
583
+ async function revalidateStageParts(nextBuild?:string,savedState?:StagePartsState|null):Promise<void>{
584
+ const targetBuild=nextBuild==='inspected'||(typeof nextBuild==='string'&&/^[a-f0-9]{64}$/.test(nextBuild))?nextBuild:stageBuild;
585
+ try{
586
+ const headers=access.headers(stageEmbedded?{'X-Review-Stage-Build':targetBuild}:{});
587
+ const response=await fetch(access.route(partsApi),{headers}),data=await response.json() as ViewData&{error?:string};
588
+ const sameBuild=targetBuild===stageBuild&&(data.draft?.buildId??targetBuild)===(state.data?.draft?.buildId??stageBuild);
589
+ const validBuild=sameBuild?data.sourceHash===state.data?.sourceHash:Boolean(data.inspectionSourceHash&&data.inspectionSourceHash===state.data?.inspectionSourceHash&&data.draft?.buildId===targetBuild);
590
+ if(!response.ok||!validBuild)throw new Error(data.error??'STAGE_DRAFT_MISMATCH: separated parts and draft mesh identity differ.');
591
+ stageBuild=targetBuild;state.data=data;
592
+ if(stageEmbedded){
593
+ document.querySelector<HTMLElement>('.pv-verdict')!.hidden=!data.joinedVerdictBinding;
594
+ const status=$('pv-load');status.textContent=data.verdictReadOnlyReason?t(data.verdictReadOnlyReason):'';status.hidden=status.textContent==='';delete status.dataset.result;
595
+ }
596
+ if(savedState)await restoreStageParts(savedState);else if(!sameBuild){select(state.selected);await paint();}
597
+ renderCorrections();
598
+ }catch(error){
599
+ document.querySelector<HTMLElement>('.pv-verdict')!.hidden=true;if(state.data)delete state.data.joinedVerdictBinding;
600
+ const status=$('pv-load');status.hidden=false;status.dataset.result='refused';status.textContent=t(error instanceof Error?error.message:String(error));
601
+ document.querySelector<HTMLElement>('.pv-layout')!.hidden=true;
602
+ }
603
+ }
604
+ if(typeof window!=='undefined')window.addEventListener('message',event=>{if(event.source!==parent||event.origin!==location.origin||event.data?.type!=='review-stage-revalidate')return;void revalidateStageParts(event.data.buildId,event.data.state);});
@@ -25,7 +25,8 @@ export interface HandoffView {how:'declared'|'discovered';via:string;outside:boo
25
25
  export interface BaselineView {status:'running'|'reproduced'|'not-reproduced'|'refused'|'failed';firstDifference:string|null;hashes:{baseline:{rigJson:string|null;tree:string};inspected:{rigJson:string|null;tree:string}}|null;line:string;wallMs:number|null}
26
26
  export interface RetargetStatusView {available:boolean;reason:string|null;producer:{package:string;version:string}|null;compiler:{package:string;version:string}|null;rig:string|null;sequences:{id:string;label:string;path:string;cleaned:boolean;frames:number;people:string[]}[];bones:string[];animations:string[]}
27
27
  export type AnimationSourceView=import('../src/rebuild.ts').AnimationSourceStatus;
28
- export interface RebuildStatusView {retarget?:RetargetStatusView;animations?:AnimationSourceView|null;available:boolean;viewOnly?:boolean;handoff:HandoffView|null;baseline:BaselineView|null;inputs:{config:string;parts:string|null;rig:string|null;configHash:string}|null;parts:{name:string;regions:unknown[]}[];contour:Record<string,Record<string,unknown>>;meshes?:Record<string,unknown>;constraints?:unknown[]|null;bones?:unknown[]|null;fields?:Record<string,unknown>|null;cuts?:{config:Record<string,unknown>;build:string|null}|null;inspectedCheck?:InspectedCheckView|null;idle?:import('../src/idle-tracks.ts').IdleStatus|null;cloth?:ClothStatusView|null;producer:{package:string;version:string}|null;compiler:{package:string;version:string}|null;reason:string|null}
28
+ export interface DraftStatusView {id:string;kind:'draft-rig';at:string;producer:{name:string;version:string};editable:boolean;config:{path:string;sha256:string};config_inputs?:{path:string;sha256:string}[];parts:{path:string;files:{path:string;sha256:string}[]};files:{path:string;sha256:string}[]}
29
+ export interface RebuildStatusView {retarget?:RetargetStatusView;animations?:AnimationSourceView|null;available:boolean;viewOnly?:boolean;handoff:HandoffView|null;draft?:DraftStatusView|null;baseline:BaselineView|null;inputs:{config:string;parts:string|null;rig:string|null;configHash:string}|null;parts:{name:string;regions:unknown[]}[];contour:Record<string,Record<string,unknown>>;meshes?:Record<string,unknown>;constraints?:unknown[]|null;bones?:unknown[]|null;fields?:Record<string,unknown>|null;cuts?:{config:Record<string,unknown>;build:string|null}|null;inspectedCheck?:InspectedCheckView|null;idle?:import('../src/idle-tracks.ts').IdleStatus|null;cloth?:ClothStatusView|null;producer:{package:string;version:string}|null;compiler:{package:string;version:string}|null;reason:string|null}
29
30
  /** #111: the cloth recipe form's status — the reader's tags, the recipes as written, each tag's parts and chains, the keypoints, the route and why Apply cannot run. */
30
31
  export interface ClothStatusView {targets:string[];targetsRead:boolean;recipes:Record<string,unknown>|null;tags:import('../src/cloth-recipe.ts').ClothTagView[];keypoints:{path:string;sha256:string}|null;route:'build'|'rig';reason:string|null}
31
32
  export interface RebuildJobView {stageInputHash?:string;files?:FilesDiff|null;remesh?:import('../src/mesh-entry.ts').RemeshCounts|null;check?:CheckSummary|null;id:string;status:'running'|'built'|'refused'|'failed';reused:boolean;lines:string[];producerLine:string|null;hint?:string;exitCode:number|null;wallMs:{remesh:number|null;compile:number|null};build:{modelUrl:string;modelHash:string;files:Record<string,string>}|null;request:{part:string;regions:RegionEntry[];configHash:string;entrySha256:string;bust?:BustSpec};producer:{package:string;version:string};compiler:{package:string;version:string}}
@@ -219,6 +220,7 @@ export interface PatchJobView {stageInputHash?:string;id:string;kind:'patch';op?
219
220
  export interface PatchRequestBody {patch:ConfigPatch;environment?:import('../src/environment-schedule.ts').EnvironmentSchedule}
220
221
  /** Edit Mesh's delta Apply (#135): `remesh --delta`, the per-file diff and the part's counts; remesh's own gate holds check. */
221
222
  export interface DeltaJobView {stageInputHash?:string;check?:CheckSummary|null;id:string;kind:'delta';op:'remesh';status:'running'|'built'|'refused'|'failed';reused:boolean;lines:string[];producerLine:string|null;hint?:string;exitCode:number|null;wallMs:{op:number|null;compile:number|null};files:FilesDiff|null;remesh:import('../src/mesh-entry.ts').RemeshCounts&{modelTriangles:number|null}|null;build:{modelUrl:string;modelHash:string;files:Record<string,string>}|null;request:{part:string;delta:Record<string,unknown>;deltaSha256:string;configHash:string};producer:{package:string;version:string};compiler:{package:string;version:string}}
223
+ export const MESH_DELTA_APPLIED_SOURCE = 'MESH_DELTA_APPLIED_SOURCE: Edit Mesh starts from the inspected draft. Export the delta and rebuild the prior revision (including any Mesh Parameters patch) first.';
222
224
  /** `{part, delta, configHash}`: the server owns every path and flag; the delta is the editor's export as it stands. */
223
225
  export interface DeltaRequestBody {part:string;delta:import('../src/mesh-edit.ts').MeshEditDocument;configHash:string}
224
226
  /** A retarget Apply's job (#114): clean, retarget, compile; every FAIL line of the step that refused, verbatim; the listed lines. */
@@ -350,7 +352,17 @@ export function outcomeLine(result:RebuildJobView|RebuildRefusal):{text:string;e
350
352
  * outside the opened folder when it is the `../config.json` beside an opened out/), its path and hash, then the
351
353
  * baseline. Without a handoff it is the refusal naming where it was looked for and how to declare it.
352
354
  */
353
- export function handoffText(status:Pick<RebuildStatusView,'handoff'|'baseline'|'reason'|'viewOnly'>):{text:string;error:boolean} {
355
+ export function handoffText(status:Pick<RebuildStatusView,'handoff'|'draft'|'baseline'|'reason'|'viewOnly'>&Partial<Pick<RebuildStatusView,'producer'|'compiler'>>):{text:string;error:boolean} {
356
+ const d=status.draft;
357
+ if(d){
358
+ const reason=status.reason&&status.reason!==NO_CONTOUR_CODE?status.reason:null;
359
+ const installed=status.producer&&status.compiler?` · installed ${status.producer.package} ${status.producer.version} · ${status.compiler.package} ${status.compiler.version}`:'';
360
+ const tail=reason?`${installed} · ${reason}`:installed;
361
+ return {
362
+ text:`Draft ${d.id} (${d.producer.name} ${d.producer.version}): ${d.config.path} sha256 ${d.config.sha256.slice(0,12)}… · parts ${d.parts.path}${tail}`,
363
+ error:!d.editable||Boolean(reason),
364
+ };
365
+ }
354
366
  const h=status.handoff;
355
367
  if(!h)return status.viewOnly?{text:status.reason??'view only, no producer handoff',error:false}:{text:status.reason??'MODELING_HANDOFF_MISSING',error:true};
356
368
  const how=h.how==='declared'?`declared (${h.via})`:h.outside?'discovered outside the opened folder':'discovered';
package/web/stage-nav.ts CHANGED
@@ -32,7 +32,7 @@ function stageFrameRoute(access:InstanceAccess,path:'/stage-parts.html'|'/stage-
32
32
  if(access.base==='/'&&/^[a-f0-9]{64}$/.test(access.key))query.set('handoff',access.key);
33
33
  return access.route(path)+'?'+query;
34
34
  }
35
- export function bindStageNav(options:{preRig?:boolean;interviewOnly?:boolean;interview?:boolean;access?:InstanceAccess;partsOnly?:boolean;model:boolean;direction?:(active:boolean)=>void;side?:()=> 'a'|'b';setup?:()=>void;draftBuild?:()=>string;correction?:(request:{part:string;sourceHash:string;buildId:string;instrument:string})=>Promise<void>}):()=>void {
35
+ export function bindStageNav(options:{preRig?:boolean;interviewOnly?:boolean;interview?:boolean;access?:InstanceAccess;partsOnly?:boolean;model:boolean;direction?:(active:boolean)=>void;side?:()=> 'a'|'b';setup?:()=>void;draftBuild?:()=>string;refresh?:(fn:()=>void)=>void;correction?:(request:{part:string;sourceHash:string;buildId:string;instrument:string})=>Promise<void>}):()=>void {
36
36
  const host=document.querySelector<HTMLElement>('[data-stage-nav]');if(!host)return ()=>{};
37
37
  if(options.interviewOnly){
38
38
  const button=document.createElement('button');button.type='button';button.dataset.reviewStage='2';button.setAttribute('aria-current','step');host.append(button);
@@ -53,17 +53,23 @@ export function bindStageNav(options:{preRig?:boolean;interviewOnly?:boolean;int
53
53
  button,disabled:Boolean(button.disabled),title:attr(button,'title'),pressed:attr(button,'aria-pressed'),selected:attr(button,'aria-selected'),
54
54
  }));
55
55
  const pickerState=sourcePicker?{hidden:Boolean(sourcePicker.hidden),label:attr(sourcePicker,'aria-label')}:null;
56
- const frames=new Map<string,HTMLIFrameElement>();let lastFrame:HTMLIFrameElement|null=null;let current:ReviewStage=(options.partsOnly||options.preRig)?1:3;
56
+ const frames=new Map<string,HTMLIFrameElement>();let lastFrame:HTMLIFrameElement|null=null;let current:ReviewStage=(options.partsOnly||options.preRig)?1:3;let correctionActive=false;
57
57
  const workspace=document.querySelector<HTMLElement>(options.partsOnly?'.pv-layout':'.layout');const wasInert=workspace?.inert??false;
58
58
  const reasonFor=(stage:ReviewStage)=>stageReason(stage,options.model,!!options.direction,!!options.interview,options.preRig);
59
- const buttons=reviewStages.map((label,index)=>{const button=document.createElement('button');button.type='button';button.dataset.reviewStage=String(index+1);button.onclick=()=>show(index+1 as ReviewStage);host.append(button);return button;});
59
+ const activeReason=(stage:ReviewStage)=>stage===3&&correctionActive?null:reasonFor(stage);
60
+ const buttons=reviewStages.map((label,index)=>{const button=document.createElement('button');button.type='button';button.dataset.reviewStage=String(index+1);button.onclick=()=>{if(index+1===3)correctionActive=false;show(index+1 as ReviewStage);};host.append(button);return button;});
60
61
  const mesh=document.createElement('button');mesh.type='button';mesh.onclick=()=>{if(reasonFor(3))return;show(3);options.setup?.();};panel.append(mesh);
61
62
  const syncRigControls=()=>{
62
- const rigReason=reasonFor(3),refused=Boolean(reasonFor(current));
63
+ const rigReason=activeReason(3),refused=Boolean(activeReason(current));
63
64
  if(refused)document.documentElement.dataset.stageRefused='true';else delete document.documentElement.dataset.stageRefused;
64
65
  for(const item of modeSwitches)item.el.hidden=current!==3||Boolean(rigReason)?true:item.hidden;
65
66
  if(sourcePicker&&pickerState&&rigReason&&current===3)sourcePicker.hidden=true;
66
- if(!rigReason)return;
67
+ if(!rigReason){
68
+ for(const item of modeControls){
69
+ item.button.disabled=item.disabled;item.button.title=item.title??'';setOrRemove(item.button,'title',item.title);
70
+ }
71
+ return;
72
+ }
67
73
  const reasonText=t(rigReason);
68
74
  for(const item of modeControls){
69
75
  item.button.disabled=true;item.button.title=reasonText;item.button.setAttribute('title',reasonText);
@@ -96,9 +102,10 @@ export function bindStageNav(options:{preRig?:boolean;interviewOnly?:boolean;int
96
102
  }
97
103
  }
98
104
  function show(stage:ReviewStage):void {
99
- current=stage;document.documentElement.dataset.inspectionStage=String(stage);render();place();const reason=reasonFor(stage);const revision=++entry;interviewError=null;
105
+ if(stage!==3)correctionActive=false;
106
+ current=stage;document.documentElement.dataset.inspectionStage=String(stage);render();place();const reason=activeReason(stage);const revision=++entry;interviewError=null;
100
107
  options.direction?.(stage===4);
101
- panel.hidden=!reason&&(stage===(options.partsOnly?1:3)||stage===4)&&!options.preRig;
108
+ panel.hidden=!reason&&(stage===(options.partsOnly?1:3)||stage===4)&&(!options.preRig||(stage===3&&correctionActive));
102
109
  if(workspace)workspace.inert=!panel.hidden||wasInert;
103
110
  status.textContent=reason?t(reason):stage===1&&!options.partsOnly?t(options.correction||options.preRig?'Draft rig · structure evidence only':'Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.'):'';mesh.hidden=stage!==1||Boolean(reasonFor(3))||!!options.partsOnly;
104
111
  for(const frame of frames.values())frame.hidden=true;
@@ -108,21 +115,22 @@ export function bindStageNav(options:{preRig?:boolean;interviewOnly?:boolean;int
108
115
  if(stage===2&&!reason){status.textContent=t('interview.loading');void showInterview(revision);}
109
116
  }
110
117
  function showParts(){
111
- const saved=(lastFrame?.contentWindow as StagePartsWindow|null)?.rigReviewStageParts?.snapshot()??null;const side=options.side?.(),key=(side??'single')+':'+(options.draftBuild?.()??'inspected');let frame=frames.get(key);if(!frame){if(options.correction){for(const old of frames.values())old.remove();frames.clear();}frame=document.createElement('iframe');frame.title=t('Parts and atlas inspection');frame.src=stageFrameRoute(access,'/stage-parts.html',side);frame.addEventListener('load',()=>{frame!.contentWindow?.postMessage({type:'review-stage-language',language:getLanguage()},location.origin);frame!.contentWindow?.postMessage({type:'review-stage-source',buildId:options.draftBuild?.()??'inspected',state:saved},location.origin);});frames.set(key,frame);panel.append(frame);}else if(options.correction||options.preRig){frame.contentWindow?.postMessage({type:'review-stage-revalidate',state:lastFrame!==frame?saved:null},location.origin);}frame.hidden=false;lastFrame=frame;
118
+ const saved=(lastFrame?.contentWindow as StagePartsWindow|null)?.rigReviewStageParts?.snapshot()??null;const side=options.side?.(),buildId=options.draftBuild?.()??'inspected',key=(side??'single')+':'+buildId;let frame=frames.get(key);if(!frame){if(options.correction){for(const old of frames.values())old.remove();frames.clear();}frame=document.createElement('iframe');frame.title=t('Parts and atlas inspection');frame.src=stageFrameRoute(access,'/stage-parts.html',side);frame.addEventListener('load',()=>{frame!.contentWindow?.postMessage({type:'review-stage-language',language:getLanguage()},location.origin);frame!.contentWindow?.postMessage({type:'review-stage-source',buildId,state:saved},location.origin);});frames.set(key,frame);panel.append(frame);}else if(options.correction||options.preRig){frame.contentWindow?.postMessage({type:'review-stage-revalidate',buildId,state:lastFrame!==frame?saved:null},location.origin);}frame.hidden=false;lastFrame=frame;
112
119
  }
113
- const correction=async(event:MessageEvent)=>{if(event.origin!==location.origin||![...frames.values()].some(f=>f.contentWindow===event.source)||event.data?.type!=='review-stage-correction'||!options.correction)return;const r=event.data;if(typeof r.part!=='string'||typeof r.sourceHash!=='string'||typeof r.buildId!=='string'||!['chest','mesh','delta'].includes(r.instrument))return;try{await options.correction(r);show(3);}catch(error){status.textContent=error instanceof Error?error.message:String(error);}};
120
+ options.refresh?.(()=>{if(current===1&&!options.partsOnly)showParts();});
121
+ const correction=async(event:MessageEvent)=>{if(event.origin!==location.origin||![...frames.values()].some(f=>f.contentWindow===event.source)||event.data?.type!=='review-stage-correction'||!options.correction)return;const r=event.data;if(typeof r.part!=='string'||typeof r.sourceHash!=='string'||typeof r.buildId!=='string'||!['chest','mesh','delta'].includes(r.instrument))return;const prev=correctionActive;correctionActive=true;syncRigControls();try{await options.correction(r);show(3);}catch(error){correctionActive=prev;syncRigControls();status.textContent=error instanceof Error?error.message:String(error);}};
114
122
  window.addEventListener('message',correction);
115
123
  // Legacy Setup/Animate/Compare selectors keep their IDs, payloads and behavior.
116
- const legacy=(event?:Event)=>{if(reasonFor(3)){event?.preventDefault?.();event?.stopImmediatePropagation?.();syncRigControls();return;}show(3);};
124
+ const legacy=(event?:Event)=>{if(activeReason(3)){event?.preventDefault?.();event?.stopImmediatePropagation?.();syncRigControls();return;}show(3);};
117
125
  modeControls.forEach(({button})=>button.addEventListener('click',legacy,true));
118
126
  // A side choice reuses the canonical closed A/B picker, then reveals that side's retained atlas.
119
127
  let pickingSource=false;
120
128
  const sourceChanged=()=>{if(current!==1)return;pickingSource=true;show(1);queueMicrotask(()=>{pickingSource=false;});};
121
129
  sourcePicker?.querySelectorAll('[data-build-side]').forEach(button=>button.addEventListener('click',sourceChanged));
122
130
  // Legacy bookmark/control restoration writes these canonical attributes even when a mode is unchanged.
123
- const canonical=new MutationObserver(()=>{if(reasonFor(3)){syncRigControls();return;}if(current!==3&&!options.partsOnly&&!options.preRig&&!pickingSource)show(3);});
131
+ const canonical=new MutationObserver(()=>{if(activeReason(3)){syncRigControls();return;}if(current!==3&&!options.partsOnly&&!options.preRig&&!pickingSource)show(3);});
124
132
  document.querySelectorAll('[data-inspector]').forEach(button=>canonical.observe(button,{attributes:true,attributeFilter:['aria-selected','aria-pressed']}));
125
- const language=onLanguageChange(()=>{render();if(!panel.hidden)status.textContent=t(reasonFor(current)??(current===2?(interviewError??(interview&&!interview.hidden?'':'interview.loading')):current===1&&(options.correction||options.preRig)?'Draft rig · structure evidence only':current===1?'Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.':''));for(const f of frames.values()){f.title=t('Parts and atlas inspection');setFrameLanguage(f);}if(interview){interview.title=t('interview.title');setFrameLanguage(interview);}});
133
+ const language=onLanguageChange(()=>{render();if(!panel.hidden)status.textContent=t(activeReason(current)??(current===2?(interviewError??(interview&&!interview.hidden?'':'interview.loading')):current===1&&(options.correction||options.preRig)?'Draft rig · structure evidence only':current===1?'Atlas inspection, read only — inspected package. Applied scratch atlas, pre-rig parts, mesh sign-off and draft corrections are unavailable here.':''));for(const f of frames.values()){f.title=t('Parts and atlas inspection');setFrameLanguage(f);}if(interview){interview.title=t('interview.title');setFrameLanguage(interview);}});
126
134
  window.addEventListener('resize',place);show(current);
127
135
  return ()=>{entry++;window.removeEventListener('message',correction);language();canonical.disconnect();sourcePicker?.querySelectorAll('[data-build-side]').forEach(button=>button.removeEventListener('click',sourceChanged));delete document.documentElement.dataset.inspectionStage;delete document.documentElement.dataset.stageRefused;for(const item of modeSwitches)item.el.hidden=item.hidden;if(sourcePicker&&pickerState){sourcePicker.hidden=pickerState.hidden;setOrRemove(sourcePicker,'aria-label',pickerState.label);}if(reasonFor(3))for(const item of modeControls){item.button.disabled=item.disabled;item.button.title=item.title??'';setOrRemove(item.button,'title',item.title);setOrRemove(item.button,'aria-pressed',item.pressed);setOrRemove(item.button,'aria-selected',item.selected);}if(workspace)workspace.inert=wasInert;buttons.forEach(b=>b.remove());panel.remove();window.removeEventListener('resize',place);modeControls.forEach(({button})=>button.removeEventListener('click',legacy,true));};
128
136
  }