rig-review 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,217 @@
1
+ import { bindDomI18n, unbindDomI18n, onLanguageChange, setLanguagePreference, setLinkLanguage, t } from './i18n.ts';
2
+ import { pageInstanceAccess } from './instance-access.ts';
3
+ import { connectLiveWindow } from './live-connection.ts';
4
+ import { bindStageNav, type StagePartsState, type StagePartsWindow } from './stage-nav.ts';
5
+ import { parsePartsIssue } from '../src/parts-comment.ts';
6
+ import { mountPartsWorkspace, type PanelOutput, type PartsHost, type PartsSource, type PartsWorkspaceHandle, type ViewData } from './parts.ts';
7
+
8
+ /** Standalone and joined-stage transport for the shared parts workspace. */
9
+ export function bootPartsPage(): PartsWorkspaceHandle {
10
+ const access = pageInstanceAccess();
11
+ const url = new URL(location.href);
12
+ const embedded = url.searchParams.get('stageEmbed') === '1';
13
+ const side = url.searchParams.get('side');
14
+ const partsApi = embedded
15
+ ? (side === 'a' || side === 'b' ? `/api/compare/${side}/stage-parts` : '/api/stage-parts')
16
+ : '/api/parts';
17
+ let build = 'inspected';
18
+ let restore: StagePartsState | null = null;
19
+ let currentView: ViewData | null = null;
20
+ let output: PanelOutput | null = null;
21
+ let busy = false;
22
+ let disposed = false;
23
+ let workspace: PartsWorkspaceHandle | null = null;
24
+ let receiveSource!: () => void;
25
+ const sourceReady = new Promise<void>(resolve => { receiveSource = resolve; });
26
+ const disposers: (() => void)[] = [];
27
+ const objectUrls = new Set<string>();
28
+ const pendingImages = new Set<() => void>();
29
+ const required = <T extends HTMLElement>(selector: string): T => {
30
+ const node = document.querySelector<T>(selector);
31
+ if (!node) throw new Error(`PARTS_WORKSPACE_NODE_REQUIRED: ${selector}`);
32
+ return node;
33
+ };
34
+ const slots = {
35
+ left: required('.pv-list'), stage: required('[data-parts-stage]'),
36
+ toolbar: required('.pv-toolbar'), side: required('.pv-side'),
37
+ };
38
+ const actions = required('#parts-actions');
39
+ const headers = () => access.headers(embedded ? {'X-Review-Stage-Build': build} : {});
40
+ const request = async (path: string): Promise<Response> => {
41
+ const response = await fetch(access.route(path), {headers: headers()});
42
+ if (!response.ok) {
43
+ const value = await response.json() as {error?: string};
44
+ throw new Error(value.error ?? 'PARTS_PAINT_FAILED');
45
+ }
46
+ return response;
47
+ };
48
+ const image = async (path: string): Promise<HTMLImageElement> => {
49
+ const response = await request(path);
50
+ if (disposed) throw new Error('PARTS_PAINT_FAILED');
51
+ const blob = await response.blob();
52
+ if (disposed) throw new Error('PARTS_PAINT_FAILED');
53
+ return new Promise((resolve, reject) => {
54
+ const node = document.createElement('img');
55
+ const objectUrl = URL.createObjectURL(blob);
56
+ objectUrls.add(objectUrl);
57
+ const cleanup = () => {
58
+ node.onload = null; node.onerror = null;
59
+ URL.revokeObjectURL(objectUrl); objectUrls.delete(objectUrl); pendingImages.delete(cancel);
60
+ };
61
+ const cancel = () => { cleanup(); node.removeAttribute('src'); reject(new Error('PARTS_PAINT_FAILED')); };
62
+ pendingImages.add(cancel);
63
+ node.onload = () => { cleanup(); resolve(node); };
64
+ node.onerror = () => { cleanup(); reject(new Error('PARTS_PAINT_FAILED')); };
65
+ node.src = objectUrl;
66
+ });
67
+ };
68
+ const source: PartsSource = {
69
+ async view() {
70
+ if (embedded) await sourceReady;
71
+ if (disposed) throw new Error('PARTS_PAINT_FAILED');
72
+ const requestedBuild = build;
73
+ const data = await (await request(partsApi)).json() as ViewData;
74
+ if (disposed) throw new Error('PARTS_PAINT_FAILED');
75
+ if (requestedBuild !== build) throw new Error('STAGE_DRAFT_CHANGED');
76
+ currentView = data;
77
+ document.title = data.title;
78
+ required('#pv-title').textContent = data.title;
79
+ required('#pv-mode').textContent = t(data.mode === 'parts' ? 'Parts package, before rigging' : 'Atlas of a built rig');
80
+ return data;
81
+ },
82
+ image: index => image(`${partsApi}/image/${index}`),
83
+ page: index => image(`${partsApi}/page/${index}`),
84
+ painting: () => currentView?.painting ? image('/api/parts/painting') : null,
85
+ difference: (index, threshold, footprints) => request(`${partsApi}/difference/${index}?threshold=${threshold}&footprints=${footprints}`),
86
+ async crop(issue) {
87
+ if (embedded) throw new Error('PARTS_JOINED_ISSUE_UNSUPPORTED');
88
+ const response = await fetch(access.route('/api/parts/comment'), {
89
+ method: 'POST', headers: access.headers({'Content-Type': 'application/json'}), body: JSON.stringify(issue),
90
+ });
91
+ const value = await response.json() as {comment: unknown; error?: string};
92
+ if (!response.ok) throw new Error(value.error ?? 'PARTS_COMMENT_UNAVAILABLE: original part image required');
93
+ return parsePartsIssue(value.comment, true, true, false);
94
+ },
95
+ };
96
+ const host: PartsHost = {
97
+ initial: () => currentView?.verdict?.issues ?? currentView?.legacyVerdict?.issues ??
98
+ (currentView?.verdict?.comments ?? []).map(issue => parsePartsIssue(issue, true, true, false)),
99
+ changed() {},
100
+ register(value) { output = value; },
101
+ locked: () => busy || currentView?.legacyVerdict?.readOnly ||
102
+ embedded && (!currentView?.joinedVerdictBinding || !access.capability || build !== 'inspected') ? 'sent' : 'open',
103
+ };
104
+ const save = async () => {
105
+ if (!currentView || !output || host.locked() !== 'open') return;
106
+ const status = required('#pv-save-status');
107
+ const button = required<HTMLButtonElement>('#pv-save');
108
+ busy = true; button.disabled = true;
109
+ try {
110
+ const value = output.value();
111
+ if (!('issues' in value) || !('verdict' in value)) throw new Error('PARTS_VERDICT_INVALID');
112
+ if (embedded && value.issues.length > 0) {
113
+ status.textContent = t('PARTS_JOINED_ISSUE_UNSUPPORTED'); status.dataset.result = 'refused';
114
+ return;
115
+ }
116
+ const body = {status: value.verdict, issues: value.issues,
117
+ ...(embedded ? {binding: currentView.joinedVerdictBinding} : {})};
118
+ const writeHeaders = headers(); writeHeaders.set('Content-Type', 'application/json');
119
+ const response = await fetch(access.route(`${partsApi}/verdict`), {
120
+ method: 'POST', headers: writeHeaders, body: JSON.stringify(body),
121
+ });
122
+ const result = await response.json() as {error?: string; verdict?: {source: {sha256: string}}};
123
+ if (disposed) return;
124
+ status.textContent = response.ok
125
+ ? t('Saved {file}: source {hash}.', {file: currentView.verdictFile, hash: result.verdict!.source.sha256.slice(0, 12)})
126
+ : t(result.error ?? 'Save failed.');
127
+ status.dataset.result = response.ok ? 'saved' : 'refused';
128
+ } catch {
129
+ if (!disposed) {status.textContent = t('Save failed.'); status.dataset.result = 'refused';}
130
+ } finally {
131
+ busy = false;
132
+ if (!disposed) button.disabled = host.locked() !== 'open';
133
+ }
134
+ };
135
+ const exportVerdict = async (format: 'json' | 'issue') => {
136
+ const data = currentView;
137
+ if (!data) return;
138
+ try {
139
+ const response = await request(embedded ? `${partsApi}/export/${format}` : `/api/parts/export?format=${format}`);
140
+ const value = await response.text();
141
+ if (disposed) return;
142
+ const objectUrl = URL.createObjectURL(new Blob([value], {type: format === 'json' ? 'application/json' : 'text/markdown'}));
143
+ objectUrls.add(objectUrl);
144
+ const anchor = document.createElement('a'); anchor.href = objectUrl;
145
+ anchor.download = embedded ? (format === 'json' ? data.verdictFile : data.verdictFile.replace(/\.json$/, '.md'))
146
+ : format === 'json' ? 'parts-review-export.json' : 'parts-review-export.md';
147
+ anchor.click();
148
+ const timer = setTimeout(() => {URL.revokeObjectURL(objectUrl); objectUrls.delete(objectUrl);}, 1000);
149
+ disposers.push(() => clearTimeout(timer));
150
+ } catch (error) {
151
+ if (!disposed) required('#pv-save-status').textContent = t(error instanceof Error ? error.message : 'Save failed.');
152
+ }
153
+ };
154
+ const onMessage = (event: MessageEvent) => {
155
+ if (event.source !== parent || event.origin !== location.origin) return;
156
+ const message = event.data;
157
+ if (message?.type === 'review-stage-source' && (message.buildId === 'inspected' || /^[a-f0-9]{64}$/.test(message.buildId))) {
158
+ build = message.buildId; restore = message.state ?? null; receiveSource();
159
+ } else if (message?.type === 'review-stage-language' && (message.language === 'en' || message.language === 'ko')) {
160
+ setLinkLanguage(null); setLanguagePreference(message.language);
161
+ } else if (message?.type === 'review-stage-restore' && message.state) {
162
+ void workspace?.restore(message.state);
163
+ } else if (message?.type === 'review-stage-revalidate') {
164
+ if (message.buildId === 'inspected' || typeof message.buildId === 'string' && /^[a-f0-9]{64}$/.test(message.buildId)) build = message.buildId;
165
+ void workspace?.revalidate(message.state).then(syncActions);
166
+ }
167
+ };
168
+ const correction = (event: Event) => parent.postMessage((event as CustomEvent).detail, location.origin);
169
+ window.addEventListener('message', onMessage); disposers.push(() => window.removeEventListener('message', onMessage));
170
+ slots.stage.addEventListener('parts-correction', correction); disposers.push(() => slots.stage.removeEventListener('parts-correction', correction));
171
+ bindDomI18n(document); disposers.push(unbindDomI18n);
172
+ disposers.push(bindStageNav({partsOnly: true, model: false}));
173
+ disposers.push(connectLiveWindow(access));
174
+ const syncActions = () => {
175
+ actions.hidden = embedded && !currentView?.joinedVerdictBinding;
176
+ const button = required<HTMLButtonElement>('#pv-save');
177
+ button.disabled = host.locked() !== 'open';
178
+ button.title = embedded && !access.capability ? t('Read-only view: reopen with rig-review open to edit.') : '';
179
+ };
180
+ const mounted = mountPartsWorkspace(slots, source, host, {defaultView: 'item', embedded});
181
+ actions.replaceChildren(); actions.classList.add('pv-verdict');
182
+ for (const [id, label, action] of [
183
+ ['pv-save', 'Save sign-off', save],
184
+ ['pv-export-json', 'Export JSON', () => exportVerdict('json')],
185
+ ['pv-export-issue', 'Export issue', () => exportVerdict('issue')],
186
+ ] as const) {
187
+ const button = document.createElement('button'); button.type = 'button'; button.id = id; button.textContent = t(label);
188
+ button.onclick = () => {void action();}; actions.append(button);
189
+ disposers.push(onLanguageChange(() => {button.textContent = t(label);}));
190
+ }
191
+ if (embedded) required('.pv-top').hidden = true;
192
+ const ready = mounted.ready.then(async () => {
193
+ if (disposed) return;
194
+ if (restore) await mounted.restore(restore);
195
+ syncActions(); document.body.dataset.ready = 'true';
196
+ });
197
+ void ready.catch(error => {
198
+ if (disposed) return;
199
+ const status = required('#pv-load'); status.dataset.result = 'refused';
200
+ status.textContent = t(error instanceof Error ? error.message : 'PARTS_PAINT_FAILED');
201
+ });
202
+ const stageApi = {snapshot: () => mounted.snapshot()};
203
+ if (embedded) (window as StagePartsWindow).rigReviewStageParts = stageApi;
204
+ workspace = {...mounted, ready, dispose() {
205
+ if (disposed) return;
206
+ disposed = true; receiveSource();
207
+ mounted.dispose();
208
+ for (const dispose of disposers.splice(0)) dispose();
209
+ for (const cancel of pendingImages) cancel();
210
+ for (const objectUrl of objectUrls) URL.revokeObjectURL(objectUrl);
211
+ objectUrls.clear(); actions.replaceChildren();
212
+ if ((window as StagePartsWindow).rigReviewStageParts === stageApi) delete (window as StagePartsWindow).rigReviewStageParts;
213
+ }};
214
+ return workspace;
215
+ }
216
+
217
+ if (typeof document !== 'undefined' && document.getElementById('parts-app')) void bootPartsPage();
@@ -91,29 +91,36 @@ export function meshCoverage(w: number, h: number, mesh: MeshGeometry): Uint8Arr
91
91
  return mask;
