rig-review 1.8.0 → 1.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.
- package/docs/PARTS_VIEW.md +59 -30
- package/package.json +1 -1
- package/src/parts-view.ts +51 -11
- package/web/catalog-en.ts +9 -0
- package/web/catalog-ko.ts +15 -6
- package/web/parts-flags.ts +9 -1
- package/web/parts.css +5 -3
- package/web/parts.html +1 -0
- package/web/parts.ts +46 -9
package/docs/PARTS_VIEW.md
CHANGED
|
@@ -32,41 +32,70 @@ is written), `--painting <png>` (the original painting), `--format json|issue` (
|
|
|
32
32
|
region's own view keeps 4 page pixels around its box (dashed) so bleed is visible. Clicking a region opens it.
|
|
33
33
|
- **Producer flags**, read from the files rig-parts writes and shown on the part they name. None is re-measured here. Each reads as one labelled line (an opening's parts, animation, frame and cells; a seam pair's pixel counts; a gate's name, status and readings), with the producer's object verbatim under a collapsed **Producer line**.
|
|
34
34
|
|
|
35
|
+
The [23-part EN/KO comparison](https://github.com/rig-c/review/tree/main/tests/fixtures/parts-approve-all-evidence) records the same 1600×1100 initial view against installed 1.8.0: row height 49.375 → 26.1875 px, with all 23 after rows on one line (`tests/parts-approve-all-browser.ts`).
|
|
36
|
+
|
|
35
37
|
### Producer row groups
|
|
36
38
|
|
|
37
|
-
The sidebar
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
39
|
+
The sidebar counts **only mesh-report flags and explicit part findings**. A check row counts only
|
|
40
|
+
when `row_scope: "part"`, `row_kind: "finding"` and a valid `row_subjects` array names that part.
|
|
41
|
+
A block status, a JSON path, a reason or a legacy part/slot/bone field never determines classification.
|
|
42
|
+
Counts stay separate by source, for example **mesh 1 · check 1**; an absent report is not shown as zero.
|
|
43
|
+
A part with no counted flags has no count badge, even when it has other readings.
|
|
44
|
+
|
|
45
|
+
Rows appear beneath **mesh_report.json** / **check.json**, with collapsed categories and producer-root groups:
|
|
46
|
+
- **Part findings**: the explicitly attributed findings counted in the badge.
|
|
47
|
+
- **Pair readings**: pair findings on both explicit subjects, never counted.
|
|
48
|
+
- **Check evidence**: every evidence row and every rig row (including rig findings), never counted.
|
|
49
|
+
Subject-bound evidence appears on its subjects; rig rows have no implied part and are visible on every selection.
|
|
50
|
+
- **Unclassified check rows**: incomplete or invalid metadata, never counted. In a mixed document an object row
|
|
51
|
+
without a complete tuple remains visible here globally, without guessed subject attribution. The tuple requires
|
|
52
|
+
scope part/pair/rig, kind finding/evidence, and respectively 1/2/0 distinct nonempty string subjects.
|
|
53
|
+
If any subject is not held in this view, the entire tuple is unclassified globally, including a pair with one held subject. No partial or substitute attribution is made.
|
|
54
|
+
|
|
55
|
+
The reader walks all roots regardless of block status, nested observation arrays, alternate sets and
|
|
56
|
+
`requirements.lines` dictionaries. Singleton summaries are not rows, except that a top-level FAIL/WARN gate
|
|
57
|
+
without a tuple is preserved globally as unclassified, even in a labelled document. Its status does not make
|
|
58
|
+
it a classified finding. Each headline preserves root, exact path,
|
|
59
|
+
producer string fields and measurements. **Block** labels the enclosing block status; it never overrides the
|
|
60
|
+
row's kind. **Producer line** holds the full original row object. Producer values are never translated.
|
|
61
|
+
|
|
62
|
+
A document with no row metadata keeps #380's source-root extraction and attribution, explicitly **unclassified**.
|
|
63
|
+
It can retain unavailable support and informational pairs; none becomes a counted finding. The public legacy
|
|
64
|
+
[`parts-check-380.json`](https://github.com/rig-c/review/blob/main/tests/fixtures/parts-check-380.json) remains a
|
|
65
|
+
synthetic compatibility fixture. Its 11 historical check attributions remain in the verdict wire collection,
|
|
66
|
+
while its sidebar check finding count is absent (only the back defect's mesh flag counts).
|
|
67
|
+
|
|
68
|
+
The fixture contract is pinned to published **@rig-c/parts@2.17.0**, source
|
|
69
|
+
[`971b3a7`](https://github.com/rig-c/parts/tree/971b3a7fab1109adf5be11750886687a7addb306),
|
|
70
|
+
whose [consumer row table](https://github.com/rig-c/parts/blob/971b3a7fab1109adf5be11750886687a7addb306/docs/AUTHORING.md#consumer-check-rows-issue-1089)
|
|
71
|
+
and `src/checkrow.ts` define the fields. This is an evidence pin, not a runtime dependency or automatic install.
|
|
72
|
+
`tests/fixtures/parts-check-385-real.json` is the byte-exact public synthetic-rig check output from the installed
|
|
73
|
+
producer; check exit **1** is its deliberately planted stretch finding, not a green rig. The measurement packet's
|
|
74
|
+
exit 0 means capture completed. The separate `parts-check-385.json` is a clearly synthetic six-combination matrix,
|
|
75
|
+
including status/subject decoys. `parts-check-385.provenance.json` records hashes, source and the reproduction recipe.
|
|
76
|
+
`tests/parts-classification.test.ts` guards the actual DOM callers, API, classification and unchanged wire binding;
|
|
77
|
+
`tests/parts-classification-browser.ts` supplies real bilingual screenshots and collapsed/expanded/legacy checks.
|
|
78
|
+
Representative public screenshots: [English collapsed](https://github.com/rig-c/review/blob/main/tests/fixtures/parts-check-385-evidence/collapsed-en.png),
|
|
79
|
+
[English expanded](https://github.com/rig-c/review/blob/main/tests/fixtures/parts-check-385-evidence/expanded-en.png),
|
|
80
|
+
[Korean collapsed](https://github.com/rig-c/review/blob/main/tests/fixtures/parts-check-385-evidence/collapsed-ko.png),
|
|
81
|
+
[Korean expanded](https://github.com/rig-c/review/blob/main/tests/fixtures/parts-check-385-evidence/expanded-ko.png).
|
|
82
|
+
|
|
83
|
+
Classification is a separate read-only `readings` collection in the view response. The historical `flags`
|
|
84
|
+
collection and `buildVerdict` extraction remain unchanged: verdict/2 `parts.<name>.flags`, source file hashes,
|
|
85
|
+
comment serialization and create consumption keep their existing semantics. Display counts are not verdict IDs
|
|
86
|
+
or an approval decision. Changing the check document still invalidates an offered saved sign-off.
|
|
87
|
+
|
|
88
|
+
| Stored flag ID | Read from | Existing verdict/2 extraction (unchanged) |
|
|
62
89
|
| --- | --- | --- |
|
|
63
|
-
| `faint:<i>` | `mesh_report.json` beside `parts.json`
|
|
64
|
-
| `check:<path>` | `check/check.json` beside `rig/` |
|
|
90
|
+
| `faint:<i>` | `mesh_report.json` beside `parts.json` | a faint island the mesh left out |
|
|
91
|
+
| `check:<path>` | `check/check.json` beside `rig/` | historical FAIL/WARN gates or seam/opening lists naming a part by a non-bone string field; this is not the new sidebar classification |
|
|
65
92
|
|
|
66
93
|
The occlusion-coverage report (rig-c/parts#998) is not read yet; the footprint toggle stands without it.
|
|
67
94
|
|
|
68
95
|
## The sign-off
|
|
69
96
|
|
|
97
|
+
**Approve all** marks every pending part and available mesh clean, then saves an explicit approved sign-off. It preserves notes and existing clean outcomes; any flagged part or mesh refuses with `PARTS_APPROVE_ALL_FLAGGED` before changes are made. Individual approval remains available. `tests/parts-approve-all.test.ts` exercises the page action and unchanged verdict guard; `tests/parts-approve-all-browser.ts` checks the real save and refusal flows.
|
|
98
|
+
|
|
70
99
|
Each item is **pending**, **clean** or **flagged** with a note (a note is optional on clean). **Save sign-off**
|
|
71
100
|
writes `parts-review.json` beside `parts.json` (atlas mode: beside the model), or to `--verdict`:
|
|
72
101
|
|
|
@@ -92,7 +121,7 @@ writes `parts-review.json` beside `parts.json` (atlas mode: beside the model), o
|
|
|
92
121
|
verdict file's directory**, POSIX separators. A part added, removed or repainted after sign-off changes the hash.
|
|
93
122
|
- `source.sha256` is the SHA-256 of the UTF-8 lines `<path>\t<sha256>\n`, one per `source.files` entry, sorted by path
|
|
94
123
|
bytewise. Consumers recompute it from the files on disk.
|
|
95
|
-
- `source.flags` lists the producer files the flags were read from; `parts.<name>.flags` the
|
|
124
|
+
- `source.flags` lists the producer files the flags were read from; `parts.<name>.flags` the historical producer-attribution IDs defined above, not the classified sidebar count.
|
|
96
125
|
- `status`: `approved` only when every part is clean; `changes-requested` only with at least one part flagged;
|
|
97
126
|
otherwise `pending`.
|
|
98
127
|
|
|
@@ -283,8 +312,8 @@ A downstream create consumer must support verdict/2 before a review release can
|
|
|
283
312
|
|
|
284
313
|
**Assembled** toggles the existing rig/reference pair from the selected part to the declared
|
|
285
314
|
`rig_size` canvas. Parts draw back to front in package order at their exact fractional rig-pixel
|
|
286
|
-
placements.
|
|
287
|
-
per part. A tap selects the frontmost visible part with nonzero native source alpha, including
|
|
315
|
+
placements. The checkbox beside each part controls assembly visibility only; the verdict remains
|
|
316
|
+
per part. List rows occupy one line, with full part names available to assistive technology and on hover, separate source counts and the outcome badge. The former **Visible / 표시** caption is removed; the checkbox retains its per-part accessible name (`tests/parts-approve-all.test.ts`, with full-list geometry in `tests/parts-approve-all-browser.ts`). A tap selects the frontmost visible part with nonzero native source alpha, including
|
|
288
317
|
through transparent holes; drags remain camera gestures. The selected part's alpha edge is a
|
|
289
318
|
separate outline, outside the comparison raster. Background, alpha-only, Fit, 1:1 and the shared
|
|
290
319
|
camera controls remain available. `tests/parts-assembly.test.ts` guards fractional placement,
|
package/package.json
CHANGED
package/src/parts-view.ts
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Producer flags are read from the files rig-parts writes and shown on their part; nothing is re-measured here:
|
|
10
10
|
* - `mesh_report.json` rows: `contour.bridges.faint[]` (rig-parts #326), each a faint island the mesh left out;
|
|
11
|
-
* - `check.json`:
|
|
11
|
+
* - `check.json`: read-only row metadata drives display counts; the historical FAIL/WARN extraction below
|
|
12
|
+
* stays separate for verdict/2 compatibility. No display classification rewrites saved flag IDs.
|
|
12
13
|
*
|
|
13
14
|
* The sign-off is `rig-review-parts-verdict/2` (docs/PARTS_VIEW.md), written beside `parts.json` by default. Its
|
|
14
15
|
* `source.sha256` is the sha256 over the UTF-8 lines `<path>\t<sha256>\n`, sorted by path bytewise, where every path
|
|
@@ -56,7 +57,8 @@ export type ProducerFlag =
|
|
|
56
57
|
| { id: string; item: string; source: 'mesh_report'; kind: 'faint'; art: number; maxAlpha: number; box: [number, number, number, number] }
|
|
57
58
|
| { id: string; item: string; source: 'check'; kind: 'check'; path: string; line: string;
|
|
58
59
|
/** The top-level check.json key the line sits under, the gate's status when it is a gate, and the object as written. */
|
|
59
|
-
root: string; status: string | null; entry: Record<string, unknown
|
|
60
|
+
root: string; status: string | null; entry: Record<string, unknown>;
|
|
61
|
+
classification?: 'part' | 'pair' | 'evidence' | 'unclassified' };
|
|
60
62
|
|
|
61
63
|
export interface PartsViewPackage {
|
|
62
64
|
painting?:{sha256:string;width:number;height:number;abs:string};
|
|
@@ -67,6 +69,8 @@ export interface PartsViewPackage {
|
|
|
67
69
|
items: ViewItem[];
|
|
68
70
|
pages: ViewPage[];
|
|
69
71
|
flags: ProducerFlag[];
|
|
72
|
+
/** Read-only check presentation; never serialized into verdict/2. */
|
|
73
|
+
readings?: ProducerFlag[];
|
|
70
74
|
/** The files the sign-off rests on (parts.json and every part PNG; or the model and every page). */
|
|
71
75
|
files: LocalFile[];
|
|
72
76
|
/** The producer files the flags were read from. */
|
|
@@ -180,6 +184,42 @@ export function checkFlags(doc: unknown, names: ReadonlySet<string>): ProducerFl
|
|
|
180
184
|
return flags;
|
|
181
185
|
}
|
|
182
186
|
|
|
187
|
+
/** Additive check-row metadata is authoritative only as a complete valid tuple.
|
|
188
|
+
* Walk all roots (including PASS/SKIP), nested arrays, sets and requirements.lines.
|
|
189
|
+
* Legacy extraction and verdict IDs deliberately remain in checkFlags above.
|
|
190
|
+
*/
|
|
191
|
+
export function checkReadings(doc: unknown, names: ReadonlySet<string>): ProducerFlag[] {
|
|
192
|
+
const rows: ProducerFlag[] = [];
|
|
193
|
+
let labelled = false;
|
|
194
|
+
const visit = (value: unknown, path: string, root: string, status: string | null, row = false, depth = 0): void => {
|
|
195
|
+
if (depth > 32) return;
|
|
196
|
+
if (Array.isArray(value)) { value.forEach((v, i) => visit(v, `${path}[${i}]`, root, status, true, depth + 1)); return; }
|
|
197
|
+
const obj = record(value); if (!obj) return;
|
|
198
|
+
const hasMetadata = ['row_scope', 'row_kind', 'row_subjects'].some(k => Object.hasOwn(obj, k));
|
|
199
|
+
labelled ||= hasMetadata;
|
|
200
|
+
// Preserve failed/warning root gates even when only their child rows carry metadata.
|
|
201
|
+
const unlabelledProblemRoot = path === root && !hasMetadata && PROBLEM_STATUSES.has(String(obj.status));
|
|
202
|
+
if (hasMetadata || row || unlabelledProblemRoot) {
|
|
203
|
+
const scope = obj.row_scope, kind = obj.row_kind, subjects = obj.row_subjects;
|
|
204
|
+
const valid = ['part', 'pair', 'rig'].includes(String(scope)) && ['finding', 'evidence'].includes(String(kind)) &&
|
|
205
|
+
Array.isArray(subjects) && subjects.length === (scope === 'part' ? 1 : scope === 'pair' ? 2 : 0) &&
|
|
206
|
+
subjects.every(s => typeof s === 'string' && s.length > 0 && names.has(s)) && new Set(subjects).size === subjects.length;
|
|
207
|
+
const classification = !valid ? 'unclassified' : scope === 'rig' || kind === 'evidence' ? 'evidence' : scope === 'part' ? 'part' : 'pair';
|
|
208
|
+
// Invalid/missing metadata or any unheld subject has no implied attribution. Keep the whole row globally unclassified.
|
|
209
|
+
const items = valid ? (subjects as string[]).filter(s => names.has(s)) : [];
|
|
210
|
+
for (const item of items.length ? items : ['']) rows.push({id: `check:${path}`, item, source:'check', kind:'check', path, root, status, entry:obj, line:JSON.stringify(obj), classification});
|
|
211
|
+
}
|
|
212
|
+
for (const [key, child] of Object.entries(obj)) {
|
|
213
|
+
// requirements.lines is the producer's dictionary of individual rows, not an array.
|
|
214
|
+
if (key === 'lines' && /(?:^|\.)requirements$/.test(path) && record(child)) {
|
|
215
|
+
for (const [name, entry] of Object.entries(child as Record<string, unknown>)) visit(entry, `${path}.lines.${name}`, root, status, true, depth + 1);
|
|
216
|
+
} else visit(child, path ? `${path}.${key}` : key, root, status, false, depth + 1);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
for (const [root, value] of Object.entries(record(doc) ?? {})) visit(value, root, root, typeof record(value)?.status === 'string' ? record(value)!.status as string : null);
|
|
220
|
+
return labelled ? rows : checkFlags(doc, names).map(f => ({...f, classification:'unclassified' as const, ...(f.kind === 'check' ? {line:JSON.stringify(f.entry)} : {})}));
|
|
221
|
+
}
|
|
222
|
+
|
|
183
223
|
async function readJson(abs: string, what: string): Promise<unknown> {
|
|
184
224
|
try { return JSON.parse(await readFile(abs, 'utf8')); } catch (e) { return refuse('PARTS_FLAGS_MALFORMED', `${what}: ${e instanceof Error ? e.message : String(e)}`); }
|
|
185
225
|
}
|
|
@@ -189,8 +229,8 @@ async function readJson(abs: string, what: string): Promise<unknown> {
|
|
|
189
229
|
* writes `mesh_report.json` beside `parts.json` in `rig/`, and `check` writes `check/check.json` beside `rig/`.
|
|
190
230
|
* `rigDir` is that `rig/` directory (parts mode) or null (atlas mode: explicit paths only, or `buildRoot`'s files).
|
|
191
231
|
*/
|
|
192
|
-
async function producerFlags(rigDir: string | null, buildRoot: string | null, names: ReadonlySet<string>, options: PartsViewOptions): Promise<{ flags: ProducerFlag[]; files: LocalFile[]; notes: string[] }> {
|
|
193
|
-
const flags: ProducerFlag[] = [], files: LocalFile[] = [], notes: string[] = [];
|
|
232
|
+
async function producerFlags(rigDir: string | null, buildRoot: string | null, names: ReadonlySet<string>, options: PartsViewOptions): Promise<{ flags: ProducerFlag[]; readings: ProducerFlag[]; files: LocalFile[]; notes: string[] }> {
|
|
233
|
+
const flags: ProducerFlag[] = [], readings: ProducerFlag[] = [], files: LocalFile[] = [], notes: string[] = [];
|
|
194
234
|
// A discovered file must resolve inside the directory it was discovered in; a path given on the command line is the user's own choice.
|
|
195
235
|
const pick = async (explicit: string | undefined, candidates: ([string, string] | null)[], what: string): Promise<string | null> => {
|
|
196
236
|
if (explicit !== undefined) return resolve(explicit);
|
|
@@ -201,9 +241,9 @@ async function producerFlags(rigDir: string | null, buildRoot: string | null, na
|
|
|
201
241
|
if (mesh) { files.push(await hashFile(mesh)); flags.push(...meshReportFlags(await readJson(mesh, 'mesh_report.json'), names)); }
|
|
202
242
|
else notes.push('mesh_report.json');
|
|
203
243
|
const check = await pick(options.check, [rigDir ? [dirname(rigDir), join(dirname(rigDir), 'check', 'check.json')] : null, buildRoot ? [buildRoot, join(buildRoot, 'check', 'check.json')] : null], 'check/check.json');
|
|
204
|
-
if (check) { files.push(await hashFile(check));
|
|
244
|
+
if (check) { files.push(await hashFile(check)); const doc = await readJson(check, 'check.json'); flags.push(...checkFlags(doc, names)); readings.push(...checkReadings(doc, names)); }
|
|
205
245
|
else notes.push('check.json');
|
|
206
|
-
return { flags, files, notes };
|
|
246
|
+
return { flags, readings, files, notes };
|
|
207
247
|
}
|
|
208
248
|
|
|
209
249
|
/** Exact attachment identity and UV-derived geometry; never reconstruct through weights. */
|
|
@@ -300,7 +340,7 @@ async function loadPartsMode(root: string, options: PartsViewOptions): Promise<P
|
|
|
300
340
|
assertOriginalPaintingSize(png!.width,png!.height,rigSize,doc.scale_rig_per_source);
|
|
301
341
|
const file={abs:abs!,bytes:bytes!.length,sha256:createHash('sha256').update(bytes!).digest('hex')};painting={...file,width:png!.width,height:png!.height};files.push(file);
|
|
302
342
|
}
|
|
303
|
-
const { flags, files: flagFiles, notes } = await producerFlags(root, null, seen, options);
|
|
343
|
+
const { flags, readings, files: flagFiles, notes } = await producerFlags(root, null, seen, options);
|
|
304
344
|
const protectedPaths = [join(root, 'rig.json'), join(root, 'config.json'), join(root, 'review.json'), join(root, 'report.json')];
|
|
305
345
|
if (basename(root) === 'rig') protectedPaths.push(...['parts.json', 'config.json', 'review.json', 'report.json'].map(name => join(dirname(root), name)));
|
|
306
346
|
if (options.rig !== undefined) protectedPaths.push(resolve(options.rig));
|
|
@@ -319,7 +359,7 @@ async function loadPartsMode(root: string, options: PartsViewOptions): Promise<P
|
|
|
319
359
|
files.push({ abs: rigPath, bytes: rigBytes.length, sha256: createHash('sha256').update(rigBytes).digest('hex') });
|
|
320
360
|
if (report) files.push(report);
|
|
321
361
|
}
|
|
322
|
-
return { ...(painting?{painting}:{}),mode: 'parts', root, title: basename(root) === 'rig' ? basename(dirname(root)) : basename(root), rigSize, items, pages: [], flags, files, flagFiles, flagNotes: notes, protectedPaths, verdictPath, imagePaths, pagePaths: [] };
|
|
362
|
+
return { ...(painting?{painting}:{}),mode: 'parts', root, title: basename(root) === 'rig' ? basename(dirname(root)) : basename(root), rigSize, items, pages: [], flags, readings, files, flagFiles, flagNotes: notes, protectedPaths, verdictPath, imagePaths, pagePaths: [] };
|
|
323
363
|
}
|
|
324
364
|
|
|
325
365
|
async function loadAtlasMode(input: string, options: PartsViewOptions): Promise<PartsViewPackage> {
|
|
@@ -356,12 +396,12 @@ export async function loadPartsAtlas(p: ReviewPackage, options: PartsViewOptions
|
|
|
356
396
|
}
|
|
357
397
|
// A build root opens as its check package (#149); its own rig/ and check/ hold the flags.
|
|
358
398
|
const buildRoot = p.buildRoot ?? null;
|
|
359
|
-
const { flags, files: flagFiles, notes } = await producerFlags(null, buildRoot, names, options);
|
|
399
|
+
const { flags, readings, files: flagFiles, notes } = await producerFlags(null, buildRoot, names, options);
|
|
360
400
|
const protectedPaths = [...p.files].map(path => resolve(p.root, path));
|
|
361
401
|
protectedPaths.push(...['rig.json', 'config.json', 'report.json', 'review.json'].map(name => join(p.root, name)));
|
|
362
402
|
if (p.handoff) protectedPaths.push(...p.handoff.record.files.map(file => resolve(p.root, file.path)));
|
|
363
403
|
if (buildRoot) protectedPaths.push(...['parts.json', 'config.json', 'rig/rig.json', 'rig/parts.json'].map(name => join(buildRoot, name)));
|
|
364
|
-
return { mode: 'atlas', root: p.root, title: p.manifest.title, rigSize: null, items, pages, flags, files, flagFiles, flagNotes: notes, protectedPaths, verdictPath: options.verdict ? resolve(options.verdict) : join(dirname(modelAbs), PARTS_VERDICT_FILE), imagePaths: [], pagePaths };
|
|
404
|
+
return { mode: 'atlas', root: p.root, title: p.manifest.title, rigSize: null, items, pages, flags, readings, files, flagFiles, flagNotes: notes, protectedPaths, verdictPath: options.verdict ? resolve(options.verdict) : join(dirname(modelAbs), PARTS_VERDICT_FILE), imagePaths: [], pagePaths };
|
|
365
405
|
}
|
|
366
406
|
|
|
367
407
|
/**
|
|
@@ -517,7 +557,7 @@ export function partsViewJson(pkg: PartsViewPackage, saved: { verdict: PartsVerd
|
|
|
517
557
|
schema: 'rig-review-parts-view/1', mode: pkg.mode, title: pkg.title, rigSize: pkg.rigSize,
|
|
518
558
|
painting:pkg.painting?{sha256:pkg.painting.sha256,width:pkg.painting.width,height:pkg.painting.height}:null,
|
|
519
559
|
sourceHash:verdictSource(pkg).sha256,
|
|
520
|
-
items:pkg.items.map(item=>({...item,...(pkg.mode==='parts'?{imageHash:pkg.files.find(f=>f.abs===pkg.imagePaths[item.index])?.sha256}:{})})), pages: pkg.pages, flags: pkg.flags,
|
|
560
|
+
items:pkg.items.map(item=>({...item,...(pkg.mode==='parts'?{imageHash:pkg.files.find(f=>f.abs===pkg.imagePaths[item.index])?.sha256}:{})})), pages: pkg.pages, flags: pkg.flags, readings: pkg.readings ?? [],
|
|
521
561
|
flagSources: pkg.flagFiles.map(f => basename(f.abs)), flagMissing: pkg.flagNotes,
|
|
522
562
|
verdictFile: basename(pkg.verdictPath), verdict: saved.verdict, verdictStale: saved.stale,
|
|
523
563
|
};
|
package/web/catalog-en.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const enCatalog: Readonly<Record<string, string>> = {
|
|
2
|
+
"Approve all": "Approve all",
|
|
3
|
+
"PARTS_APPROVE_ALL_FLAGGED: resolve flagged part and mesh outcomes before approving all.": "PARTS_APPROVE_ALL_FLAGGED: resolve flagged part and mesh outcomes before approving all.",
|
|
2
4
|
"Atlas source build": "Atlas source build",
|
|
3
5
|
"1 Parts + mesh": "1 Parts + mesh",
|
|
4
6
|
"2 Interview": "2 Interview",
|
|
@@ -3145,4 +3147,11 @@ export const enCatalog: Readonly<Record<string, string>> = {
|
|
|
3145
3147
|
"Assembly unavailable: rig_size is not declared.": "Assembly unavailable: rig_size is not declared.",
|
|
3146
3148
|
"Assembled package \u00b7 {count} visible parts. Selection and verdict remain per part.": "Assembled package · {count} visible parts. Selection and verdict remain per part.",
|
|
3147
3149
|
"PARTS_COMMENT_UNAVAILABLE: select the individual part view to comment": "PARTS_COMMENT_UNAVAILABLE: select the individual part view to comment",
|
|
3150
|
+
"Mesh flags": "Mesh flags",
|
|
3151
|
+
"Part findings": "Part findings",
|
|
3152
|
+
"Pair readings": "Pair readings",
|
|
3153
|
+
"Check evidence": "Check evidence",
|
|
3154
|
+
"Unclassified check rows": "Unclassified check rows",
|
|
3155
|
+
"Badges count only mesh flags and explicit part findings. Pair readings and check evidence are not counted.": "Badges count only mesh flags and explicit part findings. Pair readings and check evidence are not counted.",
|
|
3156
|
+
"Missing or invalid row metadata: source-root rows remain unclassified and are not counted.": "Missing or invalid row metadata: source-root rows remain unclassified and are not counted.",
|
|
3148
3157
|
};
|
package/web/catalog-ko.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const koCatalog: Readonly<Record<string, string>> = {
|
|
2
|
+
"Approve all": "모두 승인",
|
|
3
|
+
"PARTS_APPROVE_ALL_FLAGGED: resolve flagged part and mesh outcomes before approving all.": "PARTS_APPROVE_ALL_FLAGGED: 모두 승인하기 전에 파츠와 메시의 문제 표시를 해결해 주세요.",
|
|
2
4
|
"Atlas source build": "아틀라스 소스 빌드",
|
|
3
5
|
"1 Parts + mesh": "1 파츠 + 메시",
|
|
4
6
|
"2 Interview": "2 인터뷰",
|
|
@@ -1236,7 +1238,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
1236
1238
|
"This part is not a contour mesh, so chest regions and bust motion cannot be rebuilt on it. The builder chooses each part's mesh kind in the config. Nothing is wrong with this rig.": "이 파츠는 윤곽(contour) 메시가 아니어서 흉부 영역과 가슴 움직임을 다시 빌드할 수 없습니다. 파츠마다 메시 종류는 빌더가 설정에서 정합니다. 이 리그에는 문제가 없습니다.",
|
|
1237
1239
|
"REBUILD_PART_AMBIGUOUS: the config states {0} contour meshes and the designated bones name none of them alone": "REBUILD_PART_AMBIGUOUS: 설정에 윤곽 메시 {0}개가 선언되어 있으며 지정된 본들이 어느 하나를 단독으로 가리키지 않습니다",
|
|
1238
1240
|
"REBUILD_PART_AMBIGUOUS: the config states {0} contour meshes and the landmark bones name none of them alone": "REBUILD_PART_AMBIGUOUS: 설정에 윤곽 메시 {0}개가 선언되어 있으며 랜드마크 본들이 어느 하나를 단독으로 가리키지 않습니다",
|
|
1239
|
-
"REBUILD_REGION_DUPLICATE: {0} (two regions of the chest part carry this name)": "REBUILD_REGION_DUPLICATE: {0} (가슴
|
|
1241
|
+
"REBUILD_REGION_DUPLICATE: {0} (two regions of the chest part carry this name)": "REBUILD_REGION_DUPLICATE: {0} (가슴 파츠의 두 영역이 이 이름을 사용합니다)",
|
|
1240
1242
|
"REBUILD_REGION_INCOMPLETE: no region has a centre": "REBUILD_REGION_INCOMPLETE: 중심이 지정된 영역이 없습니다",
|
|
1241
1243
|
"REBUILD_REGION_INCOMPLETE: {0} bone": "REBUILD_REGION_INCOMPLETE: {0} 본",
|
|
1242
1244
|
"REBUILD_REGION_INCOMPLETE: {0} name": "REBUILD_REGION_INCOMPLETE: {0} 이름",
|
|
@@ -3115,7 +3117,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3115
3117
|
"Mesh note": "메시 메모",
|
|
3116
3118
|
"1:1": "1:1",
|
|
3117
3119
|
"Export issue": "이슈 내보내기",
|
|
3118
|
-
"PARTS_COMMENT_UNAVAILABLE: original part image required": "PARTS_COMMENT_UNAVAILABLE: 원본
|
|
3120
|
+
"PARTS_COMMENT_UNAVAILABLE: original part image required": "PARTS_COMMENT_UNAVAILABLE: 원본 파츠 이미지가 필요합니다",
|
|
3119
3121
|
"PARTS_REFERENCE_UNAVAILABLE: supply --painting to compare the original painting": "PARTS_REFERENCE_UNAVAILABLE: 원화 비교에는 --painting 입력이 필요해요",
|
|
3120
3122
|
"PARTS_COMMENT_STALE_SOURCE: reopen the bound source": "PARTS_COMMENT_STALE_SOURCE: 연결된 원본을 다시 열어 주세요",
|
|
3121
3123
|
"PARTS_COMMENT_STALE_SOURCE: original PNG changed": "PARTS_COMMENT_STALE_SOURCE: 원본 PNG가 변경됐어요",
|
|
@@ -3125,7 +3127,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3125
3127
|
"PARTS_COMMENT_CROP_LIMIT: native crop exceeds 16 million pixels": "PARTS_COMMENT_CROP_LIMIT: 네이티브 크롭이 1,600만 픽셀을 넘어요",
|
|
3126
3128
|
"Export JSON": "JSON 내보내기",
|
|
3127
3129
|
"PARTS_CAMERA_RANGE: native zoom outside supported range": "PARTS_CAMERA_RANGE: 네이티브 배율이 지원 범위 밖이에요",
|
|
3128
|
-
"Comments on this part: {count}": "이
|
|
3130
|
+
"Comments on this part: {count}": "이 파츠의 코멘트: {count}",
|
|
3129
3131
|
"COMMENT_CROP_STATE_UNAVAILABLE: stored crop cannot be read": "COMMENT_CROP_STATE_UNAVAILABLE: 저장된 크롭을 읽을 수 없어요",
|
|
3130
3132
|
"PARTS_COMMENT_NATIVE_CROP_TAMPERED: native crop differs from bound original": "PARTS_COMMENT_NATIVE_CROP_TAMPERED: 네이티브 크롭이 연결된 원본과 달라요",
|
|
3131
3133
|
"PARTS_VERDICT_READ: saved verdict cannot be read": "PARTS_VERDICT_READ: 저장된 판정을 읽을 수 없어요",
|
|
@@ -3136,13 +3138,20 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3136
3138
|
"Overlay": "오버레이",
|
|
3137
3139
|
"Part opacity": "파츠 불투명도",
|
|
3138
3140
|
"PARTS_COMPARISON_UNAVAILABLE: original painting required": "PARTS_COMPARISON_UNAVAILABLE: 원본 원화가 필요해요",
|
|
3139
|
-
"PARTS_COMPARISON_INVALID: part/overlay mode and opacity 0..1 required": "PARTS_COMPARISON_INVALID:
|
|
3141
|
+
"PARTS_COMPARISON_INVALID: part/overlay mode and opacity 0..1 required": "PARTS_COMPARISON_INVALID: 파츠/오버레이 모드와 0..1 불투명도가 필요합니다",
|
|
3140
3142
|
"PARTS_PAINT_FAILED: view could not be rendered; select the part to retry": "PARTS_PAINT_FAILED: 화면을 그리지 못했어요. 파츠를 선택해 다시 시도해 주세요",
|
|
3141
3143
|
"Assembled": "조립 보기",
|
|
3142
3144
|
"Visible": "표시",
|
|
3143
3145
|
"Show {name} in assembly": "조립 보기에서 {name} 표시",
|
|
3144
3146
|
"Assembly unavailable: atlas regions carry no rig placement.": "조립 불가: 아틀라스 영역에는 리그 배치 정보가 없어요.",
|
|
3145
3147
|
"Assembly unavailable: rig_size is not declared.": "조립 불가: rig_size가 선언되지 않았어요.",
|
|
3146
|
-
"Assembled package \u00b7 {count} visible parts. Selection and verdict remain per part.": "조립 패키지 ·
|
|
3147
|
-
"PARTS_COMMENT_UNAVAILABLE: select the individual part view to comment": "PARTS_COMMENT_UNAVAILABLE: 댓글을 쓰려면 개별
|
|
3148
|
+
"Assembled package \u00b7 {count} visible parts. Selection and verdict remain per part.": "조립 패키지 · 파츠 {count}개 표시. 선택과 판정은 파츠별로 유지돼요.",
|
|
3149
|
+
"PARTS_COMMENT_UNAVAILABLE: select the individual part view to comment": "PARTS_COMMENT_UNAVAILABLE: 댓글을 쓰려면 개별 파츠 보기로 전환해 주세요",
|
|
3150
|
+
"Mesh flags": "메시 플래그",
|
|
3151
|
+
"Part findings": "파츠 발견 사항",
|
|
3152
|
+
"Pair readings": "쌍 측정값",
|
|
3153
|
+
"Check evidence": "검사 근거",
|
|
3154
|
+
"Unclassified check rows": "미분류 검사 행",
|
|
3155
|
+
"Badges count only mesh flags and explicit part findings. Pair readings and check evidence are not counted.": "배지는 메시 플래그와 명시된 파츠 발견 사항만 세요. 쌍 측정값과 검사 근거는 세지 않아요.",
|
|
3156
|
+
"Missing or invalid row metadata: source-root rows remain unclassified and are not counted.": "행 메타데이터가 없거나 잘못됐어요. 소스·루트별 행은 미분류로 유지하고 세지 않아요.",
|
|
3148
3157
|
};
|
package/web/parts-flags.ts
CHANGED
|
@@ -7,7 +7,7 @@ type Params = Readonly<Record<string, string | number>>;
|
|
|
7
7
|
export type Translate = (key: string, params?: Params) => string;
|
|
8
8
|
export type LabelledFlag =
|
|
9
9
|
| { kind: 'faint'; item: string; art: number; maxAlpha: number; box: readonly [number, number, number, number] }
|
|
10
|
-
| { kind: 'check'; item: string; path: string; root: string; status: string | null; entry: Readonly<Record<string, unknown
|
|
10
|
+
| { kind: 'check'; item: string; path: string; root: string; status: string | null; entry: Readonly<Record<string, unknown>>; classification?: 'part' | 'pair' | 'evidence' | 'unclassified' };
|
|
11
11
|
|
|
12
12
|
const num = (v: unknown): v is number => typeof v === 'number' && Number.isFinite(v);
|
|
13
13
|
const str = (v: unknown): v is string => typeof v === 'string';
|
|
@@ -38,3 +38,11 @@ function checkReadings(flag: Extract<LabelledFlag, { kind: 'check' }>, t: Transl
|
|
|
38
38
|
}
|
|
39
39
|
return t('Check line {path}', { path: flag.path });
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/** Presentation only: verdict/2 keeps its original producer IDs and hash binding. */
|
|
43
|
+
export function readingGroup(flag: LabelledFlag): 'mesh' | 'part' | 'pair' | 'evidence' | 'unclassified' {
|
|
44
|
+
return flag.kind === 'faint' ? 'mesh' : flag.classification ?? 'unclassified';
|
|
45
|
+
}
|
|
46
|
+
export function countedFlag(flag: LabelledFlag): boolean {
|
|
47
|
+
return flag.kind === 'faint' || readingGroup(flag) === 'part';
|
|
48
|
+
}
|
package/web/parts.css
CHANGED
|
@@ -14,13 +14,15 @@ body{margin:0;background:var(--bg);color:var(--text);font:13px/1.4 system-ui,-ap
|
|
|
14
14
|
.pv-side{border-left:1px solid var(--line)}
|
|
15
15
|
h2{font-size:11px;letter-spacing:.06em;color:var(--muted);margin:4px 0 8px}
|
|
16
16
|
#pv-items{list-style:none;margin:0;padding:0}
|
|
17
|
-
#pv-items li
|
|
17
|
+
#pv-items li{display:flex;align-items:center;flex-wrap:nowrap;gap:4px}
|
|
18
|
+
#pv-items li>label{display:flex;flex:none;align-items:center}
|
|
19
|
+
#pv-items li button{min-width:0;flex:1;white-space:nowrap;width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;text-align:left;border:0;background:none;color:inherit;padding:4px 6px;border-radius:5px;cursor:pointer;font:inherit}
|
|
18
20
|
#pv-items li button[aria-current="true"]{background:color-mix(in srgb,var(--accent) 18%,transparent)}
|
|
19
21
|
.pv-name{grid-column:1;grid-row:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
20
|
-
.pv-badge{grid-column:
|
|
22
|
+
.pv-badge{grid-column:3;grid-row:1;font-size:10px;padding:0 5px;border-radius:8px;border:1px solid var(--line);color:var(--muted)}
|
|
21
23
|
.pv-badge[data-outcome="clean"]{color:var(--clean);border-color:var(--clean)}
|
|
22
24
|
.pv-badge[data-outcome="flagged"]{color:var(--flag);border-color:var(--flag)}
|
|
23
|
-
.pv-count{grid-column:
|
|
25
|
+
.pv-count{grid-column:2;grid-row:1;font-size:10px;color:var(--muted);white-space:nowrap}
|
|
24
26
|
.pv-stage{display:flex;flex-direction:column;min-width:0;min-height:0}
|
|
25
27
|
.pv-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line)}
|
|
26
28
|
.pv-field{display:flex;align-items:center;gap:5px}
|
package/web/parts.html
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<p id="pv-comment-count" role="status"></p>
|
|
36
36
|
<label class="pv-label" for="pv-note">Note</label><textarea id="pv-note" rows="4" maxlength="10000"></textarea>
|
|
37
37
|
<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>
|
|
38
|
+
<button id="pv-approve-all" type="button">Approve all</button>
|
|
38
39
|
<button id="pv-save" type="button" class="pv-primary">Save sign-off</button>
|
|
39
40
|
<span><button id="pv-export-json" type="button">Export JSON</button><button id="pv-export-issue" type="button">Export issue</button></span>
|
|
40
41
|
<p id="pv-save-status" class="pv-subtle" role="status"></p>
|
package/web/parts.ts
CHANGED
|
@@ -17,7 +17,7 @@ import {bindStageNav} from './stage-nav.ts';
|
|
|
17
17
|
import { bindDomI18n, onLanguageChange, setLinkLanguage, setLanguagePreference, t } from './i18n.ts';
|
|
18
18
|
import { pageInstanceAccess } from './instance-access.ts';
|
|
19
19
|
import { connectLiveWindow } from './live-connection.ts';
|
|
20
|
-
import { flagLabel } from './parts-flags.ts';
|
|
20
|
+
import { flagLabel, readingGroup, countedFlag } from './parts-flags.ts';
|
|
21
21
|
import { paintAssembly, pickAssembly, paintAssemblyOutline, frontParts, paintAlphaOnly, paintBackground, paintPart, paintMesh, paintOverlay, paintPaintingCrop, paintFootprints } from './parts-render.ts';
|
|
22
22
|
|
|
23
23
|
type Outcome = 'pending' | 'clean' | 'flagged';
|
|
@@ -27,9 +27,9 @@ interface Item { mesh?: Mesh; name: string; index: number; x: number; y: number;
|
|
|
27
27
|
interface Page { name: string; width: number; height: number; index: number }
|
|
28
28
|
type Flag =
|
|
29
29
|
| { id: string; item: string; source: 'mesh_report'; kind: 'faint'; art: number; maxAlpha: number; box: [number, number, number, number] }
|
|
30
|
-
| { id: string; item: string; source: 'check'; kind: 'check'; path: string; line: string; root: string; status: string | null; entry: Record<string, unknown
|
|
30
|
+
| { id: string; item: string; source: 'check'; kind: 'check'; path: string; line: string; root: string; status: string | null; entry: Record<string, unknown>; classification?: 'part' | 'pair' | 'evidence' | 'unclassified' };
|
|
31
31
|
interface ViewData {
|
|
32
|
-
painting:{sha256:string;width:number;height:number}|null;sourceHash:string;mode: 'parts' | 'atlas'; title: string; rigSize: [number, number] | null; items: Item[]; pages: Page[]; flags: Flag[];
|
|
32
|
+
painting:{sha256:string;width:number;height:number}|null;sourceHash:string;mode: 'parts' | 'atlas'; title: string; rigSize: [number, number] | null; items: Item[]; pages: Page[]; flags: Flag[]; readings?: Flag[];
|
|
33
33
|
flagSources: string[]; flagMissing: string[]; verdictFile: string;
|
|
34
34
|
verdict: { comments?:PartsComment[];status: string; parts: Record<string, Entry> } | null; verdictStale: 'files' | 'flags' | null;
|
|
35
35
|
}
|
|
@@ -187,7 +187,7 @@ function renderComparison():void {
|
|
|
187
187
|
function renderFlags(): void {
|
|
188
188
|
const data = state.data!, item = data.items[state.selected];
|
|
189
189
|
const list = $('pv-flags');
|
|
190
|
-
const flags = item ? data.flags.filter(f => f.item === item.name) : [];
|
|
190
|
+
const flags = item ? [...data.flags.filter(f => f.kind === 'faint' && f.item === item.name), ...(data.readings ?? data.flags.filter(f => f.kind === 'check')).filter(f => f.item === item.name || f.item === '')] : [];
|
|
191
191
|
const row = (f: Flag): HTMLLIElement => {
|
|
192
192
|
const li = document.createElement('li');
|
|
193
193
|
li.dataset.flagId = f.id; li.dataset.flagSource = f.source;
|
|
@@ -209,8 +209,16 @@ function renderFlags(): void {
|
|
|
209
209
|
sourceItem.dataset.pvSource = source;
|
|
210
210
|
heading.textContent = source === 'mesh_report' ? 'mesh_report.json' : 'check.json';
|
|
211
211
|
sourceItem.append(heading);
|
|
212
|
+
const categories = source === 'mesh_report' ? ['mesh'] as const : ['part', 'pair', 'evidence', 'unclassified'] as const;
|
|
213
|
+
for (const category of categories) {
|
|
214
|
+
const selected = fromSource.filter(f => readingGroup(f) === category);
|
|
215
|
+
if (!selected.length) continue;
|
|
216
|
+
const section = document.createElement('details'), title = document.createElement('summary');
|
|
217
|
+
section.dataset.pvCategory = category;
|
|
218
|
+
title.textContent = t(category === 'mesh' ? 'Mesh flags' : category === 'part' ? 'Part findings' : category === 'pair' ? 'Pair readings' : category === 'evidence' ? 'Check evidence' : 'Unclassified check rows');
|
|
219
|
+
section.append(title);
|
|
212
220
|
const roots = new Map<string, Flag[]>();
|
|
213
|
-
for (const f of
|
|
221
|
+
for (const f of selected) {
|
|
214
222
|
const root = f.kind === 'check' ? f.root : 'contour.bridges.faint';
|
|
215
223
|
const group = roots.get(root) ?? [];
|
|
216
224
|
group.push(f); roots.set(root, group);
|
|
@@ -219,7 +227,9 @@ function renderFlags(): void {
|
|
|
219
227
|
const details = document.createElement('details'), summary = document.createElement('summary'), rows = document.createElement('ul');
|
|
220
228
|
details.dataset.pvRoot = root; details.dataset.flagSource = source;
|
|
221
229
|
summary.textContent = group.length === 1 ? t('{root} · 1 row', { root }) : t('{root} · {count} rows', { root, count: group.length });
|
|
222
|
-
rows.append(...group.map(row)); details.append(summary, rows);
|
|
230
|
+
rows.append(...group.map(row)); details.append(summary, rows); section.append(details);
|
|
231
|
+
}
|
|
232
|
+
sourceItem.append(section);
|
|
223
233
|
}
|
|
224
234
|
return [sourceItem];
|
|
225
235
|
}));
|
|
@@ -228,7 +238,8 @@ function renderFlags(): void {
|
|
|
228
238
|
data.flagSources.length ? t('Read from: {files}.', { files: data.flagSources.join(', ') }) : '',
|
|
229
239
|
data.flagMissing.length ? t('Not found: {files}.', { files: data.flagMissing.join(', ') }) : '',
|
|
230
240
|
t('Occlusion coverage is not read yet: the producer does not write it.'),
|
|
231
|
-
t('
|
|
241
|
+
t('Badges count only mesh flags and explicit part findings. Pair readings and check evidence are not counted.'),
|
|
242
|
+
flags.some(f => readingGroup(f) === 'unclassified') ? t('Missing or invalid row metadata: source-root rows remain unclassified and are not counted.') : '',
|
|
232
243
|
].filter(Boolean).join(' ');
|
|
233
244
|
}
|
|
234
245
|
|
|
@@ -240,7 +251,7 @@ function renderList(): void {
|
|
|
240
251
|
button.type = 'button'; button.dataset.pvItem = item.name; button.title = item.name;
|
|
241
252
|
if (data.items[state.selected]?.name === item.name) button.setAttribute('aria-current', 'true');
|
|
242
253
|
const name = document.createElement('span'); name.className = 'pv-name'; name.textContent = item.name;
|
|
243
|
-
const onItem = data.flags.filter(f => f.item === item.name);
|
|
254
|
+
const onItem = [...data.flags.filter(f => f.kind === 'faint'), ...(data.readings ?? [])].filter(f => f.item === item.name && countedFlag(f));
|
|
244
255
|
const flags = document.createElement('span'); flags.className = 'pv-count';
|
|
245
256
|
// flagSources holds actual basenames (including custom.json); flagMissing canonically names unread kinds.
|
|
246
257
|
const meshRead = !data.flagMissing.includes('mesh_report.json'), checkRead = !data.flagMissing.includes('check.json');
|
|
@@ -257,7 +268,7 @@ function renderList(): void {
|
|
|
257
268
|
li.append(button);
|
|
258
269
|
if(data.mode==='parts'){
|
|
259
270
|
const label=document.createElement('label'),visible=document.createElement('input');visible.type='checkbox';visible.checked=!state.hidden.has(item.name);visible.dataset.pvVisible=item.name;visible.setAttribute('aria-label',t('Show {name} in assembly',{name:item.name}));
|
|
260
|
-
visible.onchange=()=>{if(visible.checked)state.hidden.delete(item.name);else state.hidden.add(item.name);void paint();};label.append(visible
|
|
271
|
+
visible.onchange=()=>{if(visible.checked)state.hidden.delete(item.name);else state.hidden.add(item.name);void paint();};label.append(visible);li.append(label);
|
|
261
272
|
}
|
|
262
273
|
return li;
|
|
263
274
|
}));
|
|
@@ -327,6 +338,30 @@ function updateEntry(change: Partial<{ outcome: Outcome; note: string }>): void
|
|
|
327
338
|
renderList();
|
|
328
339
|
}
|
|
329
340
|
|
|
341
|
+
/** Explicit approval only: refuse before changing any pending entry when a flag remains. */
|
|
342
|
+
async function approveAll(): Promise<void> {
|
|
343
|
+
if (stageEmbedded || !state.data) return;
|
|
344
|
+
const entries = state.data.items.map(item => state.verdict.get(item.name));
|
|
345
|
+
if (entries.some(entry => entry?.outcome === 'flagged' || entry?.mesh?.outcome === 'flagged')) {
|
|
346
|
+
const status = $('pv-save-status');
|
|
347
|
+
status.textContent = t('PARTS_APPROVE_ALL_FLAGGED: resolve flagged part and mesh outcomes before approving all.');
|
|
348
|
+
status.dataset.result = 'refused';
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
for (const item of state.data.items) {
|
|
352
|
+
const entry = state.verdict.get(item.name) ?? { outcome: 'pending' as Outcome, note: '' };
|
|
353
|
+
if (entry.outcome === 'pending') entry.outcome = 'clean';
|
|
354
|
+
if (item.mesh) {
|
|
355
|
+
entry.mesh ??= { outcome: 'pending', note: '' };
|
|
356
|
+
if (entry.mesh.outcome === 'pending') entry.mesh.outcome = 'clean';
|
|
357
|
+
}
|
|
358
|
+
state.verdict.set(item.name, entry);
|
|
359
|
+
}
|
|
360
|
+
$<HTMLSelectElement>('pv-overall').value = 'approved';
|
|
361
|
+
renderList(); renderVerdict(); renderMesh();
|
|
362
|
+
await save();
|
|
363
|
+
}
|
|
364
|
+
|
|
330
365
|
async function save(): Promise<void> {
|
|
331
366
|
if(stageEmbedded)return;
|
|
332
367
|
const status = $('pv-save-status');
|
|
@@ -348,6 +383,7 @@ async function boot(): Promise<void> {
|
|
|
348
383
|
header.hidden=true;status.classList.add('pv-embedded-status');header.after(status);
|
|
349
384
|
document.querySelector<HTMLElement>('.pv-layout')!.hidden=true;
|
|
350
385
|
document.querySelector<HTMLElement>('.pv-verdict')!.hidden=true;
|
|
386
|
+
const approveButton=$<HTMLButtonElement>('pv-approve-all');approveButton.disabled=true;
|
|
351
387
|
const saveButton=$<HTMLButtonElement>('pv-save');saveButton.disabled=true;saveButton.title=t('Embedded atlas inspection is read-only. Use the parts command for a separate sign-off.');
|
|
352
388
|
}
|
|
353
389
|
window.addEventListener('message',event=>{if(event.source!==parent||event.origin!==location.origin||event.data?.type!=='review-stage-language'||!['en','ko'].includes(event.data.language))return;setLinkLanguage(null);setLanguagePreference(event.data.language);});
|
|
@@ -380,6 +416,7 @@ async function boot(): Promise<void> {
|
|
|
380
416
|
for (const r of document.querySelectorAll<HTMLInputElement>('input[data-pv-outcome]')) r.onchange = () => { if (r.checked) updateEntry({ outcome: r.value as Outcome }); };
|
|
381
417
|
$<HTMLTextAreaElement>('pv-note').oninput = e => updateEntry({ note: (e.target as HTMLTextAreaElement).value });
|
|
382
418
|
$('pv-save').onclick = () => { void save(); };
|
|
419
|
+
$('pv-approve-all').onclick = () => approveAll();
|
|
383
420
|
for(const format of ['json','issue'])$('pv-export-'+format).onclick=async()=>{const res=await fetch(access.route('/api/parts/export?format='+format),{headers:access.headers()});const value=await res.text();if(!res.ok){$('pv-save-status').textContent=value;return;}const url=URL.createObjectURL(new Blob([value],{type:format==='json'?'application/json':'text/markdown'})),a=document.createElement('a');a.href=url;a.download=format==='json'?'parts-review-export.json':'parts-review-export.md';a.click();setTimeout(()=>URL.revokeObjectURL(url),1000);};
|
|
384
421
|
onLanguageChange(() => { if (state.data) select(state.selected); });
|
|
385
422
|
if (data.items.length) select(0);
|