@rig-c/review 2.13.0 → 4.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/README.md +1 -1
- package/docs/PARTS_VIEW.md +1 -1
- package/docs/REVIEW_PACKAGE.md +32 -91
- package/docs/STABILITY.md +27 -194
- package/docs/WORKFLOWS.md +0 -107
- package/package.json +1 -1
- package/skills/rig-review/SKILL.md +11 -25
- package/src/build.ts +2 -2
- package/src/direction-inspection.ts +6 -2
- package/src/front.ts +4 -193
- package/src/interview-scene.ts +3 -3
- package/src/job-act.ts +1 -35
- package/src/job-api.ts +27 -19
- package/src/job-cli.ts +3 -3
- package/src/job-contract.ts +14 -50
- package/src/job-front.ts +17 -44
- package/src/job-host.ts +1 -4
- package/src/job-session.ts +22 -10
- package/src/job-source.ts +3 -17
- package/src/job-store.ts +80 -6
- package/src/job-worker.ts +1 -47
- package/src/manifest.ts +23 -4
- package/src/open.ts +2 -3
- package/src/scene-inspection.ts +50 -0
- package/src/server.ts +1 -1
- package/web/catalog-en.ts +37 -27
- package/web/catalog-ko.ts +37 -27
- package/web/compare.css +0 -4
- package/web/direction-panel.ts +22 -6
- package/web/inspector-blocks.ts +8 -4
- package/web/job-rig-capture.ts +62 -12
- package/web/job-rig-screen.ts +75 -55
- package/web/job-session.ts +89 -1091
- package/web/main.ts +113 -56
- package/web/parts-viewport-provider.ts +8 -3
- package/web/retained-frame-stage.ts +7 -7
- package/web/rig-host.ts +5 -3
- package/web/rig-viewport-provider.ts +2 -0
- package/web/scene-plates.ts +57 -4
- package/web/styles.css +12 -82
- package/web/viewport-capture.ts +12 -2
- package/web/workspace-ui.ts +5 -6
- package/src/front-worker.ts +0 -2
- package/src/job-hub.ts +0 -304
- package/src/job-image-set.ts +0 -73
- package/web/job-hub.ts +0 -160
package/web/main.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import {bindScenePlates,loadScenePlates,takeSample} from './scene-plates.ts';
|
|
2
|
+
import type {SceneInspection} from '../src/scene-inspection.ts';
|
|
1
3
|
import type {InterviewSubjectEntry} from '../src/joined-project.ts';
|
|
2
|
-
import {joinedInterviewForms} from './job-session.ts';
|
|
4
|
+
import {mountJobScreen,joinedInterviewForms,mediaReady,jobSubmissionRefusal} from './job-session.ts';
|
|
3
5
|
import {partsIssueComments,parsePartsIssue,assertPartsIssueBinding} from '../src/parts-comment.ts';
|
|
4
6
|
import type {JobForm} from './job-session.ts';
|
|
5
7
|
import {bindWorkspaceDrawer} from './workspace-layout.ts';
|
|
@@ -9,7 +11,7 @@ import {rigWorkspaceMarkup,rigFeedbackMarkup,sharedViewToolsMarkup,sharedComment
|
|
|
9
11
|
import {bindDirectionPanel} from './direction-panel.ts';
|
|
10
12
|
import {bindWorkspaceVisibility} from './workspace-visibility.ts';
|
|
11
13
|
import type {DirectionInspection} from '../src/direction-inspection.ts';
|
|
12
|
-
import {parseStageComment,feedbackItemComments,projectComments,timeOnlyBasis,feedbackTimingLabel,requireFeedbackFrames,isTimeOnlyFeedback} from '../src/stage-comment.ts';
|
|
14
|
+
import {parseStageComment,feedbackItemComments,projectComments,timeOnlyBasis,unprojectMark,feedbackTimingLabel,requireFeedbackFrames,isTimeOnlyFeedback} from '../src/stage-comment.ts';
|
|
13
15
|
import {bindStageComments,type CommentRow,type CommentPose} from './stage-comments.ts';
|
|
14
16
|
import {discoverTurnDials,TurnState} from '../src/turn-pad.ts';
|
|
15
17
|
import {bindTurnPad,type TurnPad} from './turn-pad.ts';
|
|
@@ -89,7 +91,7 @@ const lifecycle=new AbortController();
|
|
|
89
91
|
let suspended=false,disposed=false,frameHandle=0,navigationMissing=false;
|
|
90
92
|
let publicEditor:unknown;
|
|
91
93
|
let workspace:WorkspaceUI|null=null;
|
|
92
|
-
interface ReviewResponse { direction?:DirectionInspection; setsHash?:string; referenceHashes?:Record<string,string>; initialAnimation?:string|null; manifest: ReviewManifest; referenceBinding?:ReferenceBinding; explicitReference?:{id:string;name:string;sha256:string;url:string}; sourcePainting?:{id:string;path:string;sha256:string;url:string}; sourceHash: string; reviewedSource: ReviewedSource; report: ReportSeeds | null; feedbackCatalog: FeedbackCatalog; assetsBase: string; capabilities: { interview?:true; preRig?:true; playback: boolean; modeling: false; motion: false; feedback: boolean; audio: boolean } }
|
|
94
|
+
interface ReviewResponse { scene?:SceneInspection; direction?:DirectionInspection; setsHash?:string; referenceHashes?:Record<string,string>; initialAnimation?:string|null; manifest: ReviewManifest; referenceBinding?:ReferenceBinding; explicitReference?:{id:string;name:string;sha256:string;url:string}; sourcePainting?:{id:string;path:string;sha256:string;url:string}; sourceHash: string; reviewedSource: ReviewedSource; report: ReportSeeds | null; feedbackCatalog: FeedbackCatalog; assetsBase: string; capabilities: { interview?:true; preRig?:true; playback: boolean; modeling: false; motion: false; feedback: boolean; audio: boolean } }
|
|
93
95
|
interface PoseReference { schema: 'rig-review-pose/1'; coordinateSystem: 'image-pixels-y-down'; width: number; height: number; joints: { id: string; x: number; y: number; parent?: string }[] }
|
|
94
96
|
interface SequenceJoint { state: 'observed' | 'occluded' | 'missing' | 'inferred'; at?: [number, number]; score?: number }
|
|
95
97
|
interface PoseSequence { spec: 'rig-pose-sequence/1'; space: { units: 'picture-px'; origin: 'top-left'; y: 'down' }; width: number; height: number; source?: string; frames: { t: number; people: { id: string; joints: Record<string, SequenceJoint> }[] }[]; camera?: { s: number; tx: number; ty: number; inliers: number }[]; cameraSource?: unknown }
|
|
@@ -151,7 +153,10 @@ let rigDifference:{assets:ModelAssets;painting:HTMLImageElement;camera:ReturnTyp
|
|
|
151
153
|
let rigDifferenceFailure:string|null=null;
|
|
152
154
|
const rigRaster={el,canvas:partsCanvas,message,reference:()=>null,frameSize:()=>({w:partsCanvas.width,h:partsCanvas.height}),active:()=>!!rigDifference};
|
|
153
155
|
if(partsOnly){partsCanvas.id='parts-canvas';el('rig-root').append(partsCanvas);el('reference-content').append(partsReference);}
|
|
154
|
-
|
|
156
|
+
let sceneComposite:ReturnType<typeof bindScenePlates>|undefined;
|
|
157
|
+
const activeScene=()=>sceneComposite&&data.direction&&(!stageSource||stageSource.url===inspectedModel?.url)?data.direction:undefined;
|
|
158
|
+
const sceneBox=()=>{const direction=activeScene();return direction?takeSample(direction,time).box:null;};
|
|
159
|
+
const viewport=createViewportController(partsOnly?createPartsViewportProvider({el,canvas:partsCanvas,message,reference:()=>partsReference.width>0?partsReference:null,frameSize:target=>partsSubject?.frameSize(target)??null},viewportState):createRigViewportProvider({fitLabel:'Fit',framingBox:sceneBox,el,player:()=>player,assets:()=>assets,referenceSize:()=>referenceSize,view:()=>view,referenceGeneration:()=>referenceGeneration,parts:()=>parts,text,message,redrawOverlay,raster:rigRaster},viewportState),viewportState);
|
|
155
160
|
const {fitCamera,paneFrame,availableCamera,alignCameras,renderCameraControls,setCameraSync,cameraAction,updateCamera,fitActiveCamera}=viewport;
|
|
156
161
|
// First, before any URL use: take the `#cap=` handoff into memory/session storage and strip it.
|
|
157
162
|
if(!host)connectLiveWindow(access);
|
|
@@ -180,6 +185,7 @@ let playbackCarry = 0;
|
|
|
180
185
|
let comments:ReturnType<typeof bindStageComments>|null=null;
|
|
181
186
|
const recordComments:CommentRow[]=[];
|
|
182
187
|
let recordCommentKey='';
|
|
188
|
+
const submittedDirectionComments=new Set<string>();
|
|
183
189
|
let view: 'compare' | 'reference' | 'rig' = 'compare';
|
|
184
190
|
// Requested layout persists in the source-bound draft; the effective one follows actual load events only.
|
|
185
191
|
let rigInput:InputState={state:'pending'},referenceInput:InputState={state:'absent'},effectiveView:SingleLayout|null=null;
|
|
@@ -252,7 +258,7 @@ let readingsPanel:ReadingsPanel|null=null,readingsJob:ReadingsJobView|null=null,
|
|
|
252
258
|
/** The world an Apply's reload resumes: wind (clock and active pulse), pending jolts, whether the controls are engaged, gravity. */
|
|
253
259
|
interface StageWorld {wind:WindState;jolts:JoltStep[];applied:boolean;gravity:number}
|
|
254
260
|
|
|
255
|
-
function message(value: string, error = false, footerOnly = false): void {
|
|
261
|
+
function message(value: string, error = false, footerOnly = false, diagnostic?: string): void {
|
|
256
262
|
text('message', value);
|
|
257
263
|
el('message').title = value; // the footer truncates long messages
|
|
258
264
|
el('message').classList.toggle('error', error);
|
|
@@ -260,6 +266,8 @@ function message(value: string, error = false, footerOnly = false): void {
|
|
|
260
266
|
if (footerOnly) return;
|
|
261
267
|
// The modal makes the footer inert; the review dialog repeats the latest message for its reader.
|
|
262
268
|
text('review-message', value); el('review-message').classList.toggle('error', error);
|
|
269
|
+
// A background refusal names its code and origin on hover; only Submit's own catch changes the act bar.
|
|
270
|
+
if (diagnostic) el('message').title = diagnostic;
|
|
263
271
|
}
|
|
264
272
|
|
|
265
273
|
async function api<T>(path: string, init?: RequestInit): Promise<T> {
|
|
@@ -584,10 +592,11 @@ function renderFrameTransport(): void {
|
|
|
584
592
|
}
|
|
585
593
|
|
|
586
594
|
function activeTransportClock() {
|
|
595
|
+
if(activeScene())return null;
|
|
587
596
|
const active = player && player.current !== animation ? '' : animation;
|
|
588
597
|
return transportClock({ clock: data.report?.clock, animation: data.report?.animation }, active, !!player, stageClock, stageModelHash);
|
|
589
598
|
}
|
|
590
|
-
function activeFrameClock() { return activeTransportClock()?.clock ?? null; }
|
|
599
|
+
function activeFrameClock() { return activeScene()?null:activeTransportClock()?.clock ?? null; }
|
|
591
600
|
|
|
592
601
|
function seekFrame(frame: number): void {
|
|
593
602
|
const exact = timeAtFrame(activeFrameClock(), frame);
|
|
@@ -601,7 +610,7 @@ function seekFrame(frame: number): void {
|
|
|
601
610
|
function drawRig(action:()=>void):void {
|
|
602
611
|
if(rigDifference&&rigDifference.assets!==assets){leaveRigDifference();renderLayout();}
|
|
603
612
|
inDrawRig=true;
|
|
604
|
-
try{action();parts?.present('single');if(player&&inspectionSourceState==='ready')animationPanel?.capture(player,parts?.frame('single'));else animationPanel?.capture(null,undefined);text('renderer-state',rendererStatus(player?.renderer??null,'succeeded').label);redrawOverlay(true);}
|
|
613
|
+
try{const box=sceneBox();if(box&&player?.renderer instanceof CanvasRenderer)player.renderer.viewport=box;action();if(box&&player){sceneComposite?.draw(player,box);}parts?.present('single');if(box)viewport.fitCamera();if(player&&inspectionSourceState==='ready')animationPanel?.capture(player,parts?.frame('single'));else animationPanel?.capture(null,undefined);text('renderer-state',rendererStatus(player?.renderer??null,'succeeded').label);redrawOverlay(true);}
|
|
605
614
|
catch(error){animationPanel?.capture(null,undefined);overlays?.clear();text('renderer-state',rendererStatus(null,'failed').label);throw error;}
|
|
606
615
|
finally{inDrawRig=false;}
|
|
607
616
|
}
|
|
@@ -610,11 +619,15 @@ function chooseAnimation(name: string, move: ClipMove = { kind: 'choose' }): voi
|
|
|
610
619
|
if(rigDifference){leaveRigDifference();renderLayout();}
|
|
611
620
|
pause(); animation = name; axisInspection = false; el('angle-panel').hidden = true;
|
|
612
621
|
const runtimeAnimation = assets?.animations.find(item => item.name === name);
|
|
613
|
-
duration = clipDuration(name);
|
|
622
|
+
duration = activeScene()?.take.duration??clipDuration(name);
|
|
614
623
|
select('animation-select').value = name;
|
|
615
624
|
// #191: the wind restarts before the clip's first frame is drawn, so the paused stage shows the schedule's t=0 world.
|
|
616
|
-
time = 0; clipMoved(move);
|
|
617
|
-
if (player && runtimeAnimation) {
|
|
625
|
+
time = 0; const scene=activeScene();if(!scene)clipMoved(move);
|
|
626
|
+
if (player && runtimeAnimation) {
|
|
627
|
+
restartSetupPlayer();
|
|
628
|
+
if(scene){player.play(name,{loop:canRepeatIdle()});player.pause();seek(0,move);}
|
|
629
|
+
else drawRig(()=>{player!.play(name,{loop:canRepeatIdle()});player!.pause();refreshAnimationInspection();player!.draw();});
|
|
630
|
+
}
|
|
618
631
|
else if (player && name){text('renderer-state',rendererStatus(null,'failed').label);message(`Animation "${name}" is not present in the rig.`, true);}
|
|
619
632
|
renderTransport(); renderCues();renderIdle();
|
|
620
633
|
}
|
|
@@ -623,7 +636,7 @@ function seek(value: number, move?: ClipMove): void {
|
|
|
623
636
|
if(rigDifference){leaveRigDifference();renderLayout();}
|
|
624
637
|
time = duration > 0 ? Math.min(Math.max(0, value), duration) : Math.max(0, value);
|
|
625
638
|
clipMoved(move ?? { kind: 'seek', to: time });
|
|
626
|
-
if (player && player.current) { try { player.seek(time); drawRig(()=>player!.draw()); } catch (error) {text('renderer-state',rendererStatus(null,'failed').label); message(errorText(error), true); } }
|
|
639
|
+
if (player && player.current) { try { player.seek(activeScene()?takeSample(activeScene()!,time).sourceTime:time); drawRig(()=>player!.draw()); } catch (error) {text('renderer-state',rendererStatus(null,'failed').label); message(errorText(error), true); } }
|
|
627
640
|
if (video && video.readyState >= 1) holdVideoReference(video, referenceGeneration);
|
|
628
641
|
renderSequenceFrame(); renderTransport();
|
|
629
642
|
}
|
|
@@ -781,7 +794,7 @@ function tickPlaying(now: number): void {
|
|
|
781
794
|
const stepped = next.steps.reduce((sum, step) => sum + step, 0);
|
|
782
795
|
// The wrap does what the replaced seek(0) did besides the player: restart the wind clock and re-hold the reference at the wrapped time.
|
|
783
796
|
if (next.wrapped) { stopAudio(); clipMoved({ kind: 'replay' }); if (video) { if (video.readyState >= 1) holdVideoReference(video, referenceGeneration); void video.play().catch(error => { pause(); message(errorText(error), true); }); } }
|
|
784
|
-
if (player && player.current && next.steps.length) { try { stepEnvironment(stepped); drawRig(()=>{ for (const step of next.steps) player!.advance(step); player!.draw(); }); } catch (error) { pause(); message(errorText(error), true); } }
|
|
797
|
+
if (player && player.current && next.steps.length) { try { const direction=activeScene();if(direction){stepEnvironment(stepped);drawRig(()=>{player!.seek(takeSample(direction,time).sourceTime);player!.draw();});}else{stepEnvironment(stepped); drawRig(()=>{ for (const step of next.steps) player!.advance(step); player!.draw(); });} } catch (error) { pause(); message(errorText(error), true); } }
|
|
785
798
|
if (video && video.readyState >= 1 && time > video.duration) { if (referenceInput.state !== 'out-of-domain') holdVideoReference(video, referenceGeneration); } else if (video && referenceInput.state === 'loaded' && Math.abs(video.currentTime - time) > .15) video.currentTime = time;
|
|
786
799
|
if (input('sync-audio').checked) for (const cue of activeCues()) if (cueDue(cue.time, previous, next, duration)) void audition(cue.clip);
|
|
787
800
|
renderSequenceFrame(); renderTransport(); if (next.ended) pause(); lastFrame = now;
|
|
@@ -820,6 +833,22 @@ function configurePartSets(keep=''):void {
|
|
|
820
833
|
if(keep&&presets.some(set=>set.name===keep)){player!.setSet(keep);picker.value=keep;}
|
|
821
834
|
}
|
|
822
835
|
|
|
836
|
+
/** One creation path for initial load, rebuilds and a post-Setup single-track restart. */
|
|
837
|
+
function createInspectionPlayer(root:HTMLElement,loaded:ModelAssets,mode?:RigPlayer['mode']):RigPlayer {
|
|
838
|
+
const next=new RigPlayer(root,loaded,{mode});
|
|
839
|
+
next.on('event',event=>{text('event-log',`Runtime event: ${event.name} · ${event.time.toFixed(2)} s`);});
|
|
840
|
+
return next;
|
|
841
|
+
}
|
|
842
|
+
/** Public clear composes tracks permanently; restart single-track seeking over the same immutable assets. */
|
|
843
|
+
function restartSetupPlayer(force=false):void {
|
|
844
|
+
const previous=player,loaded=assets;if(!previous||!loaded||!force&&(previous.current!==null||!previous.composed))return;
|
|
845
|
+
const skin=previous.skin,sets=[...previous.activeSets],slots=previous.slots,adjust=previous.adjust,world=previous.environment(),mode=previous.mode;
|
|
846
|
+
const entries=partModel&&inspectionSourceState==='ready'?partCatalog(partModel,data.feedbackCatalog.slots??[]):null;
|
|
847
|
+
previous.dispose();player=createInspectionPlayer(el('rig-root'),loaded,mode);
|
|
848
|
+
player.skin=skin;if(sets.length)player.setSets(sets);player.slots=slots;player.adjust=adjust;player.environment(world);
|
|
849
|
+
setupChestWorld=readSetupChest(player);
|
|
850
|
+
if(entries)parts?.register('single',entries,player,new PartThumbnails(pageRegionTable(partModel),loaded.pageImages));
|
|
851
|
+
}
|
|
823
852
|
async function initPlayer(initialCheckpoint?:Checkpoint): Promise<void> {
|
|
824
853
|
text('renderer-state',rendererStatus(null,'pending').label);
|
|
825
854
|
if (!data.manifest.model) { text('player-state', 'No rig supplied · reference review is available'); return; }
|
|
@@ -830,15 +859,15 @@ async function initPlayer(initialCheckpoint?:Checkpoint): Promise<void> {
|
|
|
830
859
|
assets = await loadModel({ modelUrl, ...stageLoadInputs(modelUrl,inspectedModel.sha256), resolvePage: (name, url) => {
|
|
831
860
|
const target = new URL(name, url); if (target.origin !== location.origin || !target.pathname.startsWith(access.route('/assets/'))) throw new Error(`Model page escapes local package: ${name}`); return target.href;
|
|
832
861
|
} });
|
|
833
|
-
|
|
862
|
+
if(data.scene){sceneComposite=bindScenePlates(data.scene,await loadScenePlates(data.scene,assetUrl));input('idle-repeat').checked=data.direction!.take.loop;input('idle-repeat').disabled=true;}
|
|
863
|
+
player = createInspectionPlayer(el('rig-root'), assets,sceneComposite?'canvas':undefined);
|
|
834
864
|
setupChestWorld = readSetupChest(player);
|
|
835
865
|
// Parts inspection is an add-on: a catalog refusal is shown in the explorer and never aborts the rig.
|
|
836
866
|
try{const catalog=await loadPartModel(modelUrl,data.reviewedSource.rig!.sha256,data.feedbackCatalog.slots??[]);inspectionSourceState='ready';partModel=catalog.model;configureTurnPad(catalog.model);refreshAnimationInspection();weightsView?.refresh();parts?.register('single',catalog.entries,player,new PartThumbnails(pageRegionTable(catalog.model),assets.pageImages));}catch(error){inspectionSourceState='failed';partModel=null;refreshAnimationInspection();parts?.refuseCatalog('single',error);}
|
|
837
|
-
player.on('event', event => { text('event-log', `Runtime event: ${event.name} · ${event.time.toFixed(2)} s`); });
|
|
838
867
|
const animations = select('animation-select'); animations.replaceChildren();
|
|
839
868
|
for (const item of assets.animations) animations.append(option(item.name, data.manifest.animations.find(a => a.id === item.name)?.label ?? item.name));
|
|
840
|
-
animations.disabled = assets.animations.length === 0;
|
|
841
|
-
const names=assets.animations.map(clip=>clip.name),initial=initialIdleAnimation(names,initialPlayerAnimation(names,data.initialAnimation??undefined,initialCheckpoint),!!data.initialAnimation||!!initialCheckpoint?.animation||!!initialCheckpoint?.axis);
|
|
869
|
+
animations.disabled = assets.animations.length === 0 || !!data.scene;
|
|
870
|
+
const names=assets.animations.map(clip=>clip.name),initial=data.scene?.animation??initialIdleAnimation(names,initialPlayerAnimation(names,data.initialAnimation??undefined,initialCheckpoint),!!data.initialAnimation||!!initialCheckpoint?.animation||!!initialCheckpoint?.axis);
|
|
842
871
|
if(initial)chooseAnimation(initial);else drawRig(()=>player!.draw());
|
|
843
872
|
el('rig-empty').hidden = true; text('player-state', '@rig-c/play · Actual rig');
|
|
844
873
|
configurePartSets();
|
|
@@ -875,6 +904,7 @@ function isSubmittedFeedback(id:string):boolean {
|
|
|
875
904
|
|
|
876
905
|
function renderProposals(): void {
|
|
877
906
|
comments?.refresh();
|
|
907
|
+
if(host?.direction){setSourceText(rigInspector.comments.button,`Comments (${recordComments.length})`);return;}
|
|
878
908
|
const count=session.feedback.length;setSourceText(rigInspector.comments.button, `Comments (${count})`);
|
|
879
909
|
const area = el('proposal-list'); area.replaceChildren();
|
|
880
910
|
const warnings = el('feedback-warnings'); warnings.hidden = session.feedbackWarnings.length === 0;
|
|
@@ -1105,6 +1135,7 @@ function bind(): void {
|
|
|
1105
1135
|
if (session.feedbackWarnings.length) { message('Resolve validation warnings in existing feedback before submitting. Delete the marked entries and add valid replacements.', true); return; }
|
|
1106
1136
|
saving = true; updateSavedState(); const savedPayload = JSON.stringify(session);
|
|
1107
1137
|
if (host) {
|
|
1138
|
+
let submissionFailure: ReturnType<typeof jobSubmissionRefusal> | null = null;
|
|
1108
1139
|
try {
|
|
1109
1140
|
const sent = await host.submit(structuredClone(session), async committed => {
|
|
1110
1141
|
submittedBaseline = {...submittedBaseline!, ...committed.review,
|
|
@@ -1114,12 +1145,22 @@ function bind(): void {
|
|
|
1114
1145
|
dirty = session.status !== submittedBaseline.status || JSON.stringify(session.feedback) !== JSON.stringify(submittedBaseline.feedback) ||
|
|
1115
1146
|
[...ids].some(id => JSON.stringify(session.checkpoints[id] ?? {outcome: 'pending', note: ''}) !==
|
|
1116
1147
|
JSON.stringify(submittedBaseline!.checkpoints[id] ?? {outcome: 'pending', note: ''}));
|
|
1148
|
+
if(host?.direction){for(const row of recordComments)submittedDirectionComments.add(row.id);try{localStorage.removeItem(recordCommentKey);}catch{}}
|
|
1117
1149
|
await persistence?.submitted(submittedBaseline);
|
|
1118
1150
|
comments?.refresh(); renderProposals();
|
|
1119
|
-
});
|
|
1151
|
+
},host.direction?recordCommentWords():undefined);
|
|
1120
1152
|
message(sent);
|
|
1121
|
-
} catch (error) {
|
|
1122
|
-
|
|
1153
|
+
} catch (error) {
|
|
1154
|
+
submissionFailure = jobSubmissionRefusal(error);
|
|
1155
|
+
message(submissionFailure.text, true);
|
|
1156
|
+
}
|
|
1157
|
+
finally {
|
|
1158
|
+
saving = false; updateSavedState();
|
|
1159
|
+
if (submissionFailure) {
|
|
1160
|
+
rigInspector.actBar.setSaveState({kind: 'failed', text: submissionFailure.text, title: submissionFailure.title});
|
|
1161
|
+
el('message').title = submissionFailure.title;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1123
1164
|
return;
|
|
1124
1165
|
}
|
|
1125
1166
|
try { const saved = await api<ReviewSession>('/api/session', { method: 'PUT', headers: { 'Content-Type': 'application/json' }, body: savedPayload });
|
|
@@ -1133,12 +1174,13 @@ function bind(): void {
|
|
|
1133
1174
|
const inspected=!!inspectedModel&&(!stageSource||stageSource.url===inspectedModel.url);
|
|
1134
1175
|
const model=player&&stageModelHash?{path:inspected?data.manifest.model!:new URL(stageSource!.url).pathname,sha256:stageModelHash,inspected}:null;
|
|
1135
1176
|
return {model,revision:data.manifest.revision,sourceHash:data.sourceHash,runtime:data.reviewedSource.runtimeVersion,
|
|
1136
|
-
dials:player?turnPad?.state.dials??[]:[],sets:player?.sets().map(set=>set.name)??[],activeSet:select('part-set').value,authored:data.direction};
|
|
1177
|
+
dials:player?turnPad?.state.dials??[]:[],sets:player?.sets().map(set=>set.name)??[],activeSet:select('part-set').value,authored:data.direction,scene:data.scene};
|
|
1137
1178
|
},name=>{
|
|
1138
1179
|
const picker=select('part-set');picker.value=name;picker.dispatchEvent(new Event('change',{bubbles:true}));
|
|
1139
1180
|
});
|
|
1181
|
+
directionPanel.show(!!data.direction);
|
|
1140
1182
|
viewDisposers.push(()=>directionPanel?.dispose());
|
|
1141
|
-
bindWorkspace();
|
|
1183
|
+
bindWorkspace(!!data.manifest.model);
|
|
1142
1184
|
overlays=new RigOverlays({canvas:el<HTMLCanvasElement>('rig-overlay'),rigRoot:el('rig-root')});
|
|
1143
1185
|
chestEditor=bindChestEditor({pane:el('rig-pane'),canvas:el('rig-overlay'),project:()=>player?rigProject():null,mapping:()=>activeChestMapping(),changed:renderChest,download:()=>{void exportChest();},apply:()=>{void applyRebuild();},reset:()=>{void resetRebuild();},message,inspector:()=>selectedInspector()});viewDisposers.push(()=>chestEditor?.dispose());
|
|
1144
1186
|
meshEditor=bindMeshEditor({pane:el('rig-pane'),canvas:el('rig-overlay'),project:()=>player?rigProject():null,mapping:()=>chestMapping,inspector:()=>selectedInspector(),source:meshSource,pause,changed:()=>redrawOverlay(false),download:doc=>{void exportMesh(doc);},apply:(doc,line)=>applyMeshDelta(doc,line),applied:()=>appliedOnStage?.schema==='rig-review-applied/3',resetBuild:()=>resetRebuild(stageWorld()),message,confirm:text=>window.confirm(tr(text)),token:name=>getComputedStyle(document.documentElement).getPropertyValue(name).trim()});viewDisposers.push(()=>meshEditor?.dispose());
|
|
@@ -1196,12 +1238,12 @@ function bind(): void {
|
|
|
1196
1238
|
}
|
|
1197
1239
|
|
|
1198
1240
|
/** The one shell and block binding, for either subject. */
|
|
1199
|
-
function bindWorkspace():void {
|
|
1241
|
+
function bindWorkspace(hasModel=false):void {
|
|
1200
1242
|
workspace=bindWorkspaceUI({root:screenRoot,regions:{layout:screenRoot.querySelector<HTMLElement>('.layout')!,left:screenRoot.querySelector<HTMLElement>('.left-panel')!,main:el('stage-layout').parentElement!,stage:el('stage-layout'),bottom:screenRoot.querySelector<HTMLElement>('.inspector')!,columns:{left:'rightWidth',right:null}},language:shell.language!,bottomPanel:rigInspector,changed:fitCamera,defaultTheme:theme=>appearance?.set(theme),currentTheme:()=>appearance?.get()});
|
|
1201
1243
|
viewport.state.cameraSync=workspace.defaults().defaultCameraSync;input('camera-sync').checked=viewport.state.cameraSync;input('idle-repeat').checked=workspace.defaults().defaultIdleRepeat;
|
|
1202
1244
|
appearance=bindAppearance(select('settings-theme'),workspace.defaults().theme);
|
|
1203
1245
|
bindReviewDialog();
|
|
1204
|
-
inspectorBlocks=bindInspectorBlocks({sections:[el('inspector-rig'),el('inspector-playback')],bottom:{strip:rigInspector.strip,comment:rigInspector.comments.button,panel:rigInspector.comments.panel},changed:()=>{workspace?.refresh();persistence?.save();}});
|
|
1246
|
+
inspectorBlocks=bindInspectorBlocks({sections:[el('inspector-rig'),el('inspector-playback')],available:host?.record&&(!host.record.hasPicture||!hasModel)?['feedback']:undefined,bottom:{strip:rigInspector.strip,comment:rigInspector.comments.button,panel:rigInspector.comments.panel},changed:()=>{workspace?.refresh();persistence?.save();}});
|
|
1205
1247
|
}
|
|
1206
1248
|
async function start(): Promise<void> {
|
|
1207
1249
|
try {
|
|
@@ -1212,9 +1254,9 @@ async function start(): Promise<void> {
|
|
|
1212
1254
|
const [saved,accessState]=await Promise.all([api<ReviewSession|PartsSubjectSession>('/api/session'),api<{capabilityRequired:boolean;control?:boolean}>('/api/access')]);
|
|
1213
1255
|
if('subject' in opened&&opened.subject==='parts'){await startParts(opened,saved as PartsSubjectSession,accessState);return;}
|
|
1214
1256
|
data=opened as ReviewResponse;session=saved as ReviewSession;writes=accessState;
|
|
1215
|
-
readOnly = host?.record ? tr('JOB_REVIEW_READ_ONLY') : readOnlyReason(access, writes.capabilityRequired);
|
|
1257
|
+
readOnly = host?.unavailable?t('job.refusal.'+host.unavailable):host?.record ? tr('JOB_REVIEW_READ_ONLY') : readOnlyReason(access, writes.capabilityRequired);
|
|
1216
1258
|
actReadOnly = readOnlyReason(access, writes.capabilityRequired, host?.ownerActAccess);
|
|
1217
|
-
if(data.capabilities.preRig){rigInspector.comments.button.disabled=true;rigInspector.act.hidden=true;}
|
|
1259
|
+
if(data.capabilities.preRig&&!host?.record){rigInspector.comments.button.disabled=true;rigInspector.act.hidden=true;}
|
|
1218
1260
|
submittedBaseline=structuredClone(session);
|
|
1219
1261
|
text('package-title', data.manifest.title); text('revision', data.manifest.revision); document.title = `${data.manifest.title} · rig review`; text('source-hash', `source ${data.sourceHash.slice(0, 12)}`); select('review-status').value = session.status; select('feedback-target-kind').value = 'rig'; input('feedback-target-name').value = data.manifest.id;
|
|
1220
1262
|
select('reference-select').replaceChildren(); for (const reference of data.manifest.references) select('reference-select').append(option(reference.id, `${reference.label} · ${reference.type}`));
|
|
@@ -1223,11 +1265,11 @@ async function start(): Promise<void> {
|
|
|
1223
1265
|
// Checkpoints and reference fold away when the package supplies neither.
|
|
1224
1266
|
(el('package-context') as HTMLDetailsElement).open = data.manifest.checkpoints.length > 0 || data.manifest.references.length > 0;
|
|
1225
1267
|
const sourceFiles = el('source-files'); for (const file of data.manifest.authoring) { const a = document.createElement('a'); a.href = assetUrl(file.path); a.textContent = file.label; a.className = 'source-link'; a.target = '_blank'; a.rel = 'noopener'; sourceFiles.append(a); } if (!data.manifest.authoring.length) sourceFiles.textContent = 'No source files supplied';
|
|
1226
|
-
populateChestBones(); bind(); parts=new PartExplorer(el('workspace-left'),el('selected-part'),previous=>{if(rigDifference){leaveRigDifference();renderLayout();}const part=parts?.value();if(!stageCorrectionRebinding&&(previous?.side!==part?.side||previous?.slot!==part?.slot||previous?.mode!==part?.mode))stageDraftRequestToken++;if(player&&inspectionSourceState==='ready')animationPanel?.capture(player,parts?.frame('single'));else animationPanel?.capture(null,undefined);weightsView?.refresh();redrawOverlay(true);meshEditor?.selectionChanged();if(stageCorrectionPart&&!stageCorrectionRebinding&&(part?.slot??null)!==stageCorrectionPart){stageCorrectionPart=null;document.getElementById('stage-draft-label')?.remove();}animationPanel?.fromParts(part?.slot??null);meshPanel?.select(part?.slot??null);requirementsPanel?.selectionChanged();renderDropNotices();if(part){viewport.state.activeCamera='rig';if(view==='reference')setView('rig');if(selectedInspector(document)!=='playback')showInspector('rig');renderCameraControls();}if(!viewport.state.cameraRestoring&&(previous?.side!==part?.side||previous?.slot!==part?.slot))cameraAction(()=>fitActiveCamera(part?'rig':availableCamera()));persistence?.save();},part=>{select('feedback-target-kind').value='slot';renderFeedbackTargets(true);input('feedback-target-name').value=part.slot;showInspector('feedback');}); animationPanel=new AnimationInspectionPanel({host:el('animation-inspection'),stage:el('rig-viewport'),project:(x,y)=>rigProject()(x,y),enabled:()=>inspectionSourceState==='ready'&&selectedInspector(document)==='playback',pause,preview:fn=>{animAdjust=fn;if(!player)return;player.adjust=composeAdjust(composeAdjust(composeAdjust(idleAdjust,dialAdjust),turnAdjust),animAdjust);if(!inDrawRig&&player.current&&!playing){player.seek(time);drawRig(()=>player!.draw());}},apply:ops=>applyAnimation(ops),reset:()=>resetAnimationBuild(),seek:exact=>{if(!Number.isFinite(exact)||exact<0||exact>duration){message('KEY_TIME_OUT_OF_DOMAIN: no substitute time was used.',true);return;}seekMarker(animation,exact,'Stored key');},select:value=>{const slot=value?.kind==='slot'?value.name:null;if((parts?.value()?.slot??null)!==slot)parts?.select(slot?{side:'single',slot,mode:parts?.value()?.mode??'context'}:null);parts?.highlightBone(value?.kind==='bone'?value.name:null);redrawOverlay(false);}});viewDisposers.push(()=>animationPanel?.dispose()); updateStripControls(); stripStatus('Choose the entered start–end frames or all feedback ranges to download. Unsubmitted feedback is included; exporting does not submit the review.'); renderFeedbackTargets(true); renderFeedbackRange(); renderCheckpoints(); renderProposals(); renderProvenance(); updateSavedState(); renderCues(); initReport();
|
|
1268
|
+
populateChestBones(); bind(); parts=new PartExplorer(el('workspace-left'),el('selected-part'),previous=>{if(rigDifference){leaveRigDifference();renderLayout();}const part=parts?.value();if(!stageCorrectionRebinding&&(previous?.side!==part?.side||previous?.slot!==part?.slot||previous?.mode!==part?.mode))stageDraftRequestToken++;if(player&&inspectionSourceState==='ready')animationPanel?.capture(player,parts?.frame('single'));else animationPanel?.capture(null,undefined);weightsView?.refresh();redrawOverlay(true);meshEditor?.selectionChanged();if(stageCorrectionPart&&!stageCorrectionRebinding&&(part?.slot??null)!==stageCorrectionPart){stageCorrectionPart=null;document.getElementById('stage-draft-label')?.remove();}animationPanel?.fromParts(part?.slot??null);meshPanel?.select(part?.slot??null);requirementsPanel?.selectionChanged();renderDropNotices();if(part){viewport.state.activeCamera='rig';if(view==='reference')setView('rig');if(selectedInspector(document)!=='playback')showInspector('rig');renderCameraControls();}if(!viewport.state.cameraRestoring&&(previous?.side!==part?.side||previous?.slot!==part?.slot))cameraAction(()=>fitActiveCamera(part?'rig':availableCamera()));persistence?.save();},part=>{select('feedback-target-kind').value='slot';renderFeedbackTargets(true);input('feedback-target-name').value=part.slot;showInspector('feedback');}); animationPanel=new AnimationInspectionPanel({host:el('animation-inspection'),stage:el('rig-viewport'),project:(x,y)=>rigProject()(x,y),enabled:()=>inspectionSourceState==='ready'&&selectedInspector(document)==='playback',pause,preview:fn=>{animAdjust=fn;if(!player)return;player.adjust=composeAdjust(composeAdjust(composeAdjust(idleAdjust,dialAdjust),turnAdjust),animAdjust);if(!inDrawRig&&player.current&&!playing){if(activeScene())seek(time);else{player.seek(time);drawRig(()=>player!.draw());}}},apply:ops=>applyAnimation(ops),reset:()=>resetAnimationBuild(),seek:exact=>{if(!Number.isFinite(exact)||exact<0||exact>duration){message('KEY_TIME_OUT_OF_DOMAIN: no substitute time was used.',true);return;}seekMarker(animation,exact,'Stored key');},select:value=>{const slot=value?.kind==='slot'?value.name:null;if((parts?.value()?.slot??null)!==slot)parts?.select(slot?{side:'single',slot,mode:parts?.value()?.mode??'context'}:null);parts?.highlightBone(value?.kind==='bone'?value.name:null);redrawOverlay(false);}});viewDisposers.push(()=>animationPanel?.dispose()); updateStripControls(); stripStatus('Choose the entered start–end frames or all feedback ranges to download. Unsubmitted feedback is included; exporting does not submit the review.'); renderFeedbackTargets(true); renderFeedbackRange(); renderCheckpoints(); renderProposals(); renderProvenance(); updateSavedState(); renderCues(); initReport();
|
|
1227
1269
|
const requestedId = new URLSearchParams(location.search).get('checkpoint'),initial=initialReviewSelection(data.manifest,requestedId,data.explicitReference?.id,data.initialAnimation??undefined),first=initial.checkpoint;
|
|
1228
1270
|
rigInput=data.manifest.model?{state:'pending'}:{state:'absent'};renderLayout();
|
|
1229
1271
|
// A job rig subject lands in Animate before the model finishes loading (#709).
|
|
1230
|
-
if(host)showInspector('playback');
|
|
1272
|
+
if(host)showInspector(data.manifest.model?'playback':'rig');
|
|
1231
1273
|
if(initial.referenceId){select('reference-select').value=initial.referenceId;await showReference(initial.referenceId);}
|
|
1232
1274
|
await initPlayer(first);
|
|
1233
1275
|
// initPlayer keeps `player` only after its first draw succeeded; a declared model path alone never counts.
|
|
@@ -1240,14 +1282,20 @@ async function start(): Promise<void> {
|
|
|
1240
1282
|
else if (host?.ownerActAccess) message('Not submitted');
|
|
1241
1283
|
else message(data.manifest.model ? 'Record review status and structured feedback while preserving sources. Motion is read only.' : 'No rig supplied. Review the available references and checkpoints.');
|
|
1242
1284
|
frameHandle=requestAnimationFrame(tick);
|
|
1243
|
-
const restored=await setupPersistence();setupComments();await loadRebuildStatus();void loadRequirements();renderChest();restoreEnvironment();physicsPanel?.restore();bonesPanel?.restore();cutsPanel?.restore();clothPanel?.restore();idlePanel?.restore();rigFieldsPanel?.restore();meshPanel?.restore();void refreshDensityStrip();renderIdle();if(idlePreviewOnOpen(restored,!!host)&&canRepeatIdle()&&automaticIdlePreview(assets?.animations.map(item=>item.name)??[],animation,first,!!requestedId))void playPreview();
|
|
1285
|
+
const restored=await setupPersistence();setupComments();if(host?.direction)showRecordComments(true);else if(host?.record&&!data.manifest.model)showRecordComments();await loadRebuildStatus();void loadRequirements();renderChest();restoreEnvironment();physicsPanel?.restore();bonesPanel?.restore();cutsPanel?.restore();clothPanel?.restore();idlePanel?.restore();rigFieldsPanel?.restore();meshPanel?.restore();void refreshDensityStrip();renderIdle();if(idlePreviewOnOpen(restored,!!host)&&canRepeatIdle()&&automaticIdlePreview(assets?.animations.map(item=>item.name)??[],animation,first,!!requestedId))void playPreview();
|
|
1244
1286
|
// Only an instance that serves agent control is asked for its config: a plain open has no control endpoint (#164).
|
|
1245
1287
|
if(!readOnly&&writes.control!==false)controlDispose=connectControl({sourceHash:data.sourceHash,mode:'single',route:access.route,headers:()=>access.headers(),observe:controlState,apply:applyControl,onStatus:value=>text('control-state',value)});
|
|
1246
1288
|
bindWorkspaceVisibility({key:access.key,sourceHash:data.sourceHash,pause});
|
|
1247
1289
|
if(host){
|
|
1248
|
-
if(!player)
|
|
1290
|
+
if(!player&&video){
|
|
1291
|
+
await waitReferenceMetadata(video,lifecycle.signal);
|
|
1292
|
+
if(video.readyState<2)await mediaReady(video,'loadeddata',lifecycle.signal);
|
|
1293
|
+
if(video.seeking)await mediaReady(video,'seeked',lifecycle.signal);
|
|
1294
|
+
if(!video.seeking&&video.readyState>=2&&video.currentTime===time)setReferenceInput({state:'loaded'});
|
|
1295
|
+
}
|
|
1296
|
+
if(!player&&(data.manifest.model||referenceInput.state!=='loaded'))throw new Error('JOB_VISUAL_UNAVAILABLE');
|
|
1249
1297
|
await restorePublicationNavigation();document.body.dataset.ready='true';
|
|
1250
|
-
host.attach({recordForms:renderRecordForms,pendingSubjects:renderPendingSubjects,stage:hostStage,redraw:()=>{if(player&&!playing)drawRig(()=>player!.draw());},message,...host.record?{}:{incompatible:()=>navigationMissing,navigation:()=>({subject:'rig' as const,bookmark:inspectionBookmark()})},suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});showInspector('playback');host.displayed();
|
|
1298
|
+
host.attach({recordForms:renderRecordForms,pendingSubjects:renderPendingSubjects,stage:hostStage,redraw:()=>{if(player&&!playing)drawRig(()=>player!.draw());},message:(value,error,diagnostic)=>message(value,error,false,diagnostic),...host.record?{}:{incompatible:()=>navigationMissing,navigation:()=>({subject:'rig' as const,bookmark:inspectionBookmark()})},suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});showInspector(data.manifest.model?'playback':'rig');host.displayed();
|
|
1251
1299
|
}
|
|
1252
1300
|
} catch (error) { message(`Could not open review package: ${errorText(error)}`, true); text('dirty', 'Load failed'); host?.failed(error); }
|
|
1253
1301
|
}
|
|
@@ -1312,11 +1360,19 @@ async function startParts(opened:PartsSubjectEntry,saved:PartsSubjectSession,wri
|
|
|
1312
1360
|
const resize=viewport.observeResize();viewDisposers.push(()=>resize.disconnect());
|
|
1313
1361
|
viewport.requestFit();await partsSubject.ready();text('dirty','Not submitted');message(actReadOnly??(host?.ownerActAccess?'Not submitted':'Parts ready. Source files remain unchanged.'),!!actReadOnly);referenceInput=subject.painting?{state:'loaded'}:{state:'absent'};renderLayout();
|
|
1314
1362
|
renderPendingSubjects(host?.pendingSubjects?.()??[{kind:'parts-verdict'}]);
|
|
1315
|
-
if(host){await restorePublicationNavigation();host.attach({recordForms:renderRecordForms,stage:()=>null,redraw:()=>partsSubject?.redraw(),message,pendingSubjects:renderPendingSubjects,...host.record?{}:{incompatible:()=>navigationMissing,navigation:()=>({subject:'parts' as const,part:partsSubject!.selected(),solo:partsSubject!.solo(),view,camera:numericView()})},suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});host.displayed();}
|
|
1363
|
+
if(host){await restorePublicationNavigation();host.attach({recordForms:renderRecordForms,stage:()=>null,redraw:()=>partsSubject?.redraw(),message:(value,error,diagnostic)=>message(value,error,false,diagnostic),pendingSubjects:renderPendingSubjects,...host.record?{}:{incompatible:()=>navigationMissing,navigation:()=>({subject:'parts' as const,part:partsSubject!.selected(),solo:partsSubject!.solo(),view,camera:numericView()})},suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});host.displayed();}
|
|
1316
1364
|
|
|
1317
1365
|
document.body.dataset.ready='true';
|
|
1318
1366
|
}
|
|
1319
|
-
/**
|
|
1367
|
+
/** Use the existing Comments-only presentation for subjects without rig capabilities. */
|
|
1368
|
+
function showRecordComments(preserveInspector=false):void {
|
|
1369
|
+
for(const child of el('proposal-panel').children)if(child.id!=='comments-list-host')(child as HTMLElement).hidden=true;
|
|
1370
|
+
if(preserveInspector)return;
|
|
1371
|
+
for(const child of rigInspector.comments.panel.children)(child as HTMLElement).hidden=child!==el('proposal-panel')&&!child.classList.contains('review-dialog-header');
|
|
1372
|
+
rigInspector.comments.panel.style.display='block';
|
|
1373
|
+
rigInspector.collapse.disabled=false;setSourceAttribute(rigInspector.collapse,'title','');
|
|
1374
|
+
}
|
|
1375
|
+
/** Publications without a picture reuse the empty main view; no model is manufactured. */
|
|
1320
1376
|
async function startRecord(interview?:InterviewSubjectEntry):Promise<void> {
|
|
1321
1377
|
if(!host?.record&&!interview)throw new Error('JOB_DISPLAY_MISMATCH');
|
|
1322
1378
|
const unavailable=interview?'MODEL_UNAVAILABLE: no compiled model is supplied in this inspection.':'This request has no picture.';
|
|
@@ -1333,17 +1389,18 @@ async function startRecord(interview?:InterviewSubjectEntry):Promise<void> {
|
|
|
1333
1389
|
label();viewDisposers.push(onLanguageChange(label));
|
|
1334
1390
|
viewDisposers.push(await joinedInterviewForms(access,forms=>renderRecordForms(forms,t('interview.title'),true)));
|
|
1335
1391
|
text('provenance-rig',unavailable);text('provenance-motion',unavailable);text('source-files','project.json');
|
|
1336
|
-
}else{setupComments();rigInspector.comments.button.disabled=false;button('stage-comment').disabled=false;}
|
|
1392
|
+
}else{restoreRecordComments();setupComments();showRecordComments();rigInspector.comments.button.disabled=false;button('stage-comment').disabled=false;}
|
|
1337
1393
|
const resize=viewport.observeResize();viewDisposers.push(()=>resize.disconnect());
|
|
1338
1394
|
await workspace?.settle();if(disposed)return;
|
|
1395
|
+
if(host?.unavailable){message(t('job.refusal.'+host.unavailable),true);el('message').title=host.unavailable;button('save').disabled=true;button('save').title=host.unavailable;}
|
|
1339
1396
|
document.body.dataset.ready='true';
|
|
1340
|
-
if(!interview){host!.attach({recordForms:renderRecordForms,pendingSubjects:renderPendingSubjects,stage:()=>null,redraw:()=>{},message,suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});host!.displayed();}
|
|
1397
|
+
if(!interview){host!.attach({recordForms:renderRecordForms,pendingSubjects:renderPendingSubjects,stage:()=>null,redraw:()=>{},message:(value,error,diagnostic)=>message(value,error,false,diagnostic),suspend:suspendScreen,resume:resumeScreen,dispose:disposeScreen});host!.displayed();}
|
|
1341
1398
|
}
|
|
1342
1399
|
let recordDialog:HTMLDialogElement|null=null;
|
|
1343
1400
|
/** Reuse the form's publication binding for native record comments, without a package session. */
|
|
1344
|
-
function restoreRecordComments(form
|
|
1345
|
-
if(!host?.record||recordCommentKey)return;
|
|
1346
|
-
const publicationId=form
|
|
1401
|
+
function restoreRecordComments(form?:HTMLFormElement):void {
|
|
1402
|
+
if((!host?.record&&!host?.direction)||recordCommentKey)return;
|
|
1403
|
+
const publicationId=host?.direction?.publicationId??host?.record?.publicationId??form?.dataset.jobPublication,sourceHash=host?.direction?.sourceHash??host!.record!.sourceHash;
|
|
1347
1404
|
if(!publicationId)throw new Error('JOB_DISPLAY_MISMATCH');
|
|
1348
1405
|
recordCommentKey='rig-review-record-comments/1:'+publicationId+':'+sourceHash;
|
|
1349
1406
|
try {
|
|
@@ -1355,7 +1412,7 @@ function restoreRecordComments(form:HTMLFormElement):void {
|
|
|
1355
1412
|
if(!row||typeof row.id!=='string'||!row.id||ids.has(row.id)||typeof row.summary!=='string'||!row.summary.trim()||row.summary.length>1000)throw new Error('JOB_ACT_INVALID');
|
|
1356
1413
|
ids.add(row.id);
|
|
1357
1414
|
if('schema' in row){const issue=parsePartsIssue(row,false,true,false),items=new Map((partsSubject?.items()??[]).map(item=>[item.name,{...item,imageHash:item.imageHash!}]));assertPartsIssueBinding(issue,items,partsSubject!.sourceHash());}
|
|
1358
|
-
else if('target' in row){const mark=parseStageComment((row.context as {comment?:unknown})?.comment);if(!host
|
|
1415
|
+
else if('target' in row){const mark=parseStageComment((row.context as {comment?:unknown})?.comment);if((!host?.direction&&!host!.record!.hasPicture)||mark.sourceHash!==data.sourceHash)throw new Error('JOB_DISPLAY_MISMATCH');}
|
|
1359
1416
|
else if(Object.keys(row).some(key=>key!=='id'&&key!=='summary'))throw new Error('JOB_ACT_INVALID');
|
|
1360
1417
|
}
|
|
1361
1418
|
projectComments(rows.map(row=>'schema' in row?partsIssueComments([row as import('../src/parts-comment.ts').PartsIssue])[0]!:'target' in row?feedbackItemComments([row as Feedback])[0]!:{text:row.summary}));
|
|
@@ -1367,8 +1424,8 @@ function recordCommentWords():string {
|
|
|
1367
1424
|
return projectComments(recordComments.map(row=>'schema' in row?partsIssueComments([row as import('../src/parts-comment.ts').PartsIssue])[0]!:'target' in row?feedbackItemComments([row as Feedback])[0]!:{text:row.summary}));
|
|
1368
1425
|
}
|
|
1369
1426
|
function recordCommentsChanged():void {
|
|
1370
|
-
if(!host?.record)return;
|
|
1371
|
-
try{if(recordCommentKey)localStorage.setItem(recordCommentKey,JSON.stringify({publicationId:recordDialog?.querySelector<HTMLFormElement>('form[data-job-ask]')?.dataset.jobPublication,sourceHash:host
|
|
1427
|
+
if(!host?.record&&!host?.direction)return;
|
|
1428
|
+
try{if(recordCommentKey)localStorage.setItem(recordCommentKey,JSON.stringify({status:select('review-status').value,publicationId:host?.direction?.publicationId??host?.record?.publicationId??recordDialog?.querySelector<HTMLFormElement>('form[data-job-ask]')?.dataset.jobPublication,sourceHash:host?.direction?.sourceHash??host!.record!.sourceHash,comments:recordComments}));}catch{/* In-memory comments remain bound to this host. */}
|
|
1372
1429
|
setSourceText(rigInspector.comments.button,`Comments (${recordComments.length})`);
|
|
1373
1430
|
for(const form of recordDialog?.querySelectorAll('form[data-job-ask]')??[])form.dispatchEvent(new Event('input',{bubbles:true}));
|
|
1374
1431
|
}
|
|
@@ -1386,7 +1443,7 @@ function renderRecordForms(forms:readonly HTMLElement[],label='job.pending',stan
|
|
|
1386
1443
|
if(!standalone&&forms[0])restoreRecordComments(forms[0] as HTMLFormElement);
|
|
1387
1444
|
const added=forms.filter(form=>!recordDialog!.contains(form));
|
|
1388
1445
|
for(const form of forms){
|
|
1389
|
-
if(!standalone)(form as JobForm['form']).commentWords=()=>host?.record?recordCommentWords():partsOnly?projectComments(partsIssueComments(partsSubject?.issues()??[])):projectComments(feedbackItemComments(session.feedback));
|
|
1446
|
+
if(!standalone)(form as JobForm['form']).commentWords=()=>host?.record||host?.direction?recordCommentWords():partsOnly?projectComments(partsIssueComments(partsSubject?.issues()??[])):projectComments(feedbackItemComments(session.feedback));
|
|
1390
1447
|
if(!recordDialog.contains(form)){if(!form.classList.contains('interview-answer'))form.style.overflow='auto';form.style.minHeight='0';recordDialog.append(form);}
|
|
1391
1448
|
}
|
|
1392
1449
|
if(host?.record){
|
|
@@ -1476,7 +1533,7 @@ function bindInspector(partsSubject=false):void {
|
|
|
1476
1533
|
inspectorTabs?.dispose();
|
|
1477
1534
|
rigInspector.row.reveal=()=>workspace?.revealInspector();
|
|
1478
1535
|
inspectorTabs=bindInspectorTabs(()=>{const mode=inspectorTabs?.state();if(mode)inspectorBlocks?.activate(mode);workspace?.afterTab();renderLayout();},()=>workspace?.beforeTab(),rigInspector.row);
|
|
1479
|
-
viewDisposers.push(bindHeaderModeAvailability(partsSubject?{model:false,parts:true}:{model:!!data.manifest.model,preRig:data.capabilities.preRig}));
|
|
1536
|
+
viewDisposers.push(bindHeaderModeAvailability(partsSubject?{model:false,parts:true}:{model:!!data.manifest.model,preRig:data.capabilities.preRig,parts:!!host?.record&&!data.manifest.model}));
|
|
1480
1537
|
for(const mode of document.querySelectorAll<HTMLButtonElement>('[data-mode]'))if(mode.dataset.mode==='rig'||mode.dataset.mode==='playback')mode.onclick=()=>showInspector(mode.dataset.mode!);
|
|
1481
1538
|
}
|
|
1482
1539
|
/** Pause at the held time and reveal the existing act without changing Setup/Animate mode. */
|
|
@@ -1503,10 +1560,10 @@ function redrawOverlay(fresh:boolean):void {
|
|
|
1503
1560
|
function syncPlayerLoop():void {
|
|
1504
1561
|
const want=canRepeatIdle();
|
|
1505
1562
|
if(!player?.current||player.composed||player.entry(0)?.loop===want)return;
|
|
1506
|
-
try{drawRig(()=>{player!.play(animation,{loop:want});if(!playing)player!.pause();player!.seek(time);player!.draw();});}
|
|
1563
|
+
try{drawRig(()=>{player!.play(animation,{loop:want});if(!playing)player!.pause();player!.seek(activeScene()?takeSample(activeScene()!,time).sourceTime:time);player!.draw();});}
|
|
1507
1564
|
catch(error){message(errorText(error),true);}
|
|
1508
1565
|
}
|
|
1509
|
-
function canRepeatIdle():boolean{return !!player&&idleAvailable(assets?.animations.map(a=>a.name)??[],animation)&&!axisInspection&&input('idle-repeat').checked&&duration>0;}
|
|
1566
|
+
function canRepeatIdle():boolean{const direction=activeScene();if(direction)return direction.take.loop;return !!player&&idleAvailable(assets?.animations.map(a=>a.name)??[],animation)&&!axisInspection&&input('idle-repeat').checked&&duration>0;}
|
|
1510
1567
|
function renderIdle():void {text('idle-state',canRepeatIdle()?'Actual idle · repeat enabled':animation==='idle'?'Idle repeat paused':'Non-idle inspection · no automatic playback');}
|
|
1511
1568
|
async function playPreview():Promise<void> {
|
|
1512
1569
|
if((!player&&!video&&!sequence)||duration<=0)return;
|
|
@@ -1542,15 +1599,15 @@ async function inspectControlTime(target:number,signal:AbortSignal,preserveSecon
|
|
|
1542
1599
|
if(signal.aborted)throw new Error('CONTROL_SUPERSEDED');
|
|
1543
1600
|
// #191: a control seek is a clip move like the transport's: a seek to 0 restarts the wind clock while the exported world is in use.
|
|
1544
1601
|
clipMoved({kind:'seek',to:target});
|
|
1545
|
-
const media=video;
|
|
1546
|
-
if(!media){if(player){player.seek(target);drawRig(()=>player!.draw());}
|
|
1602
|
+
const media=activeScene()?null:video;
|
|
1603
|
+
if(!media){time=target;if(player?.current){player.seek(activeScene()?takeSample(activeScene()!,target).sourceTime:target);drawRig(()=>player!.draw());}renderSequenceFrame();renderTransport();return;}
|
|
1547
1604
|
if(media.readyState<1||target>media.duration)throw new Error('CONTROL_REFERENCE_UNAVAILABLE');
|
|
1548
1605
|
const previousPosition=media.currentTime;
|
|
1549
1606
|
const commit=(actual:number)=>{
|
|
1550
1607
|
if(signal.aborted||media!==video)throw new Error('CONTROL_SUPERSEDED');
|
|
1551
1608
|
if(!Number.isFinite(actual)||actual<0||actual>duration)throw new Error('CONTROL_TIME_OUTSIDE_DOMAIN');
|
|
1552
1609
|
const seconds=preserveSeconds?target:actual;
|
|
1553
|
-
if(player){player.seek(seconds);drawRig(()=>player!.draw());}time=seconds;
|
|
1610
|
+
if(player?.current){player.seek(seconds);drawRig(()=>player!.draw());}time=seconds;
|
|
1554
1611
|
controlledVideoSample={media,position:media.currentTime,time:actual};if(axisInspection&&duration>0){const axis=data.manifest.axes.find(item=>item.id===select('axis-select').value&&item.animation===animation);if(axis){const value=axis.min+actual/duration*(axis.max-axis.min);input('axis-value').value=String(value);text('axis-value-label',value.toFixed(3));}}renderSequenceFrame();renderTransport();
|
|
1555
1612
|
};
|
|
1556
1613
|
try{const actual=await decodedControlTime(media,target,signal);if(signal.aborted||media!==video)throw new Error('CONTROL_SUPERSEDED');commit(actual);if(Math.abs(actual-target)>1e-6)message(`Reference decoded ${actual.toFixed(4)} s · requested ${target.toFixed(4)} s. The rig and saved view use the decoded timestamp.`);}
|
|
@@ -1597,6 +1654,7 @@ async function inspectionReferenceInfo(id:string|null,signal:AbortSignal):Promis
|
|
|
1597
1654
|
/** One duration bound for validation and carried publication navigation. */
|
|
1598
1655
|
function inspectionTimeLimit(bookmark:InspectionBookmark,info:{duration:number|null}):number {
|
|
1599
1656
|
const selection=bookmark.selection;
|
|
1657
|
+
if(activeScene()&&bookmark.animation===data.scene?.animation)return activeScene()!.take.duration;
|
|
1600
1658
|
const clipDuration=bookmark.animation?assets?.animations.find(a=>a.name===bookmark.animation)?.duration:undefined,referenceId=selection.reference===undefined?select('reference-select').value:selection.reference,isVideo=data.manifest.references.find(r=>r.id===referenceId)?.type==='video';
|
|
1601
1659
|
return clipDuration===undefined?info.duration??0:isVideo&&info.duration!==null?Math.min(clipDuration,info.duration):clipDuration;
|
|
1602
1660
|
}
|
|
@@ -1631,7 +1689,7 @@ async function applyInspection(bookmark:InspectionBookmark,signal:AbortSignal,pr
|
|
|
1631
1689
|
if(selection.checkpoint!==undefined){checkpoint=data.manifest.checkpoints.find(c=>c.id===selection.checkpoint);renderCheckpoint();renderCheckpoints();}
|
|
1632
1690
|
if(selection.reference!==undefined&&select('reference-select').value!==(selection.reference??'')){select('reference-select').value=selection.reference??'';await showReference(selection.reference??'');if(selection.reference&&!referenceSize&& !video)throw new Error('Saved reference did not load');}
|
|
1633
1691
|
if(bookmark.animation&&player)chooseAnimation(bookmark.animation);
|
|
1634
|
-
else if(player){player
|
|
1692
|
+
else if(player){restartSetupPlayer(true);player!.clear();animation='';duration=0;time=0;select('animation-select').value='';}
|
|
1635
1693
|
if(selection.axis){select('axis-select').value=selection.axis.id;chooseAxis();input('axis-value').value=String(selection.axis.value);applyAxis();}
|
|
1636
1694
|
if(selection.partSet!==undefined&&player){if(selection.partSet||player.sets().length)player.setSet(selection.partSet||null);select('part-set').value=selection.partSet??'';}
|
|
1637
1695
|
if(bookmark.time!==null){if(video&&video.readyState<1)await waitReferenceMetadata(video,signal);await inspectControlTime(bookmark.time,signal,preserveSeconds);}
|
|
@@ -2677,10 +2735,9 @@ async function swapRig(modelUrl:string,prefix:string,sha256:string,world:StageWo
|
|
|
2677
2735
|
inspectionSourceState='pending';partModel=null;pause();refreshAnimationInspection();
|
|
2678
2736
|
const next=await loadModel({modelUrl,...stageLoadInputs(modelUrl,sha256),resolvePage:(name,url)=>{const target=new URL(name,url);if(target.origin!==location.origin||!target.pathname.startsWith(prefix))throw new Error(`Model page escapes its build: ${name}`);return target.href;}}).catch(error=>{inspectionSourceState='failed';refreshAnimationInspection();throw error;});
|
|
2679
2737
|
physicsPanel?.clearPreview();
|
|
2680
|
-
pause();player?.dispose();assets?.dispose();assets=next;player=
|
|
2738
|
+
pause();player?.dispose();assets?.dispose();assets=next;player=createInspectionPlayer(el('rig-root'),assets);setupChestWorld=readSetupChest(player);stageModelHash=sha256;stageSource={url:modelUrl,prefix,hash:sha256};
|
|
2681
2739
|
// A scratch build may hold another set of animations (a retarget adds one, #114): the picker lists what this build has.
|
|
2682
2740
|
{const animations=select('animation-select');animations.replaceChildren(...assets.animations.map(item=>option(item.name,data.manifest.animations.find(a=>a.id===item.name)?.label??item.name)));animations.disabled=assets.animations.length===0;}
|
|
2683
|
-
player.on('event',event=>{text('event-log',`Runtime event: ${event.name} · ${event.time.toFixed(2)} s`);});
|
|
2684
2741
|
try{const catalog=await loadPartModel(modelUrl,sha256,data.feedbackCatalog.slots??[]);inspectionSourceState='ready';partModel=catalog.model;configureTurnPad(catalog.model);refreshAnimationInspection();weightsView?.refresh();meshEditor?.selectionChanged();parts?.register('single',catalog.entries,player,new PartThumbnails(pageRegionTable(catalog.model),assets.pageImages));}catch(error){inspectionSourceState='failed';partModel=null;refreshAnimationInspection();parts?.refuseCatalog('single',error);}
|
|
2685
2742
|
configurePartSets(keepSet);
|
|
2686
2743
|
// The same world before the first pose: a physics Apply resumes the wind (clock and pulse), the pending jolts, gravity and
|
|
@@ -2858,14 +2915,15 @@ function commentCaptureRefusal():string|null {
|
|
|
2858
2915
|
return preview?`COMMENT_UNAPPLIED_PREVIEW: ${preview} is active; leave or disable that preview before commenting (nothing is cleared or applied automatically)`:null;
|
|
2859
2916
|
}
|
|
2860
2917
|
function setupComments():void {
|
|
2861
|
-
|
|
2918
|
+
if(host?.direction||host?.record){restoreRecordComments();liveIssueCount=()=>recordComments.length;if(host?.direction)dirty=dirty||recordComments.length>0;}
|
|
2919
|
+
comments=bindStageComments<CommentRow,CommentPose>({general:host?.record||host?.direction?{create:summary=>({id:crypto.randomUUID(),summary}),matches:row=>!('target' in row)}:undefined,listHost:el('comments-list-host'),toolbar:el('stage-comment').parentElement!,viewports:host?.record&&!host.record.hasPicture?{}:{rig:el('rig-viewport'),reference:el('reference-viewport')},
|
|
2862
2920
|
pose:view=>{
|
|
2863
2921
|
if(view!=='rig'&&view!=='reference')return null;const workspaceMode=document.querySelector<HTMLElement>('[data-mode][aria-pressed="true"]')?.dataset.mode;if(workspaceMode!=='rig'&&workspaceMode!=='playback')return null;const camera=numericView().cameras[view],pane=el(view+'-viewport');if(!camera||pane.clientWidth<=0||pane.clientHeight<=0)return null;
|
|
2864
2922
|
const renderer=player?.renderer;const current=time,index=frameAtTime(activeFrameClock(),current),referenceId=view==='reference'?select('reference-select').value||null:null,referenceHash=referenceId?data.referenceHashes?.[referenceId]??(data.explicitReference?.id===referenceId?data.explicitReference.sha256:null):null;
|
|
2865
2923
|
return {mode:workspaceMode==='playback'?'animate':'setup',capture:{pane,root:view==='rig'?el('rig-root'):undefined,images:view==='reference'||layers.images,canvas:view==='rig'&&renderer instanceof CanvasRenderer?renderer.canvas:undefined,backend:renderer instanceof CanvasRenderer?renderer.backendActive:renderer?.meshBackendActive??'canvas2d'},camera,frame:index===null?null:{index,basis:'producer'},...(index===null?{timeBasis:timeOnlyBasis}:{}),time:current,animation:animation||null,turn:turnPad?.snapshot()??null,sourceHash:data.sourceHash,modelHash:view==='reference'?null:stageModelHash,referenceHash,referenceId,rig:data.manifest.id,...(view==='reference'?{media:video??el('reference-content').querySelector('img')??undefined}:{posed:parts?.frame('single'),assets:assets??undefined})} as CommentPose;
|
|
2866
2924
|
},
|
|
2867
|
-
pause:async()=>{const running=playing||!!video&&!video.paused;pause();if(running&&video&&video.readyState>=1){seekingControl=true;try{await inspectControlTime(time,new AbortController().signal);}finally{seekingControl=false;}}if(turnPad)turnPad.restore({...turnPad.snapshot(),held:true},false);},bookmark:inspectionBookmark,restore:(b,timed)=>restoreInspection(parseBookmark(b,inspectionBinding()),new AbortController().signal,!!timed),feedback:()=>host?.record?recordComments:session.feedback,
|
|
2868
|
-
locked:host?.record?()=>false:isSubmittedFeedback,add:f=>{if(host?.record)recordComments.push(f);else session.feedback.push(f as Feedback);},changed:()=>{if(host?.record){recordCommentsChanged();return;}markDirty();renderProposals();persistence?.save();},error:value=>message(value,true),
|
|
2925
|
+
pause:async()=>{const running=playing||!!video&&!video.paused;pause();if(running&&video&&video.readyState>=1){seekingControl=true;try{await inspectControlTime(time,new AbortController().signal);}finally{seekingControl=false;}}if(turnPad)turnPad.restore({...turnPad.snapshot(),held:true},false);},bookmark:inspectionBookmark,restore:(b,timed)=>restoreInspection(parseBookmark(b,inspectionBinding()),new AbortController().signal,!!timed),feedback:()=>host?.record||host?.direction?recordComments:session.feedback,
|
|
2926
|
+
locked:host?.record?()=>false:host?.direction?id=>submittedDirectionComments.has(id):isSubmittedFeedback,add:f=>{if(host?.record||host?.direction)recordComments.push(f);else session.feedback.push(f as Feedback);},changed:()=>{if(host?.record||host?.direction){recordCommentsChanged();if(host?.direction){markDirty();comments?.refresh();}return;}markDirty();renderProposals();persistence?.save();},error:value=>message(value,true),
|
|
2869
2927
|
refusal:()=>host?.record&&!host.record.hasPicture?null:commentCaptureRefusal(),blocked:()=>saving||!!persistence?.restoring()||seekingControl||!!video?.seeking||!!rebuildBusy||!!appliedOnStage,shortcutBlocked:()=>!!meshEditor?.active()
|
|
2870
2928
|
});
|
|
2871
2929
|
}
|
|
@@ -3008,7 +3066,7 @@ async function prepareStageDraftBuild(
|
|
|
3008
3066
|
// Release the previous renderer's root clip while retaining its pose and views for rollback.
|
|
3009
3067
|
prevPlayer?.renderer.render({order:[]});
|
|
3010
3068
|
rigRoot.replaceChildren();
|
|
3011
|
-
nextPlayer=
|
|
3069
|
+
nextPlayer=createInspectionPlayer(rigRoot,nextAssets);
|
|
3012
3070
|
// A fresh player's draw has no held pose. Clearing track 0 publicly poses Setup.
|
|
3013
3071
|
nextPlayer.clear();
|
|
3014
3072
|
const nextSetupChest=readSetupChest(nextPlayer);
|
|
@@ -3045,7 +3103,6 @@ async function prepareStageDraftBuild(
|
|
|
3045
3103
|
animSelect.disabled=nextAssets.animations.length===0;
|
|
3046
3104
|
animSelect.value='';
|
|
3047
3105
|
}
|
|
3048
|
-
nextPlayer.on('event',event=>{text('event-log',`Runtime event: ${event.name} · ${event.time.toFixed(2)} s`);});
|
|
3049
3106
|
if(partSetNode)configurePartSets(keepSet);
|
|
3050
3107
|
if(options?.world){
|
|
3051
3108
|
wind.resume(options.world.wind);
|
|
@@ -3170,4 +3227,4 @@ return {dispose:disposeScreen};
|
|
|
3170
3227
|
}
|
|
3171
3228
|
|
|
3172
3229
|
// Package entries mount directly; the live host invokes this same composition for each publication.
|
|
3173
|
-
if(!rigHost())mountRigScreen();
|
|
3230
|
+
if(!rigHost()){if(/^\/jobs\/[^/]+\/$/.test(location.pathname))void mountJobScreen(document.body);else mountRigScreen();}
|
|
@@ -3,6 +3,12 @@ import {createViewportController,createViewportState,type ViewportState,type Vie
|
|
|
3
3
|
import {t} from './i18n.ts';
|
|
4
4
|
|
|
5
5
|
interface PartsFrame {w:number;h:number;world?:{box:{x:number;y:number;width:number;height:number};origin:{x:number;y:number};scale:{x:number;y:number}}}
|
|
6
|
+
/** Decode the response already checked by the caller, without retaining an object URL. */
|
|
7
|
+
export async function loadViewportImage(response:Response):Promise<HTMLImageElement>{
|
|
8
|
+
const url=URL.createObjectURL(await response.blob());
|
|
9
|
+
try{const image=new Image();image.src=url;await image.decode();return image;}
|
|
10
|
+
finally{URL.revokeObjectURL(url);}
|
|
11
|
+
}
|
|
6
12
|
export interface PartsViewportHost {el:ViewportProvider['el'];canvas:HTMLCanvasElement;message:ViewportProvider['message'];reference:()=>HTMLCanvasElement|null;frameSize:(target:CameraTarget)=>PartsFrame|null}
|
|
7
13
|
export function createPartsViewportProvider(host:PartsViewportHost,state:ViewportState):ViewportProvider {
|
|
8
14
|
let dimensionProbe:HTMLCanvasElement|undefined;
|
|
@@ -89,9 +95,8 @@ export function bindPartsSubject(host:{
|
|
|
89
95
|
const assembled=()=>!solo||selected===null;
|
|
90
96
|
const box=():Box=>assembled()&&data.rigSize?{name:'',index:0,x:0,y:0,w:data.rigSize[0],h:data.rigSize[1]}:item();
|
|
91
97
|
const loadImage=async(path:string):Promise<HTMLImageElement>=>{
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
finally{URL.revokeObjectURL(url);}
|
|
98
|
+
const image=await loadViewportImage(await host.request(path));
|
|
99
|
+
if(disposed)throw new Error('PARTS_PAINT_FAILED');return image;
|
|
95
100
|
};
|
|
96
101
|
const image=(entry:Item)=>{let pending=images.get(entry.index);if(!pending){pending=loadImage(`${host.base}/image/${entry.index}`);images.set(entry.index,pending);}return pending;};
|
|
97
102
|
const painting=()=>original??=loadImage(host.paintingPath);
|
|
@@ -58,14 +58,14 @@ export interface RetainedSubjectItem {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** Shared composition preserves each host's original header status, rows and retained stage. */
|
|
61
|
-
export function mountRetainedWorkspace(options: {root: HTMLElement; kind: '
|
|
61
|
+
export function mountRetainedWorkspace(options: {root: HTMLElement; kind: 'owner'}) {
|
|
62
62
|
const {root, kind} = options;
|
|
63
63
|
root.dataset.retainedWorkspace = kind;
|
|
64
|
-
const shell = mountWorkspaceShell({compatibility:
|
|
64
|
+
const shell = mountWorkspaceShell({compatibility: 'legacyOwnerStep6'});
|
|
65
65
|
const {header, title} = shell, language = shell.language!;
|
|
66
66
|
const {message} = mountStatusBar({placement: 'inline', message: shell.status!});
|
|
67
|
-
const list = panelMake('nav', {className:
|
|
68
|
-
const stage = panelMake('main', {className:
|
|
67
|
+
const list = panelMake('nav', {className: 'owner-list'});
|
|
68
|
+
const stage = panelMake('main', {className: 'owner-stage'});
|
|
69
69
|
root.replaceChildren(header, list, stage);
|
|
70
70
|
function render(view: {
|
|
71
71
|
lang: string;
|
|
@@ -93,9 +93,9 @@ export function mountRetainedWorkspace(options: {root: HTMLElement; kind: 'hub'
|
|
|
93
93
|
for (const [name, value] of Object.entries(item.dataset)) button.dataset[name] = value;
|
|
94
94
|
button.setAttribute('aria-pressed', String(item.key === view.selected));
|
|
95
95
|
const label = panelMake('span', {textContent: item.label});
|
|
96
|
-
|
|
97
|
-
const state = panelMake('span', {className:
|
|
98
|
-
const detail = panelMake('span', {className:
|
|
96
|
+
label.className = 'owner-target-title';
|
|
97
|
+
const state = panelMake('span', {className: 'owner-target-status', textContent: item.state});
|
|
98
|
+
const detail = panelMake('span', {className: 'owner-target-animation', textContent: item.detail ?? ''});
|
|
99
99
|
button.append(label, state, detail);
|
|
100
100
|
button.onclick = item.onSelect;
|
|
101
101
|
list.append(button);
|
package/web/rig-host.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface RigHostScreen {
|
|
|
26
26
|
stage(): RigHostStage | null;
|
|
27
27
|
/** Draw the held frame again so the posed frame and the player share one generation. */
|
|
28
28
|
redraw(): void;
|
|
29
|
-
message(text: string, error?: boolean): void;
|
|
29
|
+
message(text: string, error?: boolean, diagnostic?: string): void;
|
|
30
30
|
pendingSubjects?(subjects:readonly PendingAskV3['subject'][]):void;
|
|
31
31
|
recordForms?(forms:readonly HTMLFormElement[]):void;
|
|
32
32
|
}
|
|
@@ -38,10 +38,12 @@ export interface RigHostCommit {
|
|
|
38
38
|
}
|
|
39
39
|
export interface RigHost {
|
|
40
40
|
readonly subject?:'parts';
|
|
41
|
+
readonly unavailable?:string;
|
|
42
|
+
readonly direction?:{readonly publicationId:string;readonly sourceHash:string};
|
|
41
43
|
readonly navigation?:RigHostNavigation;
|
|
42
44
|
/** Derived from the displayed subject's finalized verdict; never a mode or another subject's act. */
|
|
43
45
|
reviewState?(issues:number,sending:boolean):string;
|
|
44
|
-
readonly record?:{readonly label:string;readonly sourceHash:string;readonly hasPicture:boolean};
|
|
46
|
+
readonly record?:{readonly publicationId?:string;readonly label:string;readonly sourceHash:string;readonly hasPicture:boolean};
|
|
45
47
|
submitParts?(issues:readonly PartsIssue[]):Promise<string>;
|
|
46
48
|
readonly access: InstanceAccess;
|
|
47
49
|
/** UI act authority is separate from a retained backdrop's immutable source access. */
|
|
@@ -51,7 +53,7 @@ export interface RigHost {
|
|
|
51
53
|
/** A read the host answers itself, or undefined to fetch it from the subject's routes. */
|
|
52
54
|
read(path: string, method: string): Promise<unknown> | undefined;
|
|
53
55
|
/** The act bar's Submit review: the session's decisions go out as the pending asks' acts. */
|
|
54
|
-
submit(session: ReviewSession, committed: (commit: RigHostCommit) => void | Promise<void
|
|
56
|
+
submit(session: ReviewSession, committed: (commit: RigHostCommit) => void | Promise<void>, directionWords?:string): Promise<string>;
|
|
55
57
|
attach(screen: RigHostScreen): void;
|
|
56
58
|
/** The first rig draw is on screen (or the open failed): the job acknowledges the display after it. */
|
|
57
59
|
displayed(): void;
|