92
92
  }
93
93
  /** Tint only nontransparent source-art pixels outside the triangle union, before drawing diagnostic edges. */
94
- export function paintMesh(ctx: Ctx, source: Source, w: number, h: number, mesh: MeshGeometry, makeCanvas: (w: number, h: number) => HTMLCanvasElement): void {
95
- const scratch = makeCanvas(w, h), s = scratch.getContext('2d')!;
96
- s.drawImage(source, 0, 0);
97
- const art = s.getImageData(0, 0, w, h), tint = s.createImageData(w, h), mask = meshCoverage(w, h, mesh);
98
- for (let i = 0; i < mask.length; i++) if (!mask[i] && art.data[i * 4 + 3]) {
99
- tint.data[i * 4] = 255; tint.data[i * 4 + 2] = 80; tint.data[i * 4 + 3] = 160;
100
- }
101
- s.putImageData(tint, 0, 0); ctx.drawImage(scratch, 0, 0);
102
- ctx.strokeStyle = '#00bfff'; ctx.fillStyle = '#ffffff'; ctx.lineWidth = .5;
103
- ctx.beginPath();
104
- const v = mesh.vertices;
105
- for (let i = 0; i < mesh.triangles.length; i += 3) {
106
- for (let j = 0; j < 3; j++) { const a = mesh.triangles[i + j]! * 2; if (!j) ctx.moveTo(v[a]!, v[a + 1]!); else ctx.lineTo(v[a]!, v[a + 1]!); }
107
- ctx.closePath();
108
- }
109
- ctx.stroke();
110
- for (let i = 0; i < v.length; i += 2) { ctx.beginPath(); ctx.arc(v[i]!, v[i + 1]!, .8, 0, Math.PI * 2); ctx.fill(); }
94
+ export function paintMesh(ctx: Ctx, source: Source, w: number, h: number, mesh: MeshGeometry, makeCanvas: (w: number, h: number) => HTMLCanvasElement, options: {tint?: boolean; alpha?: number} = {}): void {
95
+ const tintEnabled = options.tint !== false;
96
+ ctx.save();
97
+ try {
98
+ ctx.globalAlpha *= options.alpha ?? 1;
99
+ if (tintEnabled) {
100
+ const scratch = makeCanvas(w, h), s = scratch.getContext('2d')!;
101
+ s.drawImage(source, 0, 0);
102
+ const art = s.getImageData(0, 0, w, h), tint = s.createImageData(w, h), mask = meshCoverage(w, h, mesh);
103
+ for (let i = 0; i < mask.length; i++) if (!mask[i] && art.data[i * 4 + 3]) {
104
+ tint.data[i * 4] = 255; tint.data[i * 4 + 2] = 80; tint.data[i * 4 + 3] = 160;
105
+ }
106
+ s.putImageData(tint, 0, 0); ctx.drawImage(scratch, 0, 0);
107
+ }
108
+ ctx.strokeStyle = '#00bfff'; ctx.fillStyle = '#ffffff'; ctx.lineWidth = .5;
109
+ ctx.beginPath();
110
+ const v = mesh.vertices;
111
+ for (let i = 0; i < mesh.triangles.length; i += 3) {
112
+ for (let j = 0; j < 3; j++) { const a = mesh.triangles[i + j]! * 2; if (!j) ctx.moveTo(v[a]!, v[a + 1]!); else ctx.lineTo(v[a]!, v[a + 1]!); }
113
+ ctx.closePath();
114
+ }
115
+ ctx.stroke();
116
+ if (tintEnabled) for (let i = 0; i < v.length; i += 2) { ctx.beginPath(); ctx.arc(v[i]!, v[i + 1]!, .8, 0, Math.PI * 2); ctx.fill(); }
117
+ } finally {ctx.restore();}
111
118
  }
112
119
 
113
120
  /** Package order is back to front. Placements remain continuous rig pixels. */
114
- export function paintAssembly(ctx:Ctx,w:number,h:number,layers:readonly {box:Box;image:Source}[],options:{bg:string;alpha:boolean}):void {
121
+ export function paintAssembly(ctx:Ctx,w:number,h:number,layers:readonly {box:Box;image:Source}[],options:{bg:string;alpha:boolean;transparent?:boolean}):void {
115
122
  ctx.imageSmoothingEnabled=false;
116
- if(!options.alpha)paintBackground(ctx,w,h,options.bg);else ctx.clearRect(0,0,w,h);
123
+ if(options.alpha||options.transparent)ctx.clearRect(0,0,w,h);else paintBackground(ctx,w,h,options.bg);
117
124
  for(const {box,image} of layers)ctx.drawImage(image,box.x,box.y);
118
125
  if(options.alpha){const data=ctx.getImageData(0,0,w,h),px=data.data;for(let i=0;i<px.length;i+=4){px[i]=px[i+1]=px[i+2]=px[i+3]!;px[i+3]=255;}ctx.putImageData(data,0,0);}
119
126
  }
@@ -23,7 +23,19 @@ export function createPartsViewport(host:{el:ViewportProvider['el'];canvas:HTMLC
23
23
  return {space:'image',box:{x:0,y:0,width,height},marginX:24,marginY:24};
24
24
  },
25
25
  layoutKey:()=>[host.canvas.width,host.canvas.height,host.reference()?.width??0,host.reference()?.height??0,host.el('rig-viewport').clientWidth,host.el('rig-viewport').clientHeight].join(':'),selection:()=>({selected:false,bounds:null}),
26
- render:controller=>{for(const target of ['rig','reference'] as const){const frame=controller.paneFrame(target);if(!frame)continue;const c=controller.paneCamera(target),center=c.center??frame.center,root=host.el(target==='rig'?'rig-root':'reference-content');root.style.left=`${frame.width/2-center.x*c.zoom}px`;root.style.top=`${frame.height/2-center.y*c.zoom}px`;root.style.transform=`scale(${c.zoom})`;if(target==='rig'){state.rigScale=c.zoom;state.displayedCenter={...center};}}controller.renderCameraControls();},
26
+ render:controller=>{
27
+ // Translated controls can wrap the toolbar and resize its sibling panes.
28
+ controller.renderCameraControls();
29
+ for(const target of ['rig','reference'] as const){
30
+ const frame=controller.paneFrame(target);if(!frame)continue;
31
+ const c=controller.paneCamera(target),center=c.center??frame.center;
32
+ const root=host.el(target==='rig'?'rig-root':'reference-content');
33
+ root.style.left=`${frame.width/2-center.x*c.zoom}px`;
34
+ root.style.top=`${frame.height/2-center.y*c.zoom}px`;
35
+ root.style.transform=`scale(${c.zoom})`;
36
+ if(target==='rig'){state.rigScale=c.zoom;state.displayedCenter={...center};}
37
+ }
38
+ },
27
39
  renderControls:controller=>{const zoom=controller.paneCamera(controller.availableCamera()??'rig').zoom;host.el('zoom-value').textContent=zoom===1?t('1:1'):`${(zoom*100).toFixed(1)}%`;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');}
28
40
  };
29
41
  return createViewportController(provider,state);
package/web/parts.css CHANGED
@@ -6,7 +6,7 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px/1.4 system-ui,-ap
6
6
  .pv-top{display:flex;align-items:center;gap:16px;padding:8px 14px;border-bottom:1px solid var(--line);background:var(--panel)}
7
7
  .pv-brand{font-weight:600;display:flex;align-items:center;gap:6px}
8
8
  .pv-mark{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:5px;background:var(--accent);color:#fff;font-size:12px}
9
- #pv-load{margin-left:auto}
9
+ #pv-load{position:absolute;inset:0 0 auto auto;max-width:100%;margin:0;z-index:25;background:var(--panel);overflow-wrap:anywhere}
10
10
  .pv-subtle{color:var(--muted)}
11
11
  .pv-layout{flex:1;display:grid;grid-template-columns:240px minmax(0,1fr) 300px;min-height:0}
12
12
  .pv-list,.pv-side{background:var(--panel);overflow:auto;padding:10px}
@@ -102,3 +102,15 @@ main{position:relative}.toolbar{anchor-name:--stage-comment-bar}#stage-comment{w
102
102
  #pv-corrections p:last-child{margin:8px 0 0;color:var(--muted)}
103
103
  #pv-corrections button{font:inherit;color:inherit;background:var(--panel);border:1px solid var(--line);border-radius:5px;padding:5px 9px;margin:0 6px 4px 0;cursor:pointer}
104
104
  #reference-empty{padding:30px 12px 12px;color:var(--muted);overflow-wrap:anywhere}
105
+
106
+ .pv-stage-host>[data-parts-stage]{flex:1}
107
+ .pv-side-host{background:var(--panel);overflow:auto}
108
+ #parts-actions{padding:10px}
109
+ /* The shared parts host keeps the existing issue list in the sidebar flow. */
110
+ .stage-comment-list.stage-comment-list-inline{position:static;position-anchor:auto;inset:auto;z-index:auto;width:100%;max-width:none;max-height:none;margin-top:12px}
111
+ .stage-comment-list-inline .stage-comment-refusal-note{white-space:normal;overflow-wrap:anywhere}
112
+
113
+ /* Part attribution stays inside the existing comment composer. */
114
+ .stage-comment-parts{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
115
+ .stage-comment-parts button{font:inherit;max-width:100%;overflow-wrap:anywhere;border:1px solid var(--border);border-radius:5px;background:var(--panel);color:inherit;padding:3px 6px;cursor:pointer}
116
+ .stage-comment-parts button[aria-pressed="true"]{border-color:var(--link);background:color-mix(in srgb,var(--link) 18%,var(--panel))}
package/web/parts.html CHANGED
@@ -3,45 +3,11 @@
3
3
  <head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>rig review parts</title><link rel="stylesheet" href="parts.css"></head>
4
4
  <body>
5
5
  <div id="parts-app" class="pv-app">
6
- <header class="pv-top"><div class="pv-brand"><span class="pv-mark">r</span>rig review</div><div><strong id="pv-title">Parts review</strong> <span id="pv-mode" class="pv-subtle"></span></div><span id="pv-load" class="pv-subtle" role="status">Loading…</span><nav data-stage-nav class="review-stage-nav" aria-label="Inspection stages"></nav></header>
6
+ <header class="pv-top"><div class="pv-brand"><span class="pv-mark">r</span>rig review</div><div><strong id="pv-title">Parts review</strong> <span id="pv-mode" class="pv-subtle"></span></div><nav data-stage-nav class="review-stage-nav" aria-label="Inspection stages"></nav></header>
7
7
  <div class="pv-layout">
8
- <aside class="pv-list" aria-label="Parts"><h2 id="pv-list-title">PARTS</h2><ul id="pv-items" data-pv-items></ul></aside>
9
- <main class="pv-stage">
10
- <div class="pv-toolbar" role="toolbar" aria-label="View">
11
- <button type="button" id="pv-assemble" aria-pressed="false">Assembled</button>
12
- <label class="pv-field">Background <select id="pv-bg" data-pv-bg><option value="green">Green</option><option value="magenta">Magenta</option><option value="black">Black</option><option value="white">White</option><option value="checker">Checker</option></select></label>
13
- <span class="pv-group" role="group" aria-label="Zoom"><button type="button" id="zoom-out">−</button><span id="zoom-value">1:1</span><button type="button" id="zoom-in">+</button><button type="button" id="fit">Fit</button><button type="button" id="native-one" aria-pressed="true">1:1</button></span>
14
- <label class="pv-field"><input id="camera-sync" type="checkbox">Sync cameras</label>
15
- <button type="button" id="stage-comment" aria-pressed="false" aria-controls="stage-comment-list">Comment · C (0)</button>
16
- <label class="pv-field"><input type="checkbox" id="pv-alpha" data-pv-alpha> Alpha only</label>
17
- <label class="pv-field" id="pv-footprint-control"><input type="checkbox" id="pv-footprints" data-pv-footprints> Footprints of parts in front</label>
18
- <span id="pv-comparison" class="pv-comparison" hidden>
19
- <span class="pv-field">Painting comparison <span class="pv-group" role="group" aria-label="Painting comparison"><button type="button" data-pv-comparison="part" aria-pressed="true">Part</button><button type="button" data-pv-comparison="overlay" aria-pressed="false">Overlay</button><button type="button" data-pv-comparison="difference" aria-pressed="false">Difference</button></span></span>
20
- <label class="pv-field" id="pv-opacity-control" hidden>Part opacity <input type="range" id="pv-opacity" min="0" max="1" step="0.001" value="0.5"><output id="pv-opacity-value">50.0%</output></label>
21
- <label class="pv-field" id="pv-threshold-control" hidden>Threshold <input type="number" id="pv-threshold" min="0" max="255" step="1" value="0"></label>
22
- </span>
23
- <span class="pv-group" role="group" aria-label="Atlas view" id="pv-atlas-switch" hidden><button type="button" data-pv-view="item" aria-pressed="true">Region</button><button type="button" data-pv-view="page" aria-pressed="false">Pages</button></span>
24
- </div>
25
- <div class="pv-canvas-wrap" id="stage-layout"><div class="pv-canvas-box" id="pv-canvas-box"><canvas id="pv-canvas" data-pv-canvas width="1" height="1"></canvas><div id="pv-overlay" class="pv-overlay"></div></div></div>
26
- <p id="pv-caption" class="pv-subtle"></p>
27
- </main>
28
- <aside class="pv-side">
29
- <section><h2>PRODUCER FLAGS</h2><ul id="pv-flags" data-pv-flags></ul><p id="pv-flag-sources" class="pv-subtle"></p></section>
30
- <section class="pv-verdict"><h2>VERDICT</h2><p id="parts-correction-hint" class="subtle" hidden>Saved part notes and pointed comments can be handed off as described corrections.</p>
31
- <div class="pv-outcomes" role="radiogroup" aria-label="Part outcome">
32
- <label><input type="radio" name="pv-outcome" value="pending" data-pv-outcome> Pending</label>
33
- <label><input type="radio" name="pv-outcome" value="clean" data-pv-outcome> Clean</label>
34
- <label><input type="radio" name="pv-outcome" value="flagged" data-pv-outcome> Flagged</label>
35
- </div>
36
- <p id="pv-comment-count" role="status"></p>
37
- <label class="pv-label" for="pv-note">Note</label><textarea id="pv-note" rows="4" maxlength="10000"></textarea>
38
- <label class="pv-label" for="pv-overall">Sign-off</label><select id="pv-overall"><option value="pending">Pending</option><option value="approved">Approved</option><option value="changes-requested">Changes requested</option></select>
39
- <button id="pv-approve-all" type="button">Approve all</button>
40
- <button id="pv-save" type="button" class="pv-primary">Save sign-off</button>
41
- <span><button id="pv-export-json" type="button">Export JSON</button><button id="pv-export-issue" type="button">Export issue</button></span>
42
- <p id="pv-save-status" class="pv-subtle" role="status"></p>
43
- </section>
44
- </aside>
8
+ <aside class="pv-list" aria-label="Parts"></aside>
9
+ <main class="pv-stage pv-stage-host"><div class="pv-toolbar" role="toolbar" aria-label="View"></div><div class="pv-stage" data-parts-stage></div></main>
10
+ <aside class="pv-side-host"><div class="pv-side"></div><div id="parts-actions"></div></aside>
45
11
  </div>
46
12
  </div>
47
13
  <script type="module" src="parts.js"></script>