rig-review 4.10.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/DESIGN.md +1 -1
- package/docs/PANELS.md +3 -1
- package/docs/REVIEW_PACKAGE.md +54 -15
- package/docs/STABILITY.md +10 -0
- package/package.json +1 -1
- package/src/cloth-recipe.ts +27 -7
- package/src/job-api.ts +17 -7
- package/src/job-checkpoint-evidence.ts +17 -0
- package/src/job-contract.ts +15 -2
- package/src/job-front.ts +29 -4
- package/src/job-source.ts +24 -7
- package/src/open-workspace-state.ts +6 -1
- package/src/open.ts +3 -3
- package/src/rebuild.ts +42 -10
- package/web/catalog-en.ts +5 -0
- package/web/catalog-ko.ts +30 -25
- package/web/cloth-panel.ts +1 -1
- package/web/compare.css +1 -1
- package/web/environment-world.ts +9 -0
- package/web/job-rig-screen.ts +10 -8
- package/web/job-session.ts +30 -25
- package/web/main.ts +38 -27
- package/web/parts-viewport-provider.ts +2 -2
- package/web/rebuild-client.ts +1 -1
- package/web/rig-host.ts +1 -1
- package/web/rig-viewport-provider.ts +4 -5
- package/web/stage-comments.ts +3 -1
- package/web/styles.css +2 -2
- package/web/viewport-controller.ts +4 -0
- package/web/workspace-ui.ts +3 -3
package/web/job-session.ts
CHANGED
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
import {enCatalog} from './catalog-en.ts';
|
|
24
24
|
import {koCatalog} from './catalog-ko.ts';
|
|
25
25
|
import {t,onLanguageChange} from './i18n.ts';
|
|
26
|
-
import type
|
|
26
|
+
import {hashCapabilityAccess, type InstanceAccess} from './instance-access.ts';
|
|
27
27
|
import {JOB_PLAN_TEXT_FIELDS, parseJobPlanTextProjection, type JobPlanTextProjection} from '../src/job-contract.ts';
|
|
28
28
|
import {createJobRigScreen, type JobRigScreenPrepared} from './job-rig-screen.ts';
|
|
29
29
|
import type {JobRigPresentation} from './viewport-capture.ts';
|
|
@@ -413,27 +413,9 @@ export function jobWindowAccess(href: string, storage: Pick<Storage, 'getItem' |
|
|
|
413
413
|
const jobId = match[1]!;
|
|
414
414
|
const base = url.pathname;
|
|
415
415
|
const slot = 'rig-review-job-capability/1:' + jobId;
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
if (/^[a-f0-9]{64}$/.test(value))
|
|
420
|
-
capability = value;
|
|
421
|
-
url.hash = '';
|
|
422
|
-
replace(url.href);
|
|
423
|
-
try {
|
|
424
|
-
if (capability)
|
|
425
|
-
storage?.setItem(slot, capability);
|
|
426
|
-
}
|
|
427
|
-
catch { /* Memory-only capability when storage is denied. */ }
|
|
428
|
-
}
|
|
429
|
-
if (!capability) {
|
|
430
|
-
try {
|
|
431
|
-
const saved = storage?.getItem(slot);
|
|
432
|
-
if (saved && /^[a-f0-9]{64}$/.test(saved))
|
|
433
|
-
capability = saved;
|
|
434
|
-
}
|
|
435
|
-
catch { /* A copied link remains read-only. */ }
|
|
436
|
-
}
|
|
416
|
+
const capability = hashCapabilityAccess(url, slot, () => storage, replace, {
|
|
417
|
+
strip: 'cap-before-storage', storedValue: 'validate', fallback: null,
|
|
418
|
+
});
|
|
437
419
|
return {
|
|
438
420
|
jobId, base, capability,
|
|
439
421
|
route(path) {
|
|
@@ -863,6 +845,8 @@ export interface JobPreparedInspection {
|
|
|
863
845
|
images: readonly HTMLImageElement[];
|
|
864
846
|
}[];
|
|
865
847
|
references: JobReferenceView[];
|
|
848
|
+
/** #983: the record plan's declared picture, hash-checked and decoded; the record screen draws it first. */
|
|
849
|
+
planPicture?: {name: string; src: string};
|
|
866
850
|
assets: ModelAssets | null;
|
|
867
851
|
player: RigPlayer | null;
|
|
868
852
|
rigRoot: HTMLElement;
|
|
@@ -871,7 +855,19 @@ export interface JobPreparedInspection {
|
|
|
871
855
|
setupPose(setup?: boolean): void;
|
|
872
856
|
dispose(): void;
|
|
873
857
|
}
|
|
858
|
+
/** One request per resource per preparation (#1050). Every caller in one preparation passes the same signal; a
|
|
859
|
+
* later preparation (a republish, a reload) brings a new signal and so a new request. The URL carries the
|
|
860
|
+
* publication id and instance key, so a republished resource never shares an older promise. */
|
|
861
|
+
const jobBytesBySignal = new WeakMap<AbortSignal, Map<string, Promise<Uint8Array<ArrayBuffer>>>>();
|
|
874
862
|
async function jobBytes(url: string, signal: AbortSignal, maximum: number, refusal?: { status: number; code: string }): Promise<Uint8Array<ArrayBuffer>> {
|
|
863
|
+
let shared = jobBytesBySignal.get(signal);
|
|
864
|
+
if (!shared) jobBytesBySignal.set(signal, shared = new Map());
|
|
865
|
+
const key = `${url}\n${maximum}\n${refusal ? `${refusal.status}:${refusal.code}` : ''}`;
|
|
866
|
+
let pending = shared.get(key);
|
|
867
|
+
if (!pending) shared.set(key, pending = readJobBytes(url, signal, maximum, refusal));
|
|
868
|
+
return (await pending).slice();
|
|
869
|
+
}
|
|
870
|
+
async function readJobBytes(url: string, signal: AbortSignal, maximum: number, refusal?: { status: number; code: string }): Promise<Uint8Array<ArrayBuffer>> {
|
|
875
871
|
const response = await fetch(url, { signal });
|
|
876
872
|
if (!response.ok || !response.body) {
|
|
877
873
|
void response.body?.cancel().catch(() => {});
|
|
@@ -907,7 +903,7 @@ async function jobDigest(bytes: Uint8Array<ArrayBuffer>): Promise<string> {
|
|
|
907
903
|
return [...new Uint8Array(await crypto.subtle.digest('SHA-256', bytes))]
|
|
908
904
|
.map(value => value.toString(16).padStart(2, '0')).join('');
|
|
909
905
|
}
|
|
910
|
-
async function jobJson<Value>(url: string, signal: AbortSignal, refusal?: { status: number; code: string }): Promise<Value> {
|
|
906
|
+
export async function jobJson<Value>(url: string, signal: AbortSignal, refusal?: { status: number; code: string }): Promise<Value> {
|
|
911
907
|
const bytes = await jobBytes(url, signal, 2 * 1024 * 1024, refusal);
|
|
912
908
|
return JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes)) as Value;
|
|
913
909
|
}
|
|
@@ -1218,6 +1214,13 @@ export async function prepareJobInspection(display: DisplayPublicationV3, signal
|
|
|
1218
1214
|
preload.push(image(routes.api('stage-parts/page/' + page.index))
|
|
1219
1215
|
.then(element => { partPages.set(page.index, element); }));
|
|
1220
1216
|
}
|
|
1217
|
+
let planPicture: {name: string; src: string} | undefined;
|
|
1218
|
+
const declaredPlanPicture = record && publishedSource.subject === 'plan' ? publishedSource.planPicture : undefined;
|
|
1219
|
+
if (preloadVisuals && declaredPlanPicture) {
|
|
1220
|
+
preload.push(image(routes.api('plan-picture'), declaredPlanPicture.sha256).then(element => {
|
|
1221
|
+
planPicture = {name: declaredPlanPicture.path.split('/').at(-1)!, src: element.src};
|
|
1222
|
+
}));
|
|
1223
|
+
}
|
|
1221
1224
|
const preloaded = await Promise.allSettled(preload);
|
|
1222
1225
|
const failed = preloaded.find(result => result.status === 'rejected');
|
|
1223
1226
|
if (failed?.status === 'rejected')
|
|
@@ -1264,6 +1267,7 @@ export async function prepareJobInspection(display: DisplayPublicationV3, signal
|
|
|
1264
1267
|
references.sort((a, b) => order.indexOf(a.id) - order.indexOf(b.id));
|
|
1265
1268
|
return {
|
|
1266
1269
|
display, metadata, interview, parts, partImages, partPages, checkpointEvidence, references, assets, rigRoot,
|
|
1270
|
+
...(planPicture ? {planPicture} : {}),
|
|
1267
1271
|
get rigPresentation() { return rigPresentation; },
|
|
1268
1272
|
set rigPresentation(value) {
|
|
1269
1273
|
clearRigPresentation();
|
|
@@ -1388,11 +1392,12 @@ export function createJobFormHelpers(node: JobFormNode, t: typeof import('./i18n
|
|
|
1388
1392
|
const issue = row.issues.find(issue => issue.field === field);
|
|
1389
1393
|
if (issue) value.append(node('span', 'job.plan.field.' + issue.reason));
|
|
1390
1394
|
else if (field === 'rests_on') {
|
|
1391
|
-
const rests = node('ul');
|
|
1395
|
+
const rests = node('ul'), questions = projection?.status === 'projected' ? projection.questions : undefined;
|
|
1392
1396
|
for (const text of row.rests_on!) {
|
|
1393
1397
|
const rest = node('li'), dependency = plan.steps.find(step => step.id === text);
|
|
1398
|
+
const question = !dependency && questions && Object.hasOwn(questions, text) ? questions[text] : undefined;
|
|
1394
1399
|
if (dependency) {planStepText(rest, dependency, projection); rest.title = text;}
|
|
1395
|
-
else {rest.textContent = text; rest.setAttribute('translate', 'no');}
|
|
1400
|
+
else {rest.textContent = question ?? text; if (question !== undefined) rest.title = text; rest.setAttribute('translate', 'no');}
|
|
1396
1401
|
rests.append(rest);
|
|
1397
1402
|
}
|
|
1398
1403
|
value.append(rests);
|
package/web/main.ts
CHANGED
|
@@ -72,7 +72,7 @@ import {createWindModel,environmentFor,windReadout,RUNTIME_START_READOUT,joltPac
|
|
|
72
72
|
import {tuningRows,readoutRows,type InspectedCheckView} from '../src/physics-tuning.ts';
|
|
73
73
|
import {bindReadingsPanel,type ReadingsJobView,type ReadingsPanel,type ReadingsRefusal} from './readings-panel.ts';
|
|
74
74
|
import {READINGS_SCHEMA,readingSeekTime,type ReadingsContext} from '../src/readings.ts';
|
|
75
|
-
import {
|
|
75
|
+
import {windClockOnMove,type ClipMove,environmentCheckRows,scheduleContext,worldExport,type EnvironmentCheckView,type WorldExport} from './environment-world.ts';
|
|
76
76
|
import {barLine,beforeLine} from '../src/physics-tuning.ts';
|
|
77
77
|
import {bindRequirementsPanel,type RequirementsCatalogView,type RequirementsJobView,type RequirementsPanel,type RequirementsRefusal} from './requirements-panel.ts';
|
|
78
78
|
import {patchRoute} from '../src/retune-route.ts';
|
|
@@ -867,19 +867,26 @@ function configureTurnPad(model:unknown):void {
|
|
|
867
867
|
if(previous&&turnPad){try{turnPad.restore(previous);}catch{message('TURN_STATE_MODEL_MISMATCH: turn values reset for this build.',true);}}
|
|
868
868
|
workspace?.refresh();
|
|
869
869
|
}
|
|
870
|
-
/** Verify the same response consumed by Play, rather than a second read of its source.
|
|
870
|
+
/** Verify the same response consumed by Play, rather than a second read of its source. One request per input per
|
|
871
|
+
* load (#1050): the verified response is kept for this load, and the part catalog and model document read it again
|
|
872
|
+
* through the same fetch. A new load (a rebuild, another build) calls this again and gets a fresh request. */
|
|
871
873
|
function stageLoadInputs(modelUrl:string, modelHash:string) {
|
|
872
874
|
const setsUrl=modelUrl===inspectedModel?.url&&data.manifest.sets&&data.setsHash
|
|
873
875
|
?new URL(assetUrl(data.manifest.sets),location.href).href:null;
|
|
876
|
+
const verified=new Map<string,Promise<Response>>();
|
|
874
877
|
const checkedFetch=new Proxy(fetch,{apply:async(_target,_this,args:Parameters<typeof fetch>)=>{
|
|
875
|
-
const
|
|
878
|
+
const url=String(args[0]),expected=url===modelUrl?modelHash:url===setsUrl?data.setsHash:null;
|
|
876
879
|
if(!expected)throw new Error('DIRECTION_SOURCE_CHANGED: undeclared playback input');
|
|
877
|
-
|
|
878
|
-
if(!
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
880
|
+
let pending=verified.get(url);
|
|
881
|
+
if(!pending){pending=(async()=>{
|
|
882
|
+
const response=await fetch(...args);
|
|
883
|
+
if(!response.ok)return response;
|
|
884
|
+
const bytes=await response.arrayBuffer();
|
|
885
|
+
const sha256=Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256',bytes)),v=>v.toString(16).padStart(2,'0')).join('');
|
|
886
|
+
if(sha256!==expected)throw new Error('DIRECTION_SOURCE_CHANGED: playback bytes differ from the bound SHA-256');
|
|
887
|
+
return new Response(bytes,{status:response.status,statusText:response.statusText,headers:response.headers});
|
|
888
|
+
})();verified.set(url,pending);}
|
|
889
|
+
return (await pending).clone();
|
|
883
890
|
}});
|
|
884
891
|
return {setsUrl,fetch:checkedFetch};
|
|
885
892
|
}
|
|
@@ -914,14 +921,15 @@ async function initPlayer(initialCheckpoint?:Checkpoint): Promise<void> {
|
|
|
914
921
|
try {
|
|
915
922
|
const modelUrl = new URL(assetUrl(data.manifest.model), location.href).href;
|
|
916
923
|
inspectedModel={url:modelUrl,prefix:access.route('/assets/'),sha256:data.reviewedSource.rig?.sha256??''};stageModelHash=inspectedModel.sha256||null;
|
|
917
|
-
|
|
924
|
+
const inputs=stageLoadInputs(modelUrl,inspectedModel.sha256);
|
|
925
|
+
assets = await loadModel({ modelUrl, ...inputs, resolvePage: (name, url) => {
|
|
918
926
|
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;
|
|
919
927
|
} });
|
|
920
928
|
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;}
|
|
921
929
|
player = createInspectionPlayer(el('rig-root'), assets,sceneComposite?'canvas':undefined);
|
|
922
930
|
setupChestWorld = readSetupChest(player);
|
|
923
931
|
// Parts inspection is an add-on: a catalog refusal is shown in the explorer and never aborts the rig.
|
|
924
|
-
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);}
|
|
932
|
+
try{const catalog=await loadPartModel(modelUrl,data.reviewedSource.rig!.sha256,data.feedbackCatalog.slots??[],inputs.fetch);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);}
|
|
925
933
|
const animations = select('animation-select'); animations.replaceChildren();
|
|
926
934
|
for (const item of assets.animations) animations.append(option(item.name, data.manifest.animations.find(a => a.id === item.name)?.label ?? item.name));
|
|
927
935
|
animations.disabled = assets.animations.length === 0 || !!data.scene;
|
|
@@ -935,7 +943,7 @@ async function initPlayer(initialCheckpoint?:Checkpoint): Promise<void> {
|
|
|
935
943
|
select('axis-select').replaceChildren(); for (const axis of validAxes) select('axis-select').append(option(axis.id, axis.label));
|
|
936
944
|
input('axis-value').disabled = !validAxes.length;
|
|
937
945
|
for(const id of ['layer-images','layer-mesh','layer-bones'])input(id).disabled=false;
|
|
938
|
-
enableEnvironment(modelUrl);
|
|
946
|
+
enableEnvironment(modelUrl,inputs.fetch);
|
|
939
947
|
describeLayerToggles(document,el('layer-state').textContent??'');
|
|
940
948
|
fitCamera();
|
|
941
949
|
} catch (error) { turnPad?.dispose();turnPad=null;document.getElementById('turn-pad-host')?.remove();text('renderer-state',rendererStatus(null,'failed').label);player?.dispose(); player = null; assets?.dispose(); assets = null; text('player-state', 'Rig load failed'); text('rig-empty', `Could not open rig: ${errorText(error)}`); message(errorText(error), true); }
|
|
@@ -1555,7 +1563,7 @@ async function startRecord(interview?:InterviewSubjectEntry):Promise<void> {
|
|
|
1555
1563
|
readOnly=tr(interview?'MODEL_UNAVAILABLE':'JOB_REVIEW_READ_ONLY');
|
|
1556
1564
|
if(!interview)actReadOnly=readOnlyReason(access,true,host?.ownerActAccess);
|
|
1557
1565
|
bindWorkspace();bindInspector(true);rigInput={state:'absent'};referenceInput={state:'absent'};renderLayout();
|
|
1558
|
-
parts=new PartExplorer(el('workspace-left'),el('selected-part'),()=>{},()=>{});text('checkpoints','No checkpoints supplied.');text('dirty','Not submitted');if(interview)message(unavailable);else message(actReadOnly??(host?.record?.questionPicture?'':unavailable),!!actReadOnly);
|
|
1566
|
+
parts=new PartExplorer(el('workspace-left'),el('selected-part'),()=>{},()=>{});text('checkpoints','No checkpoints supplied.');text('dirty','Not submitted');if(interview)message(unavailable);else message(actReadOnly??(host?.record?.questionPicture||host?.record?.planPicture?'':unavailable),!!actReadOnly);
|
|
1559
1567
|
text('package-title',interview?.label??host!.record!.label);text('revision','');text('source-hash',`source ${(interview?.sourceHash??host!.record!.sourceHash).slice(0,12)}`);
|
|
1560
1568
|
el('rig-pane').hidden=false;el('rig-empty').hidden=false;text('rig-empty',unavailable);
|
|
1561
1569
|
for(const region of document.querySelectorAll('.inspector,.workspace-secondary-toolbar'))for(const control of region.querySelectorAll<HTMLInputElement|HTMLSelectElement|HTMLTextAreaElement|HTMLButtonElement>('input,select,textarea,button')){
|
|
@@ -1746,7 +1754,7 @@ function recordCommentsChanged():void {
|
|
|
1746
1754
|
function syncQuestionImage():void {
|
|
1747
1755
|
if(disposed){releaseInterview?.();releaseInterview=null;return;}
|
|
1748
1756
|
const form=(questionForms.find(item=>!item.hidden)??questionForms[0]) as (HTMLElement&{interviewImages?:readonly {name:string;src:string}[]})|undefined;
|
|
1749
|
-
const images=form?.interviewImages;
|
|
1757
|
+
const images=form?.interviewImages??(host?.record?.planPicture?[host.record.planPicture]:undefined);
|
|
1750
1758
|
if(activeInterviewImages&&images?.length===activeInterviewImages.length&&images.every((image,index)=>{
|
|
1751
1759
|
const previous=activeInterviewImages![index]!;
|
|
1752
1760
|
return previous.name===image.name&&previous.src===image.src;
|
|
@@ -1761,7 +1769,7 @@ function syncQuestionImage():void {
|
|
|
1761
1769
|
for(const button of disabled.keys())button.disabled=false;
|
|
1762
1770
|
const cameraBindings=button('zoom-in').onclick?[]:[viewport.bindControls(unitScaleMessage),viewport.bindNavigation()];
|
|
1763
1771
|
activeInterviewImages=images;activeInterviewImage=images[0]!;
|
|
1764
|
-
const restore=controls.replaceViewSwitch({currentMode:'interview-image-0',groups:[{modes:images.map((
|
|
1772
|
+
const restore=controls.replaceViewSwitch({currentMode:'interview-image-0',groups:[{modes:images.map((_image,index)=>({id:'interview-image-'+index,labelKey:images.length>1?`Reference ${index+1}`:'Reference',pressed:index===0}))}],onChange:chooseInspectionView});
|
|
1765
1773
|
viewport.state.cameraSync=false;viewport.state.activeCamera='reference';view='reference';questionPanel.dataset.questionImageActive='true';
|
|
1766
1774
|
releaseInterview=()=>{
|
|
1767
1775
|
++referenceGeneration;activeInterviewImages=null;activeInterviewImage=null;delete questionPanel.dataset.questionImageActive;restore();
|
|
@@ -2312,7 +2320,8 @@ function stepEnvironment(dt:number):void {
|
|
|
2312
2320
|
if(environmentApplied())player.environment(environmentFor(wind.read(),gravityValue()));
|
|
2313
2321
|
renderEnvironment();
|
|
2314
2322
|
}
|
|
2315
|
-
|
|
2323
|
+
/** A standing world already in force is not set again: `environment` clears the player's seek replay cache (#935: a paused seek applies it). */
|
|
2324
|
+
function applyEnvironment():void {if(player&&environmentApplied()){const next=environmentFor(wind.read(),gravityValue()),now=player.environment();if(String(next.wind)!==String(now.wind)||String(next.gravity)!==String(now.gravity))player.environment(next);}renderEnvironment();}
|
|
2316
2325
|
function renderEnvironment():void {
|
|
2317
2326
|
if(!player)return;
|
|
2318
2327
|
const reading=wind.read();
|
|
@@ -2336,10 +2345,10 @@ function worldFor(name:string):WorldExport|{error:string} {
|
|
|
2336
2345
|
if(worldCache?.key!==key)worldCache={key,value:worldExport(wind.snapshot(),gravityValue(),environmentApplied(),name,clipDuration(name))};
|
|
2337
2346
|
return worldCache.value;
|
|
2338
2347
|
}
|
|
2339
|
-
/** A fresh wind clock at the same settings (a repeating gust restarts at 0)
|
|
2340
|
-
function restartWindClock():void {const now=wind.read().time;wind.restore(wind.snapshot());joltQueue=joltQueue.map(step=>({...step,at:Math.max(0,step.at-now)}));}
|
|
2341
|
-
/** #183: every clip restart
|
|
2342
|
-
function clipMoved(move:ClipMove):void {
|
|
2348
|
+
/** A fresh wind clock at the same settings (a repeating gust restarts at 0), advanced to `at`; pending jolts keep their distance in time. */
|
|
2349
|
+
function restartWindClock(at=0):void {const now=wind.read().time;wind.restore(wind.snapshot());if(at>0)wind.advance(at);joltQueue=joltQueue.map(step=>({...step,at:Math.max(0,step.at-now)+at}));}
|
|
2350
|
+
/** #183: every clip restart restarts the wind clock while the schedule is watched. #935: a paused seek sets it to the seek's time. */
|
|
2351
|
+
function clipMoved(move:ClipMove):void {const at=player?windClockOnMove(move,useWorld(),playing):null;if(at!==null){restartWindClock(at);applyEnvironment();}}
|
|
2343
2352
|
let scheduleShown='';
|
|
2344
2353
|
function renderSchedule():void {
|
|
2345
2354
|
const world=worldFor(animation),check=checkAnimation(),checked=check!==animation?worldFor(check):null;
|
|
@@ -2417,13 +2426,13 @@ function restoreEnvironment():void {
|
|
|
2417
2426
|
if(player){if(environmentApplied())applyEnvironment();else player.environment(null);}
|
|
2418
2427
|
}
|
|
2419
2428
|
function feedbackEnvironment(){return player?environmentJson(environmentContext(wind.read(),gravityValue(),environmentApplied(),player.environment())):null;}
|
|
2420
|
-
function enableEnvironment(modelUrl:string):void {
|
|
2429
|
+
function enableEnvironment(modelUrl:string,fetcher:typeof fetch):void {
|
|
2421
2430
|
for(const id of environmentInputs)el<HTMLInputElement|HTMLButtonElement>(id).disabled=false;
|
|
2422
2431
|
syncEnvironmentInputs();text('physics-panel-state','Reading the compiled model…');text('idle-tracks-state','Reading the compiled model…');
|
|
2423
2432
|
readingsPanel?.catalog(data.feedbackCatalog.slots??[],data.feedbackCatalog.bones??[]);readingsPanel?.status('Pick readings, then Run: each runs on the inspected build and on the latest scratch build.',false);
|
|
2424
2433
|
const rig=data.reviewedSource.rig;
|
|
2425
2434
|
if(!rig){inspectedDocumentReason='PHYSICS_TUNING_UNAVAILABLE: no reviewed rig identity';refreshPhysics();return;}
|
|
2426
|
-
void loadModelDocument(modelUrl,rig.sha256).then(loaded=>{if(loaded.ok)inspectedDocument=loaded.document;else inspectedDocumentReason=`PHYSICS_TUNING_UNAVAILABLE: ${loaded.reason}`;refreshPhysics();},error=>{inspectedDocumentReason=`PHYSICS_TUNING_UNAVAILABLE: ${errorText(error)}`;refreshPhysics();});
|
|
2435
|
+
void loadModelDocument(modelUrl,rig.sha256,fetcher).then(loaded=>{if(loaded.ok)inspectedDocument=loaded.document;else inspectedDocumentReason=`PHYSICS_TUNING_UNAVAILABLE: ${loaded.reason}`;refreshPhysics();},error=>{inspectedDocumentReason=`PHYSICS_TUNING_UNAVAILABLE: ${errorText(error)}`;refreshPhysics();});
|
|
2427
2436
|
}
|
|
2428
2437
|
/** The panel's rows: the inspected model's constraints against the handoff config's (both must be read). */
|
|
2429
2438
|
function refreshPhysics():void {
|
|
@@ -3252,7 +3261,8 @@ async function swapRig(modelUrl:string,prefix:string,sha256:string,world:StageWo
|
|
|
3252
3261
|
const keepRigCamera=structuredClone(viewport.paneCamera('rig')),keepReferenceCamera=structuredClone(viewport.paneCamera('reference'));
|
|
3253
3262
|
const keepAnimation=animation,keepTime=time,wasPlaying=playing,keepSet=select('part-set').disabled?'':select('part-set').value;
|
|
3254
3263
|
inspectionSourceState='pending';partModel=null;pause();refreshAnimationInspection();
|
|
3255
|
-
const
|
|
3264
|
+
const inputs=stageLoadInputs(modelUrl,sha256);
|
|
3265
|
+
const next=await loadModel({modelUrl,...inputs,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;});
|
|
3256
3266
|
const keepFraming=!!keepStage&&!!next.stage&&(['x','y','width','height'] as const).every(key=>keepStage[key]===next.stage![key]);
|
|
3257
3267
|
viewport.state.cameraRestoring=true;viewport.cancelFit();
|
|
3258
3268
|
// The fit-relative zoom also depends on the first-draw framing basis, not just the declared stage.
|
|
@@ -3261,7 +3271,7 @@ async function swapRig(modelUrl:string,prefix:string,sha256:string,world:StageWo
|
|
|
3261
3271
|
pause();player?.dispose();assets?.dispose();assets=next;player=createInspectionPlayer(el('rig-root'),assets);setupChestWorld=readSetupChest(player);stageModelHash=sha256;stageSource={url:modelUrl,prefix,hash:sha256};
|
|
3262
3272
|
// A scratch build may hold another set of animations (a retarget adds one, #114): the picker lists what this build has.
|
|
3263
3273
|
{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;}
|
|
3264
|
-
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);}
|
|
3274
|
+
try{const catalog=await loadPartModel(modelUrl,sha256,data.feedbackCatalog.slots??[],inputs.fetch);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);}
|
|
3265
3275
|
configurePartSets(keepSet);
|
|
3266
3276
|
// The same world before the first pose: a physics Apply resumes the wind (clock and pulse), the pending jolts, gravity and
|
|
3267
3277
|
// whether the controls are engaged as they stood when Apply was pressed; then the seek re-poses under that world.
|
|
@@ -3279,7 +3289,7 @@ async function swapRig(modelUrl:string,prefix:string,sha256:string,world:StageWo
|
|
|
3279
3289
|
if(keepFraming){viewport.writeCamera('rig',keepRigCamera);viewport.writeCamera('reference',keepReferenceCamera);fitCamera();}
|
|
3280
3290
|
else{viewport.state.cameraRestoring=cameraRestoring;viewport.requestFit();fitCamera();}
|
|
3281
3291
|
// The preview (#104) drives the new player once its bone setups are read (an idle Apply cleared it first).
|
|
3282
|
-
stageDocumentSet=true;void loadModelDocument(modelUrl,sha256).then(loaded=>{if(loaded.ok&&stageModelHash===sha256)idlePanel?.model(boneSetup(loaded.document));});
|
|
3292
|
+
stageDocumentSet=true;void loadModelDocument(modelUrl,sha256,inputs.fetch).then(loaded=>{if(loaded.ok&&stageModelHash===sha256)idlePanel?.model(boneSetup(loaded.document));});
|
|
3283
3293
|
if(wasPlaying)void playPreview();
|
|
3284
3294
|
}finally{viewport.state.cameraRestoring=cameraRestoring;stageCorrectionRebinding--;directionPanel?.refresh();}
|
|
3285
3295
|
}
|
|
@@ -3534,8 +3544,9 @@ async function prepareStageDraftBuild(
|
|
|
3534
3544
|
if(!nextModelHash)throw new Error(buildId==='inspected'?'STAGE_DRAFT_MISMATCH':'STAGE_DRAFT_STALE');
|
|
3535
3545
|
target=options?.target??await resolveStageDraftTarget(buildId);
|
|
3536
3546
|
if(target.buildId!==buildId||target.sha256!==nextModelHash||!target.url||!target.prefix)throw new Error('STAGE_DRAFT_MISMATCH');
|
|
3537
|
-
|
|
3538
|
-
|
|
3547
|
+
const inputs=stageLoadInputs(target.url,target.sha256);
|
|
3548
|
+
nextAssets=await loadModel({modelUrl:target.url,...inputs,resolvePage:(name,url)=>{const pageUrl=new URL(name,url);if(pageUrl.origin!==location.origin||!pageUrl.pathname.startsWith(target.prefix))throw new Error(`Model page escapes its build: ${name}`);return pageUrl.href;}});
|
|
3549
|
+
const loadedDoc=await loadModelDocument(target.url,target.sha256,inputs.fetch);
|
|
3539
3550
|
if(!loadedDoc.ok)throw new Error('PART_SOURCE_CHANGED: model bytes differ from reviewed SHA-256');
|
|
3540
3551
|
verifiedDoc=loadedDoc.document;
|
|
3541
3552
|
const rawSlots=verifiedDoc&&typeof verifiedDoc==='object'&&!Array.isArray(verifiedDoc)?(verifiedDoc as {slots?:unknown}).slots:null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Native image policy for the canonical pair. Camera gestures and writes belong to viewport-controller. */
|
|
2
|
-
import {createViewportController,createViewportState,type ViewportState,type ViewportController,type CameraTarget,type ViewportProvider} from './viewport-controller.ts';
|
|
2
|
+
import {createViewportController,createViewportState,formatZoomReadout,type ViewportState,type ViewportController,type CameraTarget,type ViewportProvider} from './viewport-controller.ts';
|
|
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}}}
|
|
@@ -45,7 +45,7 @@ export function createPartsViewportProvider(host:PartsViewportHost,state:Viewpor
|
|
|
45
45
|
if(target==='rig'){state.rigScale=c.zoom;state.displayedCenter={...center};}
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
renderControls:controller=>{const zoom=controller.paneCamera(controller.availableCamera()??'rig').zoom;host.el('zoom-value').textContent=
|
|
48
|
+
renderControls:controller=>{const zoom=controller.paneCamera(controller.availableCamera()??'rig').zoom;host.el('zoom-value').textContent=t(formatZoomReadout(controller));host.el('native-one').setAttribute('aria-pressed',String(zoom===1));(host.el('camera-sync') as HTMLInputElement).checked=state.cameraSync;host.el('fit').textContent=t('Fit');}
|
|
49
49
|
};
|
|
50
50
|
return provider;
|
|
51
51
|
}
|
package/web/rebuild-client.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type AnimationSourceView=import('../src/rebuild.ts').AnimationSourceStatu
|
|
|
29
29
|
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}[]}
|
|
30
30
|
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}
|
|
31
31
|
/** #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. */
|
|
32
|
-
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}
|
|
32
|
+
export interface ClothStatusView {targets:string[];targetsRead:boolean;targetsReason?:string|null;recipes:Record<string,unknown>|null;tags:import('../src/cloth-recipe.ts').ClothTagView[];keypoints:{path:string;sha256:string}|null;route:'build'|'rig';reason:string|null}
|
|
33
33
|
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}}
|
|
34
34
|
export interface RebuildRefusal {status:'refused';error:string;producerLine:string|null}
|
|
35
35
|
/** #99 regions or #105 landmarks: exactly one of `regions` and `bust`. */
|
package/web/rig-host.ts
CHANGED
|
@@ -49,7 +49,7 @@ export interface RigHost {
|
|
|
49
49
|
readonly navigation?:RigHostNavigation;
|
|
50
50
|
/** Derived from the displayed subject's finalized verdict; never a mode or another subject's act. */
|
|
51
51
|
reviewState?(issues:number,sending:boolean):string;
|
|
52
|
-
readonly record?:{readonly jobId?:string;readonly draftId?:string;readonly publicationId?:string;readonly previousPublicationId?:string|null;readonly label:string;readonly sourceHash:string;readonly hasPicture:boolean;readonly missingPicture?:'rig'|'scene';readonly questionPicture?:true};
|
|
52
|
+
readonly record?:{readonly jobId?:string;readonly draftId?:string;readonly publicationId?:string;readonly previousPublicationId?:string|null;readonly label:string;readonly sourceHash:string;readonly hasPicture:boolean;readonly planPicture?:{readonly name:string;readonly src:string};readonly missingPicture?:'rig'|'scene';readonly questionPicture?:true};
|
|
53
53
|
submitParts?(issues:readonly PartsIssue[], general?:readonly string[]):Promise<string>;
|
|
54
54
|
readonly access: InstanceAccess;
|
|
55
55
|
/** UI act authority is separate from a retained backdrop's immutable source access. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Existing compiled rig/reference rendering for the shared inspection viewport. */
|
|
2
2
|
import type {ModelAssets,RigPlayer,PoseBounds,PosedFrame} from '@rig-c/play';
|
|
3
|
-
import type
|
|
3
|
+
import {formatZoomReadout,type CameraTarget,type ViewportProvider,type ViewportState,type ViewportController} from './viewport-controller.ts';
|
|
4
4
|
import {cameraSignature} from './camera-view.ts';
|
|
5
5
|
import {dragImpulse} from '../src/environment.ts';
|
|
6
6
|
import {CLICK_SLOP_PX} from './stage-pick.ts';
|
|
@@ -90,10 +90,9 @@ function render(controller:ViewportController): void {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function renderControls(controller:ViewportController):void {
|
|
93
|
-
const
|
|
94
|
-
input('camera-sync').checked=state.cameraSync;
|
|
95
|
-
|
|
96
|
-
text(controls?.zoomId??'zoom-value',`${Math.round((target?paneCamera(target).zoom:1)*100)}% · ${label}`);
|
|
93
|
+
const controls=host.cameraControls;
|
|
94
|
+
input('camera-sync').checked=state.cameraSync;
|
|
95
|
+
text(controls?.zoomId??'zoom-value',formatZoomReadout(controller,controls?.targetLabel));
|
|
97
96
|
button('fit').textContent=host.fitLabel??controls?.fitLabel?.(state.cameraSync)??(state.cameraSync?'Fit views':'Fit active');
|
|
98
97
|
renderCaption();
|
|
99
98
|
}
|
package/web/stage-comments.ts
CHANGED
|
@@ -35,6 +35,7 @@ interface Host<Row extends CommentRow=Feedback,Pose extends CommentUiPose=Commen
|
|
|
35
35
|
refusal?:()=>string|null;blocked:()=>boolean;busy?:()=>boolean;busyError?:(message:string)=>void;shortcutBlocked?:()=>boolean;shortcutActive?:()=>boolean;codec?:CommentCodec<Row,Pose>;
|
|
36
36
|
}
|
|
37
37
|
const markOf=(f:Feedback):StageComment|null=>{try{const c=f.context as Record<string,unknown>|undefined;return c?.comment?parseStageComment(c.comment):null;}catch{return null;}};
|
|
38
|
+
const commentLabels:Record<string,string>={setup:'Setup',animate:'Animate',compare:'Compare',rig:'Rig',reference:'Reference',a:'A',b:'B'};
|
|
38
39
|
const copy=<T>(v:T):T=>JSON.parse(JSON.stringify(v));
|
|
39
40
|
const t=(s:string)=>typeof i18nT==='function'?i18nT(s):s;
|
|
40
41
|
const toEn=(s:string)=>typeof i18nTr==='function'?i18nTr(s,'en'):s;
|
|
@@ -135,7 +136,8 @@ export function bindStageComments<Row extends CommentRow=Feedback,Pose extends C
|
|
|
135
136
|
const openComment=async(f:Row)=>{const mark=readMark(f);if(!mark){if(host.general?.matches(f))openComposer(null,{x:0,y:0,width:0,height:0},f);return;}if(list.hidden)setOpen(true);if(list.hidden)return;if(await jump(f)){const reason=updateRefusal();setCapture(!reason&&!host.blocked());const pose=host.pose(mark.viewport),screen=host.codec?.geometry&&pose?region(projectMark(mark.world,pose.camera),projectMark({x:mark.world.x+mark.world.width,y:mark.world.y+mark.world.height},pose.camera)):mark.screen;openComposer(mark.viewport,screen,f,pose?.mode??mark.mode);}};
|
|
136
137
|
const renderList=()=>{placeList();list.setAttribute('aria-label',t('Comments'));list.replaceChildren();const title=document.createElement('strong');title.textContent=t('Comments');list.append(title);const rawReason=host.refusal?.()??null,reason=rawReason?t(rawReason):null;if(reason){const note=document.createElement('small');note.className='stage-comment-refusal-note';note.title=reason;note.textContent=reason;Object.assign(note.style,{display:'block',marginTop:'4px',maxWidth:'100%',whiteSpace:inline?'normal':'nowrap',overflow:'hidden',textOverflow:'ellipsis'});list.append(note);}if(host.general&&host.general.available?.()!==false){const add=document.createElement('button');add.type='button';add.textContent=t('Add general comment');add.dataset.commentGeneral='';add.onclick=()=>openComposer(null,{x:0,y:0,width:0,height:0});list.append(add);}const all=host.feedback().filter(f=>readMark(f)||host.general?.matches(f));if(host.general?.rows)all.push(...host.general.rows);toggle.textContent=t(host.busy?.()?'Comment · C ({0}) · Rendering':'Comment · C ({0})').replace('{0}',String(all.length));if(!all.length){const empty=document.createElement('p');empty.textContent=t(inline?'No comments yet.':reason?'Read only · Escape closes':'Mark a point or region, then type. Enter saves · Escape cancels.');list.append(empty);}for(const [i,f]of all.entries()){
|
|
137
138
|
const mark=readMark(f),row=document.createElement('div');row.className='stage-comment-item';row.dataset.commentId=f.id;
|
|
138
|
-
const
|
|
139
|
+
const [timing,frameReason]=mark&&!host.codec&&!mark.frame?feedbackTimingLabel(f as unknown as Feedback).split(' · '):[];
|
|
140
|
+
const go=document.createElement('button');go.type='button';go.className='stage-comment-summary';if(frameReason)go.title=t(frameReason);go.textContent=!mark?`${i+1} · ${t('General comment')} · ${f.summary}`:host.codec?`${i+1} · ${host.codec.label(f,mark)}`:`${i+1} · ${t(commentLabels[mark.mode]??mark.mode)} · ${t(commentLabels[mark.viewport]??mark.viewport)} · ${mark.frame?t(`F${mark.frame.index} (${mark.frame.basis})`):t(timing!)} · ${f.summary}${frameReason?` · ${t('Frame unavailable')}`:''}`;go.onclick=()=>openComment(f);row.append(go);
|
|
139
141
|
if(host.locked(f.id)){const submitted=document.createElement('span');submitted.textContent=t('Submitted');row.append(submitted);}
|
|
140
142
|
list.append(row);
|
|
141
143
|
}};
|
package/web/styles.css
CHANGED
|
@@ -247,7 +247,7 @@ footer.status-bar{display:grid;max-width:100vw;grid-template-columns:minmax(0,1f
|
|
|
247
247
|
.view-tools{display:flex;gap:var(--space-1);flex:none}.view-tools:not(:has(:not([hidden]))){display:none}.view-tool{font-size:var(--font-size-meta);white-space:nowrap;height:var(--control-compact);padding:0 var(--space-2)}
|
|
248
248
|
.chest-editor-bar{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space-2) var(--space-3);padding:var(--space-2) var(--space-3);border-bottom:1px solid var(--border);background:var(--rv-bar);font-size:var(--font-size-meta)}.chest-editor-bar[hidden]{display:none}.chest-editor-bar input[type=range]{width:84px}.chest-editor-bar input[type=text]{width:104px;padding:0 var(--space-1);font-size:var(--font-size-meta);height:var(--control-compact)}.chest-editor-bar output{min-width:2.6em;font:var(--font-size-meta)/1 var(--font-mono);color:var(--fg)}.chest-editor-bar [data-landmark][aria-pressed=true]{outline:2px solid var(--rv-landmark);outline-offset:1px}#lm-derived{flex:1 1 100%;order:9;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:var(--font-size-meta)/1.4 var(--font-mono)}#lm-derived.error{color:var(--fail)}.chest-editor-bar .bust-group{display:flex;align-items:center;flex-wrap:wrap;min-width:0;gap:var(--space-2);padding-left:var(--space-3);border-left:1px solid var(--border)}.chest-editor-bar .bust-group:first-child{padding-left:0;border-left:0}.chest-editor-bar label{display:flex;align-items:center;gap:var(--space-1);color:var(--fg-muted)}.chest-editor-bar input[type=number]{width:58px;padding:0 var(--space-1);font-size:var(--font-size-meta);height:var(--control-compact)}.chest-editor-bar button{padding:0 var(--space-2);font-size:var(--font-size-meta);height:var(--control-compact)}.chest-editor-bar button[aria-disabled=true]{opacity:.6}.bust-tag{font-weight:var(--font-weight-emphasis)}.bust-tag-r{color:var(--rv-bust-r)}.bust-tag-l{color:var(--rv-bust-l)}#handoff-line{flex:1 1 100%;order:10;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:var(--font-size-meta)/1.4 var(--font-mono)}#chest-editor-status{flex:1 1 220px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chest-editor-bar{position:relative}.rebuild-log{position:absolute;top:100%;left:10px;right:10px;z-index:6;margin:var(--space-1) 0 0;max-height:7.5em;overflow:auto;padding:var(--space-1) var(--space-2);font:var(--font-size-meta)/1.5 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--code-bg);color:var(--code-fg);border:1px solid var(--border);border-radius:var(--radius)}
|
|
249
249
|
:root{--rv-mesh-veil:rgba(8,10,14,.55);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12)}
|
|
250
|
-
:root[data-theme=light]{--rv-mesh-veil:rgba(
|
|
250
|
+
:root[data-theme=light]{--rv-mesh-veil:rgba(8,10,14,.55);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12)}
|
|
251
251
|
.mesh-editor-bar kbd{margin-left:var(--space-1);font-size:var(--font-size-meta);opacity:.75}#mesh-editor-status{flex:1 1 260px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
252
252
|
#rig-pane[data-mesh-mode] .viewport{cursor:crosshair}#rig-pane[data-mesh-mode=modify][data-mesh-hover] .viewport{cursor:move}#rig-pane[data-mesh-mode=create] .viewport{cursor:copy}#rig-pane[data-mesh-mode=delete][data-mesh-hover] .viewport{cursor:not-allowed}#rig-pane[data-mesh-mode=edges][data-mesh-hover=vertex] .viewport{cursor:cell}
|
|
253
253
|
#rig-pane[data-chest-hover=move] .viewport{cursor:move}#rig-pane[data-chest-hover=r] .viewport,#rig-pane[data-chest-hover=band] .viewport{cursor:ew-resize}#rig-pane[data-chest-hover=band] .viewport{cursor:ns-resize}
|
|
@@ -507,7 +507,7 @@ main{position:relative}.toolbar{anchor-name:--stage-comment-bar}#stage-comment{w
|
|
|
507
507
|
.parts-explorer li:has([data-pv-visible]) button{flex:1;min-width:0}
|
|
508
508
|
|
|
509
509
|
.interview-answer.interview-grid{display:grid;flex:1;min-height:0;grid-template-columns:minmax(9rem,.5fr) minmax(0,1.5fr) minmax(24rem,1.25fr);grid-template-rows:minmax(0,1fr) auto;align-items:stretch;overflow:hidden}
|
|
510
|
-
.interview-answer>.interview-questions{grid-column:1;grid-row:1;overflow:auto}
|
|
510
|
+
.interview-answer>.interview-questions{grid-column:1;grid-row:1;align-self:start;max-height:100%;overflow:auto}
|
|
511
511
|
.interview-image-context{grid-row:4;overflow:auto;min-height:0;padding:var(--space-2)}
|
|
512
512
|
.interview-answer-fields{grid-column:3;grid-row:1;min-height:0;overflow:auto;border:0;padding:0 var(--space-1)!important}
|
|
513
513
|
.interview-answer-fields>h3{margin:var(--space-1) 0}
|
|
@@ -13,6 +13,10 @@ export interface ViewportState {
|
|
|
13
13
|
rigScale:number;referenceScale:number;referenceZoom:number;displayedCenter:ViewPoint|null;
|
|
14
14
|
}
|
|
15
15
|
export function createViewportState():ViewportState {return {cameraSync:true,activeCamera:'rig',cameraRestoring:false,cameraLayout:'',cameraFrames:{},zoom:1,cameraCenter:null,referenceCenter:null,rigScale:1,referenceScale:1,referenceZoom:1,displayedCenter:null};}
|
|
16
|
+
export function formatZoomReadout(controller:Pick<ViewportController,'availableCamera'|'paneCamera'>,targetLabel?:(target:CameraTarget|null)=>string):string {
|
|
17
|
+
const target=controller.availableCamera(),label=targetLabel?.(target)??(target==='reference'?'Reference':'Rig');
|
|
18
|
+
return `${Math.round((target?controller.paneCamera(target).zoom:1)*100)}% · ${label}`;
|
|
19
|
+
}
|
|
16
20
|
export interface ViewportGeometry {space:'world'|'image';box:{x:number;y:number;width:number;height:number};marginX:number;marginY:number}
|
|
17
21
|
export interface ViewportProvider {
|
|
18
22
|
/** Real mounted panes; the canonical rig host uses the default pair. */
|
package/web/workspace-ui.ts
CHANGED
|
@@ -8,12 +8,12 @@ import {panelMake,actionButton,labelledControl} from './view-controls.ts';
|
|
|
8
8
|
export function bindHeaderModeAvailability(options:{model:boolean;preRig?:boolean;parts?:boolean;root?:Pick<Document,'querySelectorAll'>}):()=>void {
|
|
9
9
|
const root=options.root??document,reason=options.preRig?'RIG_VERSION_UNAVAILABLE: this draft has no recorded rig review package.':!options.model?'MODEL_UNAVAILABLE: no compiled model is supplied in this inspection.':null;
|
|
10
10
|
if(!reason)return ()=>{};
|
|
11
|
-
const modes=[...root.querySelectorAll<HTMLButtonElement>('[data-mode]')].map(button=>({button,disabled:button.disabled,title:button.getAttribute('title'),pressed:button.getAttribute('aria-pressed')}));
|
|
12
|
-
const render=()=>{for(const {button}of modes){if(options.parts&&button.dataset.mode==='rig')continue;button.disabled=true;button.title=
|
|
11
|
+
const modes=[...root.querySelectorAll<HTMLButtonElement>('[data-mode]')].map(button=>({button,disabled:button.disabled,title:button.getAttribute('title'),description:button.getAttribute('aria-description'),pressed:button.getAttribute('aria-pressed')}));
|
|
12
|
+
const render=()=>{const text=tr(reason);for(const {button}of modes){if(options.parts&&button.dataset.mode==='rig')continue;button.disabled=true;button.title=text;button.setAttribute('title',text);button.setAttribute('aria-description',text);if(button.getAttribute('aria-pressed')!=='false')button.setAttribute('aria-pressed','false');}};
|
|
13
13
|
const refuse=(event:Event)=>{event.preventDefault();event.stopImmediatePropagation();render();};
|
|
14
14
|
const observer=new MutationObserver(render);for(const {button}of modes){observer.observe(button,{attributes:true,attributeFilter:['aria-pressed']});button.addEventListener('click',refuse,true);}
|
|
15
15
|
const off=onLanguageChange(render);render();
|
|
16
|
-
return ()=>{off();observer.disconnect();for(const {button,disabled,title,pressed}of modes){button.removeEventListener('click',refuse,true);button.disabled=disabled;button.title=title??'';if(title===null)button.removeAttribute('title');else button.setAttribute('title',title);if(pressed===null)button.removeAttribute('aria-pressed');else button.setAttribute('aria-pressed',pressed);}};
|
|
16
|
+
return ()=>{off();observer.disconnect();for(const {button,disabled,title,description,pressed}of modes){button.removeEventListener('click',refuse,true);button.disabled=disabled;button.title=title??'';if(title===null)button.removeAttribute('title');else button.setAttribute('title',title);if(description===null)button.removeAttribute('aria-description');else button.setAttribute('aria-description',description);if(pressed===null)button.removeAttribute('aria-pressed');else button.setAttribute('aria-pressed',pressed);}};
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export interface WorkspaceStatusBarOptions {
|