@rig-c/review 3.7.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/docs/DESIGN.md +145 -74
- package/docs/PANELS.md +20 -12
- package/docs/PARTS_VIEW.md +133 -76
- package/docs/REVIEW_PACKAGE.md +446 -100
- package/docs/STABILITY.md +132 -198
- package/docs/WORKFLOWS.md +41 -120
- package/package.json +4 -3
- package/skills/rig-review/SKILL.md +41 -27
- package/src/build.ts +10 -2
- package/src/cli.ts +17 -16
- package/src/comment-crops.ts +6 -1
- package/src/compare-html.ts +22 -24
- package/src/compare-server.ts +1 -1
- package/src/compare-session.ts +41 -3
- package/src/correction-handoff.ts +27 -4
- package/src/create-pin-gate.ts +3 -0
- package/src/direction-inspection.ts +6 -2
- package/src/feedback-export.ts +68 -1
- package/src/front.ts +5 -200
- package/src/handoff.ts +1 -1
- package/src/interview-routes.ts +1 -1
- package/src/interview-scene.ts +3 -3
- package/src/job-act.ts +77 -73
- package/src/job-api.ts +326 -13
- package/src/job-checkpoint-evidence.ts +113 -0
- package/src/job-cli.ts +27 -14
- package/src/job-contract.ts +284 -62
- package/src/job-front.ts +192 -61
- package/src/job-host.ts +23 -4
- package/src/job-session.ts +109 -24
- package/src/job-source.ts +227 -58
- package/src/job-store.ts +80 -6
- package/src/job-worker.ts +1 -47
- package/src/joined-project.ts +61 -4
- package/src/manifest.ts +32 -4
- package/src/open-workspace.ts +12 -12
- package/src/open.ts +19 -12
- package/src/parts-comment-crops.ts +126 -31
- package/src/parts-comment.ts +351 -28
- package/src/parts-server.ts +19 -7
- package/src/parts-view.ts +588 -109
- package/src/scene-inspection.ts +50 -0
- package/src/server.ts +31 -22
- package/src/session.ts +58 -0
- package/src/stage-comment.ts +48 -1
- package/src/stage-parts.ts +23 -11
- package/web/animation-inspection.ts +1 -1
- package/web/bones-panel.ts +1 -3
- package/web/catalog-en.ts +175 -39
- package/web/catalog-ko.ts +175 -39
- package/web/cloth-panel.ts +1 -2
- package/web/compare.css +3 -13
- package/web/compare.html +3 -3
- package/web/compare.ts +69 -64
- package/web/cuts-panel.ts +1 -3
- package/web/density-strip-panel.ts +1 -2
- package/web/direction-panel.ts +22 -6
- package/web/i18n.ts +13 -1
- package/web/idle-panel.ts +1 -2
- package/web/index.html +1 -5
- package/web/inspection-persistence.ts +2 -1
- package/web/inspector-blocks.ts +149 -40
- package/web/instance-access.ts +24 -5
- package/web/interview-panel.ts +224 -175
- package/web/job-rig-capture.ts +164 -21
- package/web/job-rig-screen.ts +344 -0
- package/web/job-session.ts +611 -1443
- package/web/main.ts +614 -151
- package/web/mesh-panel.ts +1 -2
- package/web/owner-workspace.ts +88 -109
- package/web/part-selection.ts +47 -6
- package/web/part-thumbnails.ts +20 -6
- package/web/parts-render.ts +26 -19
- package/web/parts-viewport-provider.ts +181 -7
- package/web/physics-panel.ts +1 -2
- package/web/readings-panel.ts +1 -2
- package/web/requirements-panel.ts +1 -3
- package/web/retained-frame-stage.ts +105 -0
- package/web/retarget-panel.ts +2 -3
- package/web/rig-fields-panel.ts +1 -2
- package/web/rig-host.ts +64 -0
- package/web/rig-viewport-provider.ts +65 -16
- package/web/scene-plates.ts +57 -4
- package/web/stage-comments.ts +103 -46
- package/web/styles.css +117 -63
- package/web/view-controls.ts +201 -12
- package/web/viewport-capture.ts +12 -2
- package/web/viewport-controller.ts +107 -27
- package/web/viewport-pair.ts +2 -1
- package/web/workspace-preferences.ts +5 -4
- package/web/workspace-ui.ts +151 -19
- package/src/front-worker.ts +0 -2
- package/src/interview-server.ts +0 -54
- package/src/job-hub.ts +0 -304
- package/src/job-image-set.ts +0 -50
- package/web/interview.css +0 -28
- package/web/interview.html +0 -17
- package/web/interview.ts +0 -40
- package/web/job-hub.css +0 -14
- package/web/job-hub.html +0 -5
- package/web/job-hub.ts +0 -179
- package/web/owner-workspace.css +0 -14
- package/web/owner-workspace.html +0 -5
- package/web/parts-flags.ts +0 -48
- package/web/parts.css +0 -104
- package/web/parts.html +0 -49
- package/web/parts.ts +0 -604
- package/web/stage-nav.ts +0 -136
package/src/compare-html.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import {expandViewportPair} from '../web/viewport-pair.ts';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `web/index.html` owns the Setup and Animate panel markup; `web/compare.html` holds placeholders for those shared
|
|
6
|
-
* sections and `renderCompareHtml` splices them from `web/index.html` at serve time, refusing missing landmarks,
|
|
7
|
-
* duplicate IDs or any byte difference between the two pages' Setup and Animate sections.
|
|
2
|
+
/** Trusted application content, shared by client composition and the eight legacy comparison regions.
|
|
3
|
+
* Never interpolate package or request data into these constants. Headers and camera controls
|
|
4
|
+
* are constructed by workspace-ui and view-controls, not by the server splicer.
|
|
8
5
|
*/
|
|
6
|
+
export const rigWorkspaceMarkup = " <div class=\"layout\">\n <aside class=\"left-panel\"><div class=\"left-header parts-header\"><h2>PARTS</h2><input id=\"part-search\" data-part-search type=\"search\" autocomplete=\"off\" aria-label=\"Find slot\" placeholder=\"Find slot\"></div><details id=\"package-context\" class=\"package-context\"><summary><span class=\"eyebrow\">CHECKPOINTS</span><span id=\"checkpoint-title\">Select a checkpoint</span></summary><nav id=\"checkpoints\" aria-label=\"Checkpoints\"></nav><section><label for=\"reference-select\" class=\"label\">Reference</label><select id=\"reference-select\"></select><div id=\"reference-info\" class=\"hint\"></div><div id=\"person-control\" hidden><label for=\"person-select\" class=\"label space-top\">Person in input pose</label><select id=\"person-select\"></select></div></section></details><aside id=\"parts-explorer\" class=\"parts-explorer\" aria-label=\"Parts explorer\"><div class=\"parts-tools\"><button type=\"button\" data-part-whole aria-pressed=\"true\">Whole rig</button><label class=\"part-solo\"><input id=\"part-solo\" data-part-solo type=\"checkbox\" disabled>Solo selected slot</label><p data-part-status class=\"hint\" role=\"status\">Loading actual slots…</p></div><ul data-part-list aria-label=\"Actual rig slots\"></ul><p class=\"hint\">Select in context or enable Solo. Thumbnails are each slot's declared page region; a type icon stands in where the model declares none. Atlas pages are not part thumbnails.</p></aside></aside>\n <main><div class=\"viewbar\"><div data-workspace-comment></div><div data-workspace-layers></div><div data-workspace-view-tools></div><div data-workspace-camera></div></div><div id=\"chest-editor-bar\" class=\"chest-editor-bar\" role=\"region\" aria-label=\"Chest region editor\" hidden><div class=\"bust-group\" role=\"group\" aria-label=\"Chest editor mode\"><input id=\"bust-mode\" type=\"hidden\" value=\"circles\"><button id=\"bust-mode-circles\" type=\"button\" data-bust-mode=\"circles\" aria-pressed=\"true\" title=\"Two circles, each centre, core and band set by hand (#99)\">Circles</button><button id=\"bust-mode-landmarks\" type=\"button\" data-bust-mode=\"landmarks\" aria-pressed=\"false\" title=\"Three clicks (right apex, left apex, cleavage); the producer derives both circles (contour.bust)\">Landmarks</button></div><div class=\"bust-group\" data-chest-mode=\"circles\"><span class=\"bust-tag bust-tag-r\" title=\"R · character's right (image left)\">● R · character's right (image left)</span><label>X<input id=\"bust-r-x\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"R region centre x\"></label><label>Y<input id=\"bust-r-y\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"R region centre y\"></label><label>R<input id=\"bust-r-r\" type=\"number\" min=\"6\" max=\"120\" step=\"1\" inputmode=\"decimal\" aria-label=\"R region core radius\"></label><label>Band<input id=\"bust-r-band\" type=\"number\" min=\"4\" max=\"120\" step=\"1\" inputmode=\"decimal\" aria-label=\"R region band\"></label></div><div class=\"bust-group\" data-chest-mode=\"circles\"><span class=\"bust-tag bust-tag-l\" title=\"L · character's left (image right)\">● L · character's left (image right)</span><label>X<input id=\"bust-l-x\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"L region centre x\"></label><label>Y<input id=\"bust-l-y\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"L region centre y\"></label><label>R<input id=\"bust-l-r\" type=\"number\" min=\"6\" max=\"120\" step=\"1\" inputmode=\"decimal\" aria-label=\"L region core radius\"></label><label>Band<input id=\"bust-l-band\" type=\"number\" min=\"4\" max=\"120\" step=\"1\" inputmode=\"decimal\" aria-label=\"L region band\"></label></div><div id=\"bust-landmarks\" class=\"bust-group\" data-chest-mode=\"landmarks\" role=\"group\" aria-label=\"Chest landmarks (rig px)\" hidden><button id=\"lm-pick-apex_r\" type=\"button\" data-landmark=\"apex_r\" aria-pressed=\"false\" title=\"Click the part to place the right apex (character's right, image left); drag its marker to move it\">Right apex (character's right, image left)</button><label>X<input id=\"lm-apex_r-x\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Apex R x (rig px)\"></label><label>Y<input id=\"lm-apex_r-y\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Apex R y (rig px)\"></label><button id=\"lm-pick-apex_l\" type=\"button\" data-landmark=\"apex_l\" aria-pressed=\"false\" title=\"Click the part to place the left apex (character's left, image right); drag its marker to move it\">Left apex (character's left, image right)</button><label>X<input id=\"lm-apex_l-x\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Apex L x (rig px)\"></label><label>Y<input id=\"lm-apex_l-y\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Apex L y (rig px)\"></label><button id=\"lm-pick-cleavage\" type=\"button\" data-landmark=\"cleavage\" aria-pressed=\"false\" title=\"Click the part to place the cleavage; drag its marker to move it\">Cleavage</button><label>X<input id=\"lm-cleavage-x\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Cleavage x (rig px)\"></label><label>Y<input id=\"lm-cleavage-y\" type=\"number\" step=\"1\" inputmode=\"decimal\" aria-label=\"Cleavage y (rig px)\"></label></div><div id=\"bust-landmark-params\" class=\"bust-group\" data-chest-mode=\"landmarks\" role=\"group\" aria-label=\"Landmark constants\" hidden><label title=\"Core ratio r / (r + band); the producer's default is 0.22\">α<input id=\"lm-alpha\" type=\"range\" min=\"0.05\" max=\"0.95\" step=\"0.01\" value=\"0.22\" aria-label=\"Alpha, core ratio\"><output id=\"lm-alpha-value\" for=\"lm-alpha\">0.22</output></label><label title=\"Cleavage clearance in rig px; the producer's default is 3.8\">Clearance<input id=\"lm-clearance\" type=\"range\" min=\"0\" max=\"40\" step=\"0.1\" value=\"3.8\" aria-label=\"Clearance, rig px\"><output id=\"lm-clearance-value\" for=\"lm-clearance\">3.8</output></label><label title=\"Control bone for bust_r; empty is the producer's default boob_r\">Bone R<input id=\"lm-bone_r\" type=\"text\" list=\"lm-bones\" placeholder=\"boob_r\" spellcheck=\"false\" autocomplete=\"off\"></label><label title=\"Control bone for bust_l; empty is the producer's default boob_l\">Bone L<input id=\"lm-bone_l\" type=\"text\" list=\"lm-bones\" placeholder=\"boob_l\" spellcheck=\"false\" autocomplete=\"off\"></label><datalist id=\"lm-bones\"></datalist></div><span id=\"lm-derived\" class=\"hint\" data-chest-mode=\"landmarks\" aria-live=\"polite\" hidden></span><div class=\"bust-group\" data-chest-mode=\"circles\"><button id=\"bust-mirror\" type=\"button\" title=\"Copy R's y, core radius and band to L (leaves L's x as is)\">Y·size symmetry</button><button id=\"bust-download\" type=\"button\" title=\"Download chest-regions.json and its binding; evidence, not an approval\">Download JSON</button></div><div class=\"bust-group\"><button id=\"bust-apply\" type=\"button\" title=\"Run the installed producer (rig-parts remesh) on these regions or landmarks into a scratch build and load it here; the package is unchanged\">Apply · Rebuild</button><button id=\"bust-reset\" type=\"button\" title=\"Return the stage to the inspected build\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"chest\" hidden></span></div><span id=\"handoff-line\" class=\"hint handoff-line\" aria-live=\"polite\" title=\"Producer handoff: the config, parts and inspected rig an Apply rebuilds from\"></span><span id=\"chest-editor-status\" class=\"hint\" aria-live=\"polite\"></span><pre id=\"chest-editor-log\" class=\"rebuild-log\" aria-label=\"Producer output\" hidden></pre><textarea id=\"rebuild-applied\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></div><div id=\"mesh-editor-bar\" class=\"chest-editor-bar mesh-editor-bar\" role=\"region\" aria-label=\"Mesh edit\" hidden><div class=\"bust-group\" role=\"group\" aria-label=\"Mesh edit sub-mode\"><button id=\"mesh-mode-modify\" type=\"button\" data-mesh-mode=\"modify\" aria-pressed=\"false\" aria-keyshortcuts=\"V\" title=\"Modify · key V\">Modify<kbd aria-hidden=\"true\">V</kbd></button><button id=\"mesh-mode-create\" type=\"button\" data-mesh-mode=\"create\" aria-pressed=\"false\" aria-keyshortcuts=\"C\" title=\"Create · key C\">Create<kbd aria-hidden=\"true\">C</kbd></button><button id=\"mesh-mode-delete\" type=\"button\" data-mesh-mode=\"delete\" aria-pressed=\"false\" aria-keyshortcuts=\"X\" title=\"Delete · key X\">Delete<kbd aria-hidden=\"true\">X</kbd></button><button id=\"mesh-mode-edges\" type=\"button\" data-mesh-mode=\"edges\" aria-pressed=\"false\" aria-keyshortcuts=\"E\" title=\"Edges · key E\">Edges<kbd aria-hidden=\"true\">E</kbd></button></div><div class=\"bust-group\"><button id=\"mesh-undo\" type=\"button\" aria-keyshortcuts=\"Control+Z Meta+Z\" title=\"Undo the last action · Cmd/Ctrl-Z\" disabled>Undo</button><button id=\"mesh-redo\" type=\"button\" aria-keyshortcuts=\"Control+Shift+Z Meta+Shift+Z\" title=\"Redo · Shift-Cmd/Ctrl-Z\" disabled>Redo</button><button id=\"mesh-reset\" type=\"button\" title=\"Drop the whole delta for this attachment (asks first)\" disabled>Reset</button></div><div class=\"bust-group\"><button id=\"mesh-download\" type=\"button\" title=\"Download mesh-edit.json and its binding; evidence, not an approval\">Download JSON</button><button id=\"mesh-apply\" type=\"button\" title=\"Send the delta to the producer (rig-parts remesh --delta) and load the scratch revision in place; nothing is written into the package\">Apply · Rebuild</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"mesh-edit\" hidden></span></div><textarea id=\"mesh-edit-draft\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea><span id=\"mesh-editor-status\" class=\"hint\" aria-live=\"polite\"></span></div><div id=\"stage-layout\" class=\"stages\"><!-- shared:viewport-pair --></div><div class=\"stage-footer\"><span id=\"coordinates\">Drag to pan · scroll to zoom · cameras synchronized</span><span>Source files remain unchanged.</span></div><section class=\"inspector\" aria-label=\"Inspection controls\"><div class=\"inspector-heading sticky-header\"><strong>INSPECTOR</strong><span class=\"hint\">Local view controls · source files stay unchanged</span></div><div class=\"inspector-body\"><section id=\"applied-records\" class=\"applied-records\" aria-labelledby=\"applied-records-heading\" hidden><div class=\"row\"><span id=\"applied-records-heading\" class=\"eyebrow\">APPLIED RECORDS</span><button id=\"applied-undo\" type=\"button\" disabled>Undo last Apply (0 deep)</button></div><ol id=\"applied-list\" class=\"applied-list\"></ol><p id=\"applied-status\" class=\"hint\" aria-live=\"polite\"></p></section><section id=\"inspector-rig\" aria-label=\"Setup\" data-inspector-panel=\"rig\"><nav class=\"block-row\" role=\"tablist\" aria-label=\"Setup blocks\"><button type=\"button\" role=\"tab\" id=\"block-tab-selected-part\" aria-controls=\"selected-part\" aria-selected=\"true\" tabindex=\"0\" data-block-target=\"selected-part\">Part</button><button type=\"button\" role=\"tab\" id=\"block-tab-modeling-tools\" aria-controls=\"modeling-tools\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"modeling-tools\">Modeling</button><button type=\"button\" role=\"tab\" id=\"block-tab-chest-regions\" aria-controls=\"chest-regions\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"chest-regions\">Chest</button><button type=\"button\" role=\"tab\" id=\"block-tab-mesh-panel\" aria-controls=\"mesh-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"mesh-panel\">Mesh</button><button type=\"button\" role=\"tab\" id=\"block-tab-weights\" aria-controls=\"weights\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"weights\">Weights</button><button type=\"button\" role=\"tab\" id=\"block-tab-bones-panel\" aria-controls=\"bones-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"bones-panel\">Bones</button><button type=\"button\" role=\"tab\" id=\"block-tab-rig-fields\" aria-controls=\"rig-fields\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"rig-fields\">Fields</button><button type=\"button\" role=\"tab\" id=\"block-tab-cuts-panel\" aria-controls=\"cuts-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"cuts-panel\">Cuts</button><button type=\"button\" role=\"tab\" id=\"block-tab-cloth-panel\" aria-controls=\"cloth-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"cloth-panel\">Cloth</button></nav><section id=\"selected-part\" role=\"tabpanel\" aria-labelledby=\"block-tab-selected-part\" aria-label=\"Selected part\" aria-live=\"polite\"></section><section id=\"modeling-tools\" role=\"tabpanel\" aria-labelledby=\"block-tab-modeling-tools\" hidden><div class=\"eyebrow\">MODELING REVIEW</div><button data-proposal=\"mesh\" class=\"tool\">Mesh density <small>Add feedback</small></button><button data-proposal=\"contour\" class=\"tool\">Contour curvature <small>Add feedback</small></button><button data-proposal=\"chest\" class=\"tool\">Chest position <small>Add feedback</small></button><label for=\"part-set\" class=\"label space-top\">Part presets</label><select id=\"part-set\" disabled><option>No sets supplied</option></select><p class=\"hint\">Preview only · does not create motion keys.</p></section><section id=\"chest-regions\" role=\"tabpanel\" aria-labelledby=\"block-tab-chest-regions\" class=\"chest-regions\" hidden><div class=\"eyebrow\" id=\"chest-regions-heading\">CHEST REGIONS · DETAIL</div><p class=\"hint\">Crop pixels, x screen-right and y down (<code>family-chest-regions/1</code>). Place the circles with <strong>Chest regions</strong> in the view bar; this block holds names, bones, semi-axes, clip and the contour. Equal semi-axes export as a circle, unequal ones (or a clip) as the generator's 32-sample polygon. Exporting writes nothing into the package and is not an approval.</p><div class=\"chest-head\"><button id=\"chest-markers\" type=\"button\" class=\"chest-markers\" aria-pressed=\"false\" aria-controls=\"chest-editor-bar\" title=\"Draw the chest regions on the rig and edit them there; the same toggle as Chest regions in the view bar\">Markers <span class=\"chest-markers-state chest-markers-on\">On</span><span class=\"chest-markers-state chest-markers-off\">Off</span></button><div class=\"chest-crop\" role=\"group\" aria-labelledby=\"chest-crop-label\"><span id=\"chest-crop-label\" class=\"chest-label\">Crop</span><input id=\"chest-crop-w\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-label=\"Crop width\"><span aria-hidden=\"true\">×</span><input id=\"chest-crop-h\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-label=\"Crop height\"></div></div><p id=\"chest-unavailable\" class=\"hint chest-unavailable\" hidden></p><p id=\"chest-mapping\" class=\"hint\"></p><div class=\"chest-table-wrap\"><table class=\"chest-table\"><thead><tr><td></td><th scope=\"col\" id=\"chest-col-name\">Name</th><th scope=\"col\" id=\"chest-col-bone\">Bone</th><th scope=\"col\" id=\"chest-col-cx\">Centre x</th><th scope=\"col\" id=\"chest-col-cy\">Centre y</th><th scope=\"col\" id=\"chest-col-ax\">Semi-axis x</th><th scope=\"col\" id=\"chest-col-ay\">Semi-axis y</th><th scope=\"col\" id=\"chest-col-band\">Band</th><th scope=\"col\" id=\"chest-col-spacing\">Spacing</th><th scope=\"col\" id=\"chest-col-clip\">Medial clip x</th></tr></thead><tbody><tr><th scope=\"row\" id=\"chest-row-0\" class=\"chest-side chest-side-r\">Region 1</th><td class=\"chest-cell-name\"><input id=\"chest-0-name\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" aria-labelledby=\"chest-col-name chest-row-0\"></td><td class=\"chest-cell-bone\"><select id=\"chest-0-bone\" aria-labelledby=\"chest-col-bone chest-row-0\"><option value=\"\">Select bone</option></select></td><td class=\"chest-cell-cx\"><input id=\"chest-0-cx\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-cx chest-row-0\"></td><td class=\"chest-cell-cy\"><input id=\"chest-0-cy\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-cy chest-row-0\"></td><td class=\"chest-cell-ax\"><input id=\"chest-0-ax\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-ax chest-row-0\"></td><td class=\"chest-cell-ay\"><input id=\"chest-0-ay\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-ay chest-row-0\"></td><td class=\"chest-cell-band\"><input id=\"chest-0-band\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-band chest-row-0\"></td><td class=\"chest-cell-spacing\"><input id=\"chest-0-spacing\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-spacing chest-row-0\"></td><td class=\"chest-cell-clip\"><input id=\"chest-0-clip\" type=\"number\" step=\"any\" inputmode=\"decimal\" placeholder=\"none\" aria-labelledby=\"chest-col-clip chest-row-0\"></td></tr><tr><th scope=\"row\" id=\"chest-row-1\" class=\"chest-side chest-side-l\">Region 2</th><td class=\"chest-cell-name\"><input id=\"chest-1-name\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" aria-labelledby=\"chest-col-name chest-row-1\"></td><td class=\"chest-cell-bone\"><select id=\"chest-1-bone\" aria-labelledby=\"chest-col-bone chest-row-1\"><option value=\"\">Select bone</option></select></td><td class=\"chest-cell-cx\"><input id=\"chest-1-cx\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-cx chest-row-1\"></td><td class=\"chest-cell-cy\"><input id=\"chest-1-cy\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-cy chest-row-1\"></td><td class=\"chest-cell-ax\"><input id=\"chest-1-ax\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-ax chest-row-1\"></td><td class=\"chest-cell-ay\"><input id=\"chest-1-ay\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-ay chest-row-1\"></td><td class=\"chest-cell-band\"><input id=\"chest-1-band\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-band chest-row-1\"></td><td class=\"chest-cell-spacing\"><input id=\"chest-1-spacing\" type=\"number\" step=\"any\" inputmode=\"decimal\" aria-labelledby=\"chest-col-spacing chest-row-1\"></td><td class=\"chest-cell-clip\"><input id=\"chest-1-clip\" type=\"number\" step=\"any\" inputmode=\"decimal\" placeholder=\"none\" aria-labelledby=\"chest-col-clip chest-row-1\"></td></tr></tbody></table></div><fieldset class=\"chest-row chest-contour\"><legend>Contour</legend><label>Tolerance<input id=\"chest-tolerance\" type=\"number\" step=\"any\" inputmode=\"decimal\"></label><label>Margin<input id=\"chest-margin\" type=\"number\" step=\"any\" inputmode=\"decimal\"></label><label>Spacing<input id=\"chest-spacing\" type=\"number\" step=\"any\" inputmode=\"decimal\"></label><label>Max edge<input id=\"chest-max-edge\" type=\"number\" step=\"any\" inputmode=\"decimal\"></label><label>Stray<input id=\"chest-stray\" type=\"number\" step=\"any\" inputmode=\"decimal\"></label><label class=\"chest-check\"><input id=\"chest-bridges\" type=\"checkbox\">Bridges</label></fieldset><details class=\"chest-more\"><summary>Generator and mesh fields</summary><label for=\"chest-generator\" class=\"label space-top\">Public generator</label><input id=\"chest-generator\" type=\"text\" autocomplete=\"off\" spellcheck=\"false\" placeholder=\"Generator that will read this file\"><label for=\"chest-r\" class=\"label space-top\">Mesh r (optional)</label><input id=\"chest-r\" type=\"number\" step=\"any\" inputmode=\"decimal\"><label for=\"chest-segments\" class=\"label space-top\">Mesh segments JSON (optional)</label><textarea id=\"chest-segments\" rows=\"3\" spellcheck=\"false\"></textarea><label for=\"chest-source-rule\" class=\"label space-top\">Source rule (optional)</label><input id=\"chest-source-rule\" type=\"text\" autocomplete=\"off\"></details><div class=\"chest-foot\"><p id=\"chest-status\" class=\"hint\" aria-live=\"polite\"></p><button id=\"chest-export\" type=\"button\" class=\"outline\">Download chest-regions.json</button></div></section><section id=\"mesh-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-mesh-panel\" class=\"physics-panel mesh-panel\" hidden><div class=\"row\"><span id=\"mesh-panel-heading\" class=\"eyebrow\">MESH · APPLY REMESHES</span></div><p id=\"mesh-panel-state\" class=\"hint\">Select a mesh part in the parts list.</p><p class=\"hint\">Edits the selected part's <code>meshes.<part></code> entry from the handoff config (the grid and contour modes). Apply sends the whole pending entry to the installed producer's <code>remesh --mesh</code> (one patch op at <code>/meshes/<part></code>), compiles and checks the revision, and reloads it with the mesh edges on; Reset returns to the inspected build and the config's entry. Slider ranges are review's; the number field takes any value, and the producer judges it.</p><div id=\"mesh-params\" class=\"physics-controls mesh-params\"></div><div class=\"row mesh-tools\"><span class=\"eyebrow\">REGIONS</span><button id=\"mesh-add-circle\" type=\"button\" disabled>Add circle</button><button id=\"mesh-add-polygon\" type=\"button\" aria-pressed=\"false\" disabled>Draw polygon</button><button id=\"mesh-regions-edit\" type=\"button\" aria-pressed=\"false\" disabled>Drag on stage</button></div><div id=\"mesh-regions\" class=\"mesh-regions\"></div><div class=\"row mesh-tools\"><span class=\"eyebrow\">SEGMENTS</span><select id=\"mesh-segment-bone\" aria-label=\"Bone to add as a segment\" disabled></select><button id=\"mesh-segment-add\" type=\"button\" disabled>Add</button></div><ol id=\"mesh-segments\" class=\"physics-pending-list mesh-segments\"></ol><div class=\"row\"><span class=\"eyebrow\">PENDING ENTRY · DIFF AGAINST THE CONFIG</span></div><ol id=\"mesh-diff\" class=\"physics-pending-list\"></ol><ul id=\"mesh-precheck\" class=\"mesh-precheck\" aria-label=\"Review pre-check in the config loader's names\"></ul><div class=\"row\"><button id=\"mesh-panel-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"mesh-panel-reset\" type=\"button\" disabled>Reset</button><button id=\"mesh-folds\" type=\"button\" title=\"rigc render --folds of the drawn animation on the inspected build and on this revision (#108 readings)\">Folds reading</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"mesh\" hidden></span></div><output id=\"mesh-status\" class=\"environment-readout\"></output><div id=\"mesh-counts\" class=\"physics-readout\" aria-label=\"Vertex and triangle counts before and after\"></div><div id=\"mesh-readout\" class=\"physics-readout\" aria-label=\"TEXTURE_STRETCH before and after Apply\"></div><div id=\"density-strip\" class=\"density-strip\" aria-labelledby=\"density-strip-heading\"><div class=\"row\"><span id=\"density-strip-heading\" class=\"eyebrow\">DENSITY STRIP · NOTHING IS APPLIED</span></div><p id=\"density-strip-field\" class=\"hint\">Select a mesh part (grid or contour entry) to build a density strip.</p><p class=\"hint\">Builds N values of the part's density field side by side, each as its own <code>replace /meshes/<part></code> patch through remesh (into its own scratch folder). Rows are labels only: Load puts a row on the stage as pending, and the Mesh panel's Apply applies it. Closing or replacing the strip removes its scratch.</p><div class=\"row density-strip-form\"><label>N<input id=\"density-strip-n\" type=\"number\" min=\"2\" max=\"5\" step=\"1\" value=\"5\" aria-label=\"Number of values\"></label><label>from<input id=\"density-strip-from\" type=\"number\" step=\"any\" aria-label=\"From value\"></label><label>to<input id=\"density-strip-to\" type=\"number\" step=\"any\" aria-label=\"To value\"></label><button id=\"density-strip-build\" type=\"button\" disabled>Build strip</button><button id=\"density-strip-back\" type=\"button\" disabled title=\"Return the stage to the applied build it showed before a row was loaded\">Back</button><button id=\"density-strip-close\" type=\"button\" disabled>Close strip</button></div><output id=\"density-strip-status\" class=\"environment-readout\"></output><div id=\"density-strip-table\" class=\"density-strip-table\"></div></div><textarea id=\"mesh-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"weights\" role=\"tabpanel\" aria-labelledby=\"block-tab-weights\" class=\"physics-panel weights-block\" hidden><div class=\"row\"><span id=\"weights-heading\" class=\"eyebrow\">WEIGHTS · SETUP POSE · WATCH ONLY</span></div><p class=\"hint\">The selected slot's mesh at the setup pose, each vertex coloured by the weight the compiled model document stores for the picked bone (0 → 1), or by its dominant bone under <strong>Max influence</strong>. An unweighted mesh is its slot's bone at 1.0. Hover a vertex for its stored values. Nothing here edits, applies or records a weight.</p><div class=\"row weights-controls\"><button id=\"weights-show\" type=\"button\" aria-pressed=\"false\">Show weights</button><label>Colour by<select id=\"weights-mode\"><option value=\"bone\">Bone weight</option><option value=\"max\">Max influence</option></select></label><label>Bone<select id=\"weights-bone\" disabled></select></label></div><p id=\"weights-state\" class=\"hint\" aria-live=\"polite\"></p><div id=\"weights-legend\" class=\"weights-legend\" aria-label=\"Weights legend\"></div><output id=\"weights-hover\" class=\"environment-readout\"></output></section><section id=\"bones-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-bones-panel\" class=\"physics-panel bones-panel\" hidden><div class=\"row\"><span id=\"bones-panel-heading\" class=\"eyebrow\">BONES · CONFIG ANCHORS · APPLY REBUILDS</span></div><p id=\"bones-panel-state\" class=\"hint\">Reading the producer handoff…</p><p class=\"hint\">The producer config's bones at their <code>at</code>, chain <code>points</code> and <code>tip</code> (rig px, the setup pose; the stage may be posed by an animation). Drag a handle on the stage or edit the numbers: each move is a config patch op at <code>/bones/<i>/at</code>, <code>/bones/<i>/points/<k></code> or <code>/bones/<i>/tip</code> naming its bone, moved in whole rig px. <strong>Check</strong> runs <code>propose --from-config</code> on a scratch copy of the patched config (LINT and coverage lines; LINT blocks nothing) and <code>compare</code> against the handoff config. <strong>Apply</strong> rebuilds the whole rig (<code>rig --config</code>, then <code>check</code>) and needs the reproduced baseline; Reset returns to the inspected build and clears the pending ops. Adding, removing or re-parenting bones is out of scope.</p><div class=\"row bones-controls\"><button id=\"bones-edit\" type=\"button\" aria-pressed=\"false\" disabled>Edit bones on stage</button><label for=\"bones-select\">Bone</label><select id=\"bones-select\" disabled></select></div><div id=\"bones-anchor-editor\" class=\"bones-anchor-editor\"></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"bones-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"bones-check\" type=\"button\" disabled>Check</button><button id=\"bones-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"bones-reset-build\" type=\"button\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"bones\" hidden></span></div><output id=\"bones-status\" class=\"environment-readout\"></output><div id=\"bones-compare\" class=\"bones-lines\" aria-label=\"compare: origin and tip distance per moved bone\"></div><div id=\"bones-lint\" class=\"bones-lines\" aria-label=\"propose --from-config: LINT and coverage lines\"></div><textarea id=\"bones-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"rig-fields\" role=\"tabpanel\" aria-labelledby=\"block-tab-rig-fields\" class=\"physics-panel rig-fields\" hidden><div class=\"row\"><span id=\"rig-fields-heading\" class=\"eyebrow\">RIG FIELDS · CONFIG · APPLY REBUILDS</span><span id=\"rig-fields-dial-label\" class=\"idle-preview-label\" hidden>preview — Apply decides</span></div><p id=\"rig-fields-state\" class=\"hint\">Reading the producer handoff…</p><p class=\"hint\">Small producer config fields, each a config patch op: the bone a rigid part rides (<code>/regions/<part></code>), a lash's blink still row (<code>/motion/blink/still/<part></code>, dragged on the stage), a stop's inward / outward bounds (<code>/stops/<i></code>, arcs dragged at the pivot), a bone's inherit mode (<code>/bones/<i>/inherit</code>; a chain's <code>link_inherit</code>) and <code>turn</code>'s pivot and per-part depth (<code>/turn/pivot</code>, <code>/turn/depths/<part></code>). <strong>Apply</strong> rebuilds the whole rig (<code>rig --config</code>, then <code>check</code>) and needs the reproduced baseline; the producer's refusal is shown as printed. The dial only previews the drawn build's <code>turn</code> bone and is never recorded. Reset returns to the inspected build and clears the pending ops.</p><div id=\"rig-fields-region\" class=\"rig-fields-group\"></div><div id=\"rig-fields-still\" class=\"rig-fields-group\"></div><div id=\"rig-fields-stops\" class=\"rig-fields-group\"></div><div id=\"rig-fields-inherit\" class=\"rig-fields-group\"></div><div id=\"rig-fields-turn\" class=\"rig-fields-group\"></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"rig-fields-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"rig-fields-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"rig-fields-reset\" type=\"button\" disabled>Reset</button><button id=\"rig-fields-reading\" type=\"button\" disabled>Angle range</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"rig-fields\" hidden></span></div><output id=\"rig-fields-status\" class=\"environment-readout\"></output><div id=\"rig-fields-readout\" class=\"physics-readout\" aria-label=\"BLINK_NO_HOLE and FEET_STAY_LEVEL before and after\"></div><textarea id=\"rig-fields-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"cuts-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-cuts-panel\" class=\"physics-panel bones-panel cuts-panel\" hidden><div class=\"row\"><span id=\"cuts-panel-heading\" class=\"eyebrow\">CUTS · PATCHES · LIMBS · APPLY RUNS RIG-PARTS BUILD</span></div><p id=\"cuts-panel-state\" class=\"hint\">Reading the producer handoff…</p><p class=\"hint\">The producer config's <code>assemble.cuts</code> polygons, <code>assemble.patches</code> boxes and each limb joint with its <code>range</code> arc, on the stage in rig px of the setup pose. Drag a vertex, a box corner or a joint, or edit the numbers: each change is a config patch op (<code>/assemble/cuts/<i>/polygon/<k></code>, <code>/assemble/patches/<i>/box</code>, <code>/limbs/<limb>/segments/<k>/range</code>; a joint is its bone's origin, <code>/bones/…</code>). A new cut or patch adds its entry and a <code>regions</code> bone. <strong>Apply</strong> runs <code>rig-parts build</code> (assemble → rig → check) from the declared painting and See-through runs into scratch and needs the reproduced baseline; the producer's refusals (<code>ASSEMBLE_CUT_*</code>, <code>ASSEMBLE_UNDER_*</code>, <code>CONFIG_LIMB_*</code>, <code>CONFIG_PART_UNIQUE</code>) are shown as printed, and the recomposite error map, the <code>seam pair</code> lines and the build's wall clock come back with the build. Review paints no <code>under</code> or <code>cap</code> image. Reset returns to the inspected build and clears the pending ops.</p><div class=\"row bones-controls\"><button id=\"cuts-edit\" type=\"button\" aria-pressed=\"false\" disabled>Edit cuts on stage</button><label for=\"cuts-select\">Entry</label><select id=\"cuts-select\" disabled></select></div><div id=\"cuts-editor\" class=\"bones-anchor-editor\"></div><div id=\"cuts-add\" class=\"row cuts-add\"><span class=\"eyebrow\">ADD</span><select data-cuts-add=\"from\" aria-label=\"Plan part the new cut takes pixels from\"></select><input data-cuts-add=\"name\" type=\"text\" autocomplete=\"off\" placeholder=\"new part\" aria-label=\"New part name\"><input data-cuts-add=\"bone\" type=\"text\" list=\"lm-bones\" autocomplete=\"off\" placeholder=\"bone\" aria-label=\"Bone the new part's region rides\"><select data-cuts-add=\"draw\" aria-label=\"Where the new part is drawn\"></select><input data-cuts-add=\"overlap\" type=\"number\" min=\"0\" step=\"1\" value=\"0\" inputmode=\"numeric\" aria-label=\"Cut overlap band in rig px\"><select data-cuts-add=\"alpha\" aria-label=\"New patch alpha\"><option value=\"silhouette\">silhouette</option><option value=\"box\">box</option></select><button type=\"button\" data-cuts-add=\"place-cut\">Place cut</button><button type=\"button\" data-cuts-add=\"place-patch\">Place patch</button><button type=\"button\" data-cuts-add=\"finish\">Finish</button><button type=\"button\" data-cuts-add=\"cancel\">Cancel</button></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"cuts-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"cuts-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"cuts-reset\" type=\"button\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"cuts\" hidden></span></div><output id=\"cuts-status\" class=\"environment-readout\"></output><div id=\"cuts-readout\" class=\"physics-readout\" aria-label=\"The build's refusals, cut lines, recomposite, seam pairs and wall clock\"></div><textarea id=\"cuts-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"cloth-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-cloth-panel\" class=\"physics-panel bones-panel cloth-panel\" hidden><div class=\"row\"><span id=\"cloth-panel-heading\" class=\"eyebrow\">CLOTH · RECIPE PER TAG · APPLY RUNS RIG-PARTS PROPOSE --CLOTH</span></div><p id=\"cloth-panel-state\" class=\"hint\">Reading the producer handoff…</p><p class=\"hint\">The producer config's <code>cloth</code> block: one recipe per tag the installed reader accepts, with its fields as written. Each change is a config patch op at <code>/cloth/<tag>/…</code>. <strong>Show links</strong> draws the chains the tag's parts are meshed on, from the config's <code>points</code> and <code>tip</code> in rig px of the setup pose, and after an Apply the chains of the config the producer wrote. <strong>Apply</strong> runs <code>rig-parts propose --cloth --write-config</code> on the declared parts, painting and keypoints into scratch, then builds the written config (<code>rig-parts build</code> when the config declares <code>limbs</code>, else <code>rig --config</code>) and reloads it under the Environment's wind and gravity; the producer's refusals (<code>CONFIG_CLOTH_*</code>, <code>PROPOSE_CLOTH_DRAFTED</code>, <code>PROPOSE_CLOTH_PART</code>, <code>PROPOSE_WRITE_CONFIG_*</code>) are shown as printed. Review edits the recipe, never the drafted constraints. Reset returns to the inspected build and clears the pending ops.</p><div class=\"row bones-controls\"><button id=\"cloth-links\" type=\"button\" aria-pressed=\"false\" disabled>Show links on stage</button><label for=\"cloth-tag\">Tag</label><select id=\"cloth-tag\" disabled></select><label class=\"cloth-declared\"><input id=\"cloth-declared\" type=\"checkbox\" disabled> recipe declared</label></div><div id=\"cloth-fields\" class=\"cloth-fields\"></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"cloth-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"cloth-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"cloth-reset\" type=\"button\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"cloth\" hidden></span></div><output id=\"cloth-status\" class=\"environment-readout\"></output><div id=\"cloth-readout\" class=\"physics-readout\" aria-label=\"Propose's refusals, the written config's diff, the route and check\"></div><textarea id=\"cloth-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section></section><section id=\"inspector-playback\" aria-label=\"Animate\" data-inspector-panel=\"playback\" hidden><div id=\"animation-dock\" class=\"animation-dock-panel\" role=\"region\" aria-label=\"Animation timeline\"><section id=\"transport\" class=\"transport\"><button id=\"play\" aria-label=\"Play\" disabled>▶</button><label for=\"animation-select\" class=\"sr-only\">Animation</label><select id=\"animation-select\" disabled><option>No animations supplied</option></select><input id=\"scrub\" type=\"range\" min=\"0\" max=\"1\" step=\"0.001\" value=\"0\" aria-label=\"Playback time\"><output id=\"time-label\">0.0000 / 0.0000 s</output><output id=\"frame-label\">rate unknown</output><label class=\"idle-repeat\"><input id=\"idle-repeat\" type=\"checkbox\" checked>Repeat idle</label><div id=\"reading-ticks\" class=\"reading-ticks\" hidden aria-label=\"Reading ticks\"></div><div id=\"idle-blink-strip\" class=\"idle-blink-strip\" hidden><button id=\"idle-blink-marker\" type=\"button\" class=\"idle-blink-marker\" aria-label=\"Blink time\">◆</button></div></section><section id=\"frame-controls\" class=\"frame-controls\" hidden aria-label=\"Frame navigation using the explicit clock\"><label for=\"frame-number\">Frame</label><input id=\"frame-number\" type=\"number\" min=\"0\" step=\"1\" inputmode=\"numeric\" aria-label=\"Frame number to inspect\"><button id=\"frame-jump\" type=\"button\">Go</button><input id=\"frame-scrub\" type=\"range\" min=\"0\" max=\"1\" step=\"1\" value=\"0\" aria-label=\"Scrub by frame\"><span id=\"frame-clock-label\" class=\"hint\"></span><p id=\"frame-outside\" class=\"hint\" hidden>The current time is outside the explicit frame range. Enter a frame number to go to its exact time.</p></section><section id=\"animation-inspection\" aria-label=\"Read-only animation inspection\"></section></div><div id=\"animate-blocks\" class=\"animate-blocks-panel\" data-inspector-scroll><nav class=\"block-row\" role=\"tablist\" aria-label=\"Animate blocks\"><button type=\"button\" role=\"tab\" id=\"block-tab-motion-tools\" aria-controls=\"motion-tools\" aria-selected=\"true\" tabindex=\"0\" data-block-target=\"motion-tools\" data-block-includes=\"angle-panel\">Transport</button><button type=\"button\" role=\"tab\" id=\"block-tab-sound-panel\" aria-controls=\"sound-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"sound-panel\">Sound</button><button type=\"button\" role=\"tab\" id=\"block-tab-environment\" aria-controls=\"environment\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"environment\">Environment</button><button type=\"button\" role=\"tab\" id=\"block-tab-physics-panel\" aria-controls=\"physics-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"physics-panel\">Physics</button><button type=\"button\" role=\"tab\" id=\"block-tab-idle-tracks\" aria-controls=\"idle-tracks\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"idle-tracks\">Idle tracks</button><button type=\"button\" role=\"tab\" id=\"block-tab-readings\" aria-controls=\"readings\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"readings\">Readings</button><button type=\"button\" role=\"tab\" id=\"block-tab-requirements\" aria-controls=\"requirements\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"requirements\">Requirements</button><button type=\"button\" role=\"tab\" id=\"block-tab-retarget\" aria-controls=\"retarget\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"retarget\">Retarget</button><button type=\"button\" role=\"tab\" id=\"block-tab-report-panel\" aria-controls=\"report-panel\" aria-selected=\"false\" tabindex=\"-1\" data-block-target=\"report-panel\">Report</button></nav><section id=\"motion-tools\" role=\"tabpanel\" aria-labelledby=\"block-tab-motion-tools\"><div class=\"eyebrow\">MOTION · EDITS BUILD THROUGH THE PRODUCER</div><button data-proposal=\"pose\" class=\"tool\">Inspect pose <small>Add feedback</small></button><button data-proposal=\"timing\" class=\"tool\">Inspect interval <small>Add feedback</small></button><button data-proposal=\"audio\" class=\"tool\">Audio links <small>Add feedback</small></button><button data-proposal=\"angle\" class=\"tool\">Angle inspection <small id=\"axis-state\">No inspection axes supplied</small></button></section><section id=\"angle-panel\" class=\"angle-panel\" hidden><label for=\"axis-select\">Rig inspection axis</label><select id=\"axis-select\"></select><label id=\"axis-label\" for=\"axis-value\"></label><input id=\"axis-value\" type=\"range\" disabled><output id=\"axis-value-label\"></output><p class=\"hint\">Maps one inspection axis to its animation time. This does not rotate the camera.</p></section><section id=\"sound-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-sound-panel\" class=\"sound-panel\" hidden><div class=\"row\"><span class=\"eyebrow\">SOUND CUES</span><label><input id=\"sync-audio\" type=\"checkbox\">Play cue audio in sync</label></div><div id=\"cues\"></div><div class=\"row\"><label for=\"audio-volume\">Audio volume</label><input id=\"audio-volume\" type=\"range\" min=\"0\" max=\"1\" step=\"0.05\" value=\"0.8\"><output id=\"audio-volume-label\">80%</output></div><div id=\"event-log\" class=\"hint\" aria-live=\"polite\">Runtime events: none</div></section><section id=\"environment\" role=\"tabpanel\" aria-labelledby=\"block-tab-environment\" class=\"environment-panel\" hidden><div class=\"row\"><span id=\"environment-heading\" class=\"eyebrow\">ENVIRONMENT · INSPECTION ONLY</span></div><p class=\"hint\">Wind, gravity and impulses go to the player while you inspect. Nothing is written to the model or motion; feedback records the state as context.</p><input id=\"environment-applied\" type=\"checkbox\" hidden aria-hidden=\"true\" tabindex=\"-1\"><div class=\"row\"><label for=\"wind-base\">Wind</label><input id=\"wind-base\" type=\"range\" min=\"-100\" max=\"100\" step=\"1\" value=\"0\" disabled><output id=\"wind-base-label\">0</output></div><div class=\"row\"><label><input id=\"wind-breeze\" type=\"checkbox\" disabled>Breeze</label><button id=\"wind-gust\" type=\"button\" disabled>Gust</button><label><input id=\"wind-repeat\" type=\"checkbox\" disabled>Repeat</label></div><div class=\"row\"><label for=\"wind-gust-peak\">Gust peak</label><input id=\"wind-gust-peak\" type=\"number\" min=\"0\" max=\"200\" step=\"1\" value=\"48\" inputmode=\"decimal\" disabled><label for=\"wind-gust-duration\">Duration (s)</label><input id=\"wind-gust-duration\" type=\"number\" min=\"0.1\" max=\"20\" step=\"0.1\" value=\"2.4\" inputmode=\"decimal\" disabled></div><output id=\"wind-readout\" class=\"environment-readout\">No compiled model drawn · environment unavailable</output><div class=\"row\"><label for=\"gravity\">Gravity</label><input id=\"gravity\" type=\"range\" min=\"0\" max=\"4\" step=\"0.05\" value=\"1\" disabled><output id=\"gravity-label\">1.00</output></div><div class=\"row\"><button id=\"jolt\" type=\"button\" disabled>Jolt</button><button id=\"physics-reset\" type=\"button\" disabled>Reset physics</button></div><p class=\"hint\">Dragging the rig pane pans the camera and tells the physics the rig moved, so hair and cloth trail; a click that does not move still selects a part. Hold Space to pan only. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.</p><div class=\"row\"><label title=\"Readings and Apply's check read this wind and gravity as a rigc-environment/1 schedule; the wind clock restarts with the clip so you watch the same world\"><input id=\"environment-use\" type=\"checkbox\" disabled>Use for readings</label><button id=\"environment-export\" type=\"button\" disabled>Export schedule</button><button id=\"environment-check\" type=\"button\" disabled>Check under this world</button></div><output id=\"environment-schedule\" class=\"environment-readout\">No schedule · the controls are not applied (the player stands at the runtime start values)</output><div id=\"environment-check-lines\" class=\"environment-check-lines\" aria-live=\"polite\"></div><p class=\"hint\">The schedule is the controls as a <code>rigc-environment/1</code> file from the clip's first frame: one step when the wind is steady, else one step per frame at 12 fps (between frames rigc holds the frame's value). A one-off Gust is not in it; Repeat puts gusts in it. Check under this world runs <code>rig-parts check --environment</code> on the build on the stage; the default-world line is that build's own check.</p></section><section id=\"physics-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-physics-panel\" class=\"physics-panel\" hidden><div class=\"row\"><span id=\"physics-panel-heading\" class=\"eyebrow\">PHYSICS TUNING · APPLY REBUILDS</span></div><p id=\"physics-panel-state\" class=\"hint\">No compiled model drawn.</p><p class=\"hint\">Each edit is a config patch op at <code>/constraints/<i>/<field></code> naming its constraint. Apply runs the installed producer (<code>rig --config</code>, then <code>check</code>) into a scratch build and reloads it under the same wind, gust and jolt state; Reset returns to the inspected build and clears the pending ops. Live preview changes strength, damping, inertia, wind, gravity and mix on the next evaluation; mass and component toggles require Apply. Clear resumes authored values without resetting integrated history.</p><div class=\"row\"><label><input data-physics-preview type=\"checkbox\" checked>Preview pending physics</label><button id=\"physics-preview-clear\" type=\"button\">Clear preview</button></div><output id=\"physics-preview-label\" class=\"environment-readout\">Preview off · Apply decides.</output><div class=\"row physics-chain-row\"><label for=\"physics-chain\">Chain</label><select id=\"physics-chain\" disabled></select><button id=\"physics-chain-pick\" type=\"button\" aria-pressed=\"false\" disabled>Pick on stage</button></div><div class=\"row physics-ramp-row\"><label for=\"physics-ramp-field\">Ramp</label><select id=\"physics-ramp-field\" disabled></select><label for=\"physics-ramp-root\">root</label><input id=\"physics-ramp-root\" type=\"number\" step=\"any\" inputmode=\"decimal\" disabled><label for=\"physics-ramp-tip\">tip</label><input id=\"physics-ramp-tip\" type=\"number\" step=\"any\" inputmode=\"decimal\" disabled><button id=\"physics-ramp\" type=\"button\" disabled>Ramp</button></div><div class=\"physics-work\"><div id=\"physics-rows\" class=\"physics-table-wrap\" role=\"region\" aria-label=\"Physics constraints the config declares\" tabindex=\"0\"></div><div id=\"physics-row-editor\" class=\"physics-row-editor\"></div></div><div id=\"physics-locked\" class=\"physics-table-wrap physics-locked\" role=\"region\" aria-label=\"Constraints that are not editable\" tabindex=\"0\" hidden></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"physics-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"physics-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"physics-reset-build\" type=\"button\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"physics\" hidden></span></div><output id=\"physics-apply-status\" class=\"environment-readout\"></output><div id=\"physics-readout\" class=\"physics-readout\" aria-label=\"Check readout before and after Apply\"></div><textarea id=\"physics-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"idle-tracks\" role=\"tabpanel\" aria-labelledby=\"block-tab-idle-tracks\" class=\"physics-panel idle-panel\" hidden><div class=\"row\"><span id=\"idle-tracks-heading\" class=\"eyebrow\">IDLE TRACKS · APPLY REBUILDS</span><span id=\"idle-preview-label\" class=\"idle-preview-label\" aria-live=\"polite\" hidden>preview — Apply decides</span></div><p id=\"idle-tracks-state\" class=\"hint\">No compiled model drawn.</p><p class=\"hint\">Each edit is a config patch op at <code>/motion/tracks/<i>/…</code> or <code>/motion/blink/…</code>. Period is offered only among the divisors of <code>motion.duration</code> (the producer refuses any other, <code>CONFIG_PERIOD_DIVIDES_DURATION</code>). While edits are pending the preview drives the edited bones through the player's <code>adjust</code> with the producer's sine, <code>v(t) = base + amp·sin(2π(t/period − phase))</code>, on the bone the idle keys (<code><bone>_ctl</code> under ctl keys); it is never recorded or submitted. Apply runs the installed producer (<code>rig --config</code>, then <code>check</code>) into a scratch build and replaces the preview with the built idle; Reset returns to the inspected build and clears the pending ops.</p><p id=\"idle-keys-line\" class=\"hint\"></p><div class=\"physics-work\"><div id=\"idle-track-list\" class=\"physics-table-wrap\" role=\"region\" aria-label=\"Idle tracks the config states\" tabindex=\"0\"></div><div id=\"idle-track-editor\" class=\"physics-row-editor\"></div></div><datalist id=\"idle-bones\"></datalist><div class=\"row idle-add-row\"><span class=\"eyebrow\">ADD</span><input data-idle-add-bone type=\"text\" list=\"idle-bones\" autocomplete=\"off\" placeholder=\"bone\" aria-label=\"Bone for a new track\" disabled><select data-idle-add-prop aria-label=\"Property for a new track\" disabled></select><button data-idle-add-single type=\"button\" disabled>Add track</button><select data-idle-add-chain aria-label=\"Chain for a new chain track\" disabled></select><button data-idle-add-chain-button type=\"button\" disabled>Add chain track</button></div><div id=\"idle-blink\" class=\"idle-blink\"></div><div class=\"row\"><label class=\"idle-preview-toggle\"><input data-idle-preview type=\"checkbox\" checked>Preview edits (not recorded)</label></div><div id=\"idle-precheck\" class=\"idle-precheck\" aria-label=\"Review pre-check\"></div><div class=\"row\"><span class=\"eyebrow\">PENDING OPS</span></div><ol id=\"idle-pending-list\" class=\"physics-pending-list\"></ol><div class=\"row\"><button id=\"idle-apply\" type=\"button\" class=\"primary\" disabled>Apply</button><button id=\"idle-reset\" type=\"button\" disabled>Reset</button><span class=\"hint rebuild-drop-notice\" data-rebuild-drop=\"idle\" hidden></span></div><output id=\"idle-apply-status\" class=\"environment-readout\"></output><div id=\"idle-readout\" class=\"physics-readout\" aria-label=\"Check readout before and after Apply\"></div><textarea id=\"idle-pending\" class=\"sr-only\" hidden aria-hidden=\"true\" tabindex=\"-1\"></textarea></section><section id=\"readings\" role=\"tabpanel\" aria-labelledby=\"block-tab-readings\" class=\"readings-panel\" hidden><div class=\"row\"><span id=\"readings-heading\" class=\"eyebrow\">READINGS · RIGC RENDER</span></div><p class=\"hint\">Each reading is one <code>rigc render</code> of the drawn animation, on the inspected build and on the latest scratch build. Its frames become ticks under the timeline (<span class=\"tick-swatch inspected\" aria-hidden=\"true\"></span> inspected, <span class=\"tick-swatch scratch\" aria-hidden=\"true\"></span> scratch; click one to seek) and each pair gets its worst-frame line. A reading, not a gate: an unknown slot or bone is refused with rigc's own line.</p><datalist id=\"readings-slots\"></datalist><datalist id=\"readings-bones\"></datalist><div class=\"row\"><label><input id=\"readings-folds\" type=\"checkbox\">Folds</label><label><input id=\"readings-overlaps\" type=\"checkbox\">Overlaps</label></div><div class=\"row readings-pair\"><label><input id=\"readings-pass-on\" type=\"checkbox\">Pass-through</label><input id=\"readings-pass-cloth\" type=\"text\" list=\"readings-slots\" autocomplete=\"off\" placeholder=\"cloth slot\" aria-label=\"Pass-through cloth slot\"><span aria-hidden=\"true\">:</span><input id=\"readings-pass-leg\" type=\"text\" list=\"readings-slots\" autocomplete=\"off\" placeholder=\"leg slot\" aria-label=\"Pass-through leg slot\"></div><div class=\"row readings-pair\"><label><input id=\"readings-seam-on\" type=\"checkbox\">Seam</label><input id=\"readings-seam-a\" type=\"text\" list=\"readings-slots\" autocomplete=\"off\" placeholder=\"slot\" aria-label=\"Seam first slot\"><span aria-hidden=\"true\">:</span><input id=\"readings-seam-b\" type=\"text\" list=\"readings-slots\" autocomplete=\"off\" placeholder=\"slot\" aria-label=\"Seam second slot\"></div><div class=\"row readings-pair\"><label><input id=\"readings-angle-on\" type=\"checkbox\">Angle range</label><input id=\"readings-angle-bone\" type=\"text\" list=\"readings-bones\" autocomplete=\"off\" placeholder=\"bone\" aria-label=\"Angle range bone\"><span aria-hidden=\"true\">vs</span><input id=\"readings-angle-relative\" type=\"text\" list=\"readings-bones\" autocomplete=\"off\" placeholder=\"relative bone\" aria-label=\"Angle range relative-to bone\"></div><div class=\"row\"><button id=\"readings-run\" type=\"button\" disabled>Run readings</button></div><p id=\"readings-status\" class=\"hint\" aria-live=\"polite\">No compiled model drawn.</p><ul id=\"readings-worst\" class=\"readings-worst\" aria-label=\"Worst frame per reading\"></ul></section><section id=\"requirements\" role=\"tabpanel\" aria-labelledby=\"block-tab-requirements\" class=\"readings-panel requirements-panel\" hidden><div class=\"row\"><span id=\"requirements-heading\" class=\"eyebrow\">REQUIREMENTS · RIG-PARTS CHECK</span></div><p class=\"hint\">Declare what the scene asks of the motion: a slot (picked on the stage), its mesh or a bone, an animation and a kind, with your own bar. Check writes a <code>spine-parts-requirements/1</code> file into scratch and runs the installed producer's <code>rig-parts check --requirements</code> on the inspected rig or the latest scratch build; each requirement gets one line with its worst frame (click to seek). A refusal is the producer's, by name. Waivers (<code>may_fold</code>), scene targets and the part exception lists are not written here. Submitted feedback carries the file by hash and content.</p><div id=\"requirements-body\"></div></section><section id=\"retarget\" role=\"tabpanel\" aria-labelledby=\"block-tab-retarget\" class=\"readings-panel requirements-panel retarget-panel\" hidden><div class=\"row\"><span id=\"retarget-heading\" class=\"eyebrow\">RETARGET · RIG-POSE</span></div><p class=\"hint\">Put a pose sequence the package declares onto this rig: edit the <code>rig-pose-map/1</code> (per chain, the bone that carries each segment), set the clean and retarget flags, and Apply. The installed <code>@rig-c/pose</code> runs <code>rig-pose clean</code> and <code>rig-pose retarget</code> onto the handoff rig, and its <code>rigc</code> compiles the result, all into scratch; the new animation plays here beside the reference (pick the sequence under Reference). Review writes no keys and never writes the package's <code>motion.json</code>. Refusals (<code>POSE_NOT_CLEANED</code>, <code>POSE_BEND_ONE_WAY</code>, <code>RAISED_HEAD</code>, <code>MOTION_NAME_FREE</code>, <code>MAP_*</code>) are the producer's, verbatim. FEET, STANCE, FLIP, SHORT, END-ON, LEG-SCALE and REACH lines seek to their frame.</p><div id=\"retarget-body\"></div></section><section id=\"report-panel\" role=\"tabpanel\" aria-labelledby=\"block-tab-report-panel\" class=\"report-panel\" hidden><div class=\"report-header\"><h2 id=\"report-heading\">Report events</h2><span id=\"report-summary\" class=\"subtle\"></span><a id=\"report-source-link\" target=\"_blank\" rel=\"noopener\" hidden>Source report</a></div><p id=\"report-unavailable\" class=\"hint\" hidden>No rig-pose-report/1 events supplied.</p><div id=\"report-browser\"><div class=\"report-controls\"><label for=\"report-category\" class=\"sr-only\">Report event category</label><select id=\"report-category\"><option value=\"all\">All events</option></select><button id=\"report-previous\" type=\"button\" aria-label=\"Previous event page\">Previous</button><output id=\"report-page\"></output><button id=\"report-next\" type=\"button\" aria-label=\"Next event page\">Next</button></div><div id=\"report-empty-categories\" class=\"report-empty-categories\"></div><p id=\"report-missing\" class=\"hint\" hidden></p><ol id=\"report-events\" class=\"report-event-list\" aria-label=\"Read-only report events\"></ol><section id=\"report-selection\" class=\"report-selection\" hidden aria-labelledby=\"report-selection-heading\"><h3 id=\"report-selection-heading\"></h3><p id=\"report-timing\" class=\"hint\"></p><div class=\"report-controls\"><label id=\"report-time-label\" for=\"report-time\" hidden>Select explicit time</label><select id=\"report-time\" hidden></select><button id=\"report-seek\" type=\"button\" disabled>Go to explicit time</button></div><div id=\"report-target-control\" hidden><label for=\"report-target\" class=\"label space-top\">Select a target named in the report</label><select id=\"report-target\"></select></div><p id=\"report-prefill-note\" class=\"hint\"></p><p id=\"report-provenance\" class=\"hint\"></p><details><summary>Source event details</summary><pre id=\"report-details\"></pre></details></section></div></section></div></section></div></section></main></div><div data-workspace-status></div>";
|
|
7
|
+
export const rigReviewDialogMarkup = "<dialog id=\"review-dialog\" class=\"review-dialog\" aria-labelledby=\"review-dialog-title\"><div class=\"review-dialog-header\"><h2 id=\"review-dialog-title\">Comments</h2><span class=\"hint\">Drafts save locally as you type · nothing is submitted until you press Submit</span><button id=\"review-dialog-close\" type=\"button\">Close</button></div><section id=\"inspector-feedback\" class=\"review-dialog-body\" aria-label=\"Feedback\"><div class=\"review-summary\"><div class=\"eyebrow\">REVIEW</div><label for=\"review-status\" class=\"label\">Review status</label><select id=\"review-status\"><option value=\"pending\">Pending</option><option value=\"approved\">Approved</option><option value=\"changes-requested\">Changes requested</option></select><section class=\"provenance\" aria-label=\"Reviewed source\"><div class=\"eyebrow\">REVIEWED SOURCE</div><div class=\"provenance-row\"><span>Package revision</span><strong id=\"provenance-version\">—</strong></div><div class=\"provenance-row\"><span>rig SHA-256</span><code id=\"provenance-rig\">—</code></div><div class=\"provenance-row\"><span>motion SHA-256</span><code id=\"provenance-motion\">—</code><span id=\"provenance-motion-missing\" hidden>Not supplied</span></div><details><summary>Full provenance</summary><pre id=\"provenance-full\"></pre></details><div class=\"source-files\"><div class=\"eyebrow\">SOURCE FILES · READ ONLY</div><div id=\"source-files\"></div></div><p class=\"hint\">Submits server-verified file hashes and tool versions. Your selected review status is preserved.</p></section><div class=\"divider\"></div></div><div id=\"checkpoint-detail\"><div class=\"eyebrow\">SELECTED CHECKPOINT</div><h1 id=\"detail-title\">Checkpoint</h1><p id=\"detail-note\" class=\"hint\"></p><fieldset class=\"outcome\"><legend>Checkpoint outcome</legend><label><input type=\"radio\" name=\"outcome\" value=\"pending\" checked>Pending</label><label><input type=\"radio\" name=\"outcome\" value=\"pass\">Pass</label><label><input type=\"radio\" name=\"outcome\" value=\"fail\">Needs changes</label></fieldset><div class=\"label space-top\">Review notes</div><pre id=\"checkpoint-note\" class=\"feedback-json\"></pre></div><div class=\"divider\"></div><section id=\"proposal-panel\"><div class=\"eyebrow\">STRUCTURED FEEDBACK</div><div class=\"label\">Frame range · inclusive</div><div class=\"frame-range\"><label>Start<input id=\"feedback-start\" type=\"number\" min=\"0\" step=\"1\" inputmode=\"numeric\" placeholder=\"e.g. 18\"></label><label>End<input id=\"feedback-end\" type=\"number\" min=\"0\" step=\"1\" inputmode=\"numeric\" placeholder=\"e.g. 32\"></label></div><p id=\"feedback-range-hint\" class=\"hint\">Checking frame bounds…</p><label for=\"feedback-target-kind\" class=\"label space-top\">Target type</label><select id=\"feedback-target-kind\"><option value=\"\">Select target</option><option value=\"rig\">Entire rig</option><option value=\"bone\">Bone</option><option value=\"slot\">Slot</option></select><label for=\"feedback-target-name\" class=\"label space-top\">Target name</label><input id=\"feedback-target-name\" type=\"text\" list=\"feedback-target-names\" autocomplete=\"off\" placeholder=\"Actual bone or slot name\"><datalist id=\"feedback-target-names\"></datalist><p id=\"feedback-target-hint\" class=\"hint\"></p><label for=\"feedback-category\" class=\"label space-top\">Category</label><select id=\"feedback-category\"><option value=\"\">Select category</option><option value=\"defect\">Defect</option><option value=\"quality\">Quality</option></select><details id=\"correction-controls\"><summary>Correction handoff</summary><label class=\"label space-top\" for=\"correction-path\">Correction path</label><select id=\"correction-path\"><option value=\"\">Ordinary feedback</option><option value=\"described\">Described correction</option><option value=\"made\">Made correction</option></select><label class=\"label space-top\" for=\"correction-stage\">Create review stage</label><select id=\"correction-stage\"><option value=\"parts-review\">Parts review</option><option value=\"rig-review\">Rig review</option><option value=\"direction-review\">Direction review</option></select><label class=\"label space-top\" for=\"correction-selector\">Create draft ID or version number</label><input id=\"correction-selector\" type=\"text\" maxlength=\"64\"><div id=\"correction-post-fields\" hidden><label class=\"label space-top\" for=\"correction-model\">Declared post model path</label><input id=\"correction-model\" type=\"text\" maxlength=\"512\"></div><label class=\"label space-top\" for=\"correction-words\">Exact correction text (UTF-8 file)</label><input id=\"correction-words\" type=\"file\" accept=\"text/plain,.txt\"></details><button id=\"add-proposal\" class=\"outline block\">Add correction</button><p id=\"proposal-boundary\" class=\"hint\">Records the current checkpoint, time, reference, camera and inspection axis. Motion is read only: inspect, mark ranges and export feedback. No keys or source files are edited.</p><p id=\"feedback-warnings\" class=\"hint\" role=\"status\" hidden></p><p id=\"feedback-applied-check\" class=\"hint error\" role=\"alert\" hidden></p><div id=\"comments-list-host\"></div><div id=\"proposal-list\"></div></section><details id=\"strip-panel\" class=\"report-panel\"><summary>Export frame strip</summary><p class=\"hint\">Uses the feedback form start and end frames, inclusive. Inspection time and source files remain unchanged.</p><label for=\"strip-scope\" class=\"label\">Export range</label><select id=\"strip-scope\"><option value=\"interval\">Entered start–end frames</option><option value=\"feedback\">All feedback ranges</option></select><label for=\"strip-reference\" class=\"label space-top\">Reference video</label><select id=\"strip-reference\"><option value=\"\">Select reference video</option></select><label for=\"strip-format\" class=\"label space-top\">Format</label><select id=\"strip-format\"><option value=\"png\">PNG strip</option><option value=\"json\">JSON frames and provenance</option></select><p class=\"hint\">PNG requires frameTimes in the selected report. Without it, JSON preserves requested frames with time: null. Batch export requires every feedback item to match the selected animation. Unsubmitted feedback is included; exporting does not submit the review.</p><button id=\"strip-export\" type=\"button\" disabled>Download strip</button><p id=\"strip-status\" class=\"hint\" role=\"status\" aria-live=\"polite\">Loading package…</p></details></section><div class=\"review-dialog-actions\"><span id=\"review-message\" class=\"review-message\" role=\"status\" aria-live=\"polite\"></span><span id=\"review-draft-state\" class=\"review-draft-state\" role=\"status\" aria-live=\"polite\"></span><span id=\"review-draft-recovery\" class=\"review-draft-recovery\"></span><button id=\"save\" class=\"primary\" disabled>Submit review</button></div></dialog>";
|
|
8
|
+
export const sharedViewToolsMarkup = "<div class=\"view-tools\"><button id=\"chest-edit\" type=\"button\" class=\"view-tool\" aria-pressed=\"false\" aria-controls=\"chest-editor-bar\" title=\"Place the two chest regions on the rig: drag a centre, the core edge or the band\" hidden>Chest regions</button><button id=\"mesh-edit\" type=\"button\" class=\"view-tool\" aria-pressed=\"false\" aria-controls=\"mesh-editor-bar\" title=\"Edit the selected slot's actual mesh as a typed delta: preview only, the producer retriangulates\" hidden>Edit mesh</button></div>";
|
|
9
|
+
export const sharedCommentMarkup = "<button id=\"stage-comment\" type=\"button\" aria-pressed=\"false\" aria-expanded=\"false\" aria-controls=\"stage-comment-list\" title=\"Comment · C (active mesh editor keeps C)\">Comment · C (0)</button>";
|
|
10
|
+
export const rigLayerControlsMarkup = "<fieldset id=\"layer-controls\" class=\"layer-toggles\"><legend class=\"sr-only\">Rig layers</legend><label class=\"layer-toggle\" title=\"No rig supplied\"><input aria-keyshortcuts=\"I\" id=\"layer-images\" type=\"checkbox\" checked disabled><span>Images</span><kbd aria-hidden=\"true\">I</kbd></label><label class=\"layer-toggle\" title=\"No rig supplied\"><input aria-keyshortcuts=\"M\" id=\"layer-mesh\" type=\"checkbox\" disabled><span>Mesh edges</span><kbd aria-hidden=\"true\">M</kbd></label><label class=\"layer-toggle\" title=\"No rig supplied\"><input aria-keyshortcuts=\"B\" id=\"layer-bones\" type=\"checkbox\" disabled><span>Bone points</span><kbd aria-hidden=\"true\">B</kbd></label></fieldset>";
|
|
11
|
+
export const legacyCompareLayerControlsMarkup = "<fieldset id=\"layer-controls\"><legend>Rig layers</legend><label><input id=\"layer-images\" type=\"checkbox\" checked disabled>Images</label><label><input id=\"layer-mesh\" type=\"checkbox\" disabled>Mesh edges</label><label><input id=\"layer-bones\" type=\"checkbox\" disabled>Bone points</label></fieldset>";
|
|
12
|
+
export const legacyCompareHeaderContent = {"modeSwitch": "<div class=\"mode-switch\" role=\"group\" aria-label=\"Mode\"><button type=\"button\" data-mode=\"rig\" aria-pressed=\"false\">Setup</button><button type=\"button\" data-mode=\"playback\" aria-pressed=\"false\">Animate</button><button type=\"button\" data-mode=\"compare\" aria-pressed=\"true\">Compare</button></div>", "buildPicker": "<div id=\"mode-build-picker\" class=\"mode-build-picker\" role=\"group\" aria-label=\"Picked build for Setup and Animate\" hidden><span class=\"eyebrow\">Editing</span><button type=\"button\" data-build-side=\"a\" aria-pressed=\"true\">Build A</button><button type=\"button\" data-build-side=\"b\" aria-pressed=\"false\">Build B</button><span id=\"picked-build-label\" class=\"picked-build-label\" role=\"status\" aria-live=\"polite\">Build A</span></div>", "actions": "<div class=\"actions\"><span id=\"save-state\" class=\"hint\">Loading…</span><button id=\"export-json\">Feedback JSON</button><button id=\"export-markdown\">Issue Markdown</button><button id=\"submit\" class=\"primary\" disabled>Submit review</button></div>"};
|
|
13
|
+
/** Original dialog data; the rig composition reparents its real form and action nodes. */
|
|
14
|
+
export const rigFeedbackMarkup = rigReviewDialogMarkup;
|
|
9
15
|
|
|
10
16
|
export interface SharedWorkspaceMarkup {
|
|
11
|
-
viewTools: string;
|
|
12
17
|
stageBars: string;
|
|
13
18
|
stageHandles: string;
|
|
14
19
|
appliedRecords: string;
|
|
@@ -26,13 +31,6 @@ const REGIONS: readonly {
|
|
|
26
31
|
end: string;
|
|
27
32
|
compareEnd: string;
|
|
28
33
|
}[] = [
|
|
29
|
-
{
|
|
30
|
-
key: 'viewTools',
|
|
31
|
-
placeholder: '<!-- shared:view-tools -->',
|
|
32
|
-
start: '<div class="view-tools">',
|
|
33
|
-
end: '<div class="zoom-controls">',
|
|
34
|
-
compareEnd: '<div class="row"><label class="camera-sync">',
|
|
35
|
-
},
|
|
36
34
|
{
|
|
37
35
|
key: 'stageBars',
|
|
38
36
|
placeholder: '<!-- shared:stage-bars -->',
|
|
@@ -99,10 +97,10 @@ function sliceRegion(html: string, start: string, end: string, label: string): s
|
|
|
99
97
|
return html.slice(a, b);
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
export function extractSharedWorkspaceMarkup(
|
|
103
|
-
|
|
100
|
+
export function extractSharedWorkspaceMarkup(content: string = rigWorkspaceMarkup): SharedWorkspaceMarkup {
|
|
101
|
+
content=expandViewportPair(content);
|
|
104
102
|
const out = {} as Record<keyof SharedWorkspaceMarkup, string>;
|
|
105
|
-
for (const r of REGIONS) out[r.key] = sliceRegion(
|
|
103
|
+
for (const r of REGIONS) out[r.key] = sliceRegion(content, r.start, r.end, r.key);
|
|
106
104
|
return out;
|
|
107
105
|
}
|
|
108
106
|
|
|
@@ -115,25 +113,25 @@ export function assertNoDuplicateIds(html: string, label = 'compare.html'): void
|
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
export function assertSharedCompareMarkup(compareHtml: string,
|
|
119
|
-
const shared = extractSharedWorkspaceMarkup(
|
|
116
|
+
export function assertSharedCompareMarkup(compareHtml: string, content: string = rigWorkspaceMarkup): void {
|
|
117
|
+
const shared = extractSharedWorkspaceMarkup(content);
|
|
120
118
|
for (const r of REGIONS) {
|
|
121
119
|
const piece = shared[r.key].trim();
|
|
122
120
|
let actual: string;
|
|
123
121
|
try {
|
|
124
122
|
actual = sliceRegion(compareHtml, r.start, r.compareEnd, r.key).trim();
|
|
125
123
|
} catch {
|
|
126
|
-
throw new Error(`COMPARE_SHARED_MARKUP_DRIFT: ${r.key} in compare markup differs from
|
|
124
|
+
throw new Error(`COMPARE_SHARED_MARKUP_DRIFT: ${r.key} in compare markup differs from canonical workspace content`);
|
|
127
125
|
}
|
|
128
126
|
if (actual !== piece) {
|
|
129
|
-
throw new Error(`COMPARE_SHARED_MARKUP_DRIFT: ${r.key} in compare markup differs from
|
|
127
|
+
throw new Error(`COMPARE_SHARED_MARKUP_DRIFT: ${r.key} in compare markup differs from canonical workspace content`);
|
|
130
128
|
}
|
|
131
129
|
}
|
|
132
130
|
assertNoDuplicateIds(compareHtml, 'rendered compare HTML');
|
|
133
131
|
}
|
|
134
132
|
|
|
135
|
-
export function renderCompareHtml(compareTemplate: string,
|
|
136
|
-
const shared = extractSharedWorkspaceMarkup(
|
|
133
|
+
export function renderCompareHtml(compareTemplate: string, content: string = rigWorkspaceMarkup): string {
|
|
134
|
+
const shared = extractSharedWorkspaceMarkup(content);
|
|
137
135
|
let out = compareTemplate;
|
|
138
136
|
for (const r of REGIONS) {
|
|
139
137
|
if (!out.includes(r.placeholder)) {
|
|
@@ -144,6 +142,6 @@ export function renderCompareHtml(compareTemplate: string, indexHtml: string): s
|
|
|
144
142
|
if (out.includes('<!-- shared:')) {
|
|
145
143
|
throw new Error('COMPARE_SHARED_MARKUP_MISSING: unreplaced shared placeholder in web/compare.html');
|
|
146
144
|
}
|
|
147
|
-
assertSharedCompareMarkup(out,
|
|
145
|
+
assertSharedCompareMarkup(out, content);
|
|
148
146
|
return out;
|
|
149
147
|
}
|
package/src/compare-server.ts
CHANGED
|
@@ -193,7 +193,7 @@ export async function createCompareRequestContext(p: ComparePackage, options: Co
|
|
|
193
193
|
if(url.pathname==='/compare-reference')return await serveReference(req,await safeCompareReference(p),p.response.binding.reference.sha256,headers);
|
|
194
194
|
if(url.pathname.startsWith('/compare-assets/')){const match=/^\/compare-assets\/(a|b)\/(.+)$/.exec(url.pathname);if(!match)return json({error:'Unknown comparison side'},404);const side=match[1] as 'a'|'b',path=packagePath(decodeURIComponent(match[2]!));if(!p[side].files.has(path))return json({error:'Asset not declared by package'},404);return serveAsset(req,await safeFile(p[side].root,path));}
|
|
195
195
|
if(url.pathname==='/main.js')return new Response(req.method==='HEAD'?null:bundle,{headers:{...headers,'Content-Type':'text/javascript'}});
|
|
196
|
-
if(url.pathname==='/'||url.pathname==='/index.html'){const html=renderCompareHtml(await readFile(appRoot+'web/compare.html','utf8')
|
|
196
|
+
if(url.pathname==='/'||url.pathname==='/index.html'){const html=renderCompareHtml(await readFile(appRoot+'web/compare.html','utf8'));return new Response(req.method==='HEAD'?null:html,{headers:{...headers,'Content-Type':'text/html; charset=utf-8'}});}
|
|
197
197
|
if(url.pathname==='/styles.css')return new Response(req.method==='HEAD'?null:await readFile(appRoot+'web/compare.css'),{headers:{...headers,'Content-Type':'text/css'}});
|
|
198
198
|
return json({error:'Not found'},404);
|
|
199
199
|
} finally { live.onRequestEnd(url.pathname); }
|
package/src/compare-session.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {hasStageComment} from './stage-comment.ts';
|
|
1
|
+
import {hasStageComment, parseStageComment} from './stage-comment.ts';
|
|
2
|
+
import {commentsObject, jobSha, parseComments} from './job-api.ts';
|
|
3
|
+
import {REVIEW_COMMENTS_COMPARE_SESSION_SCHEMA, type CompareCommentsSession} from './job-contract.ts';
|
|
2
4
|
import {parseBookmark} from '../web/inspection-persistence.ts';
|
|
3
5
|
import {saveCommentCrops,assertSubmittedComments} from './comment-crops.ts';
|
|
4
6
|
import {sharedTurnDials} from './turn-pad.ts';
|
|
@@ -7,12 +9,48 @@ import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
|
|
|
7
9
|
import { join } from 'node:path';
|
|
8
10
|
import { homedir } from 'node:os';
|
|
9
11
|
import { isDeepStrictEqual } from 'node:util';
|
|
10
|
-
import { choice, object } from './manifest.ts';
|
|
11
|
-
import { parseFeedback, readPackageFeedback, validatePackageFeedback, type FeedbackWarning, type Feedback } from './session.ts';
|
|
12
|
+
import { choice, object, string } from './manifest.ts';
|
|
13
|
+
import { parseFeedback, readPackageFeedback, validatePackageFeedback, parseCommentsReviewedSource, parseCommentsWarnings, type FeedbackWarning, type Feedback } from './session.ts';
|
|
12
14
|
import { assertCompareUnchanged, type CompareBinding, type ComparePackage } from './compare.ts';
|
|
13
15
|
|
|
14
16
|
export interface CompareFeedback extends Feedback {side:'a'|'b'}
|
|
15
17
|
export interface CompareSession {schema:'rig-review-compare-session/1';id:string;revision:'compare/1';sourceHash:string;binding:CompareBinding;status:'pending'|'approved'|'changes-requested';feedback:CompareFeedback[];feedbackWarnings:FeedbackWarning[];updatedAt:string|null}
|
|
18
|
+
|
|
19
|
+
/** Read-only compare/2 decoder; each feedback anchor keeps its explicit side. */
|
|
20
|
+
export function parseCommentsCompareSession(value: unknown): CompareCommentsSession {
|
|
21
|
+
const raw = commentsObject(value, ['schema', 'id', 'revision', 'sourceHash', 'binding', 'status', 'comments', 'feedbackWarnings', 'updatedAt']);
|
|
22
|
+
if (raw.schema !== REVIEW_COMMENTS_COMPARE_SESSION_SCHEMA || raw.revision !== 'compare/1') throw new Error('JOB_ACT_INVALID');
|
|
23
|
+
string(raw.id, 'compare.id'); jobSha(raw.sourceHash);
|
|
24
|
+
choice(raw.status, ['pending', 'approved', 'changes-requested'], 'compare.status');
|
|
25
|
+
const binding = commentsObject(raw.binding, ['a', 'b', 'reference', 'animation']);
|
|
26
|
+
for (const side of ['a', 'b']) {
|
|
27
|
+
const row = commentsObject(binding[side], ['sourceHash', 'reviewedSource']);
|
|
28
|
+
jobSha(row.sourceHash); parseCommentsReviewedSource(row.reviewedSource);
|
|
29
|
+
}
|
|
30
|
+
const reference = commentsObject(binding.reference, ['name', 'sha256']);
|
|
31
|
+
string(reference.name, 'compare.reference.name'); jobSha(reference.sha256); string(binding.animation, 'compare.animation');
|
|
32
|
+
if (createHash('sha256').update(JSON.stringify(binding)).digest('hex') !== raw.sourceHash) throw new Error('JOB_ACT_INVALID');
|
|
33
|
+
const comments = parseComments(raw.comments);
|
|
34
|
+
for (const comment of comments) {
|
|
35
|
+
const anchor = comment.anchor;
|
|
36
|
+
if (!anchor) continue;
|
|
37
|
+
if (!('frameStart' in anchor) || !('side' in anchor)) throw new Error('JOB_ACT_INVALID');
|
|
38
|
+
const context = anchor.context as Record<string, unknown> | undefined;
|
|
39
|
+
if (hasStageComment(context?.comment)) {
|
|
40
|
+
const mark = parseStageComment(context!.comment);
|
|
41
|
+
const a = binding.a as CompareBinding['a'], b = binding.b as CompareBinding['b'];
|
|
42
|
+
parseBookmark(mark.bookmark, {mode: 'compare', sourceHash: raw.sourceHash as string,
|
|
43
|
+
rigs: [a.reviewedSource.rig?.sha256 ?? null, b.reviewedSource.rig?.sha256 ?? null]});
|
|
44
|
+
if (mark.sourceHash !== raw.sourceHash || mark.referenceHash !== reference.sha256 ||
|
|
45
|
+
mark.viewport !== 'reference' && mark.viewport !== anchor.side ||
|
|
46
|
+
mark.modelHash !== (mark.viewport === 'reference' ? null : (anchor.side === 'a' ? a : b).reviewedSource.rig?.sha256 ?? null)) throw new Error('JOB_ACT_INVALID');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
parseCommentsWarnings(raw.feedbackWarnings);
|
|
50
|
+
if (raw.updatedAt !== null &&
|
|
51
|
+
(typeof raw.updatedAt !== 'string' || !Number.isFinite(Date.parse(raw.updatedAt)))) throw new Error('JOB_ACT_INVALID');
|
|
52
|
+
return {...structuredClone(raw), comments} as unknown as CompareCommentsSession;
|
|
53
|
+
}
|
|
16
54
|
export function freshCompareSession(p:ComparePackage):CompareSession {const d=p.response;return {schema:'rig-review-compare-session/1',id:d.id,revision:d.revision,sourceHash:d.sourceHash,binding:d.binding,status:'pending',feedback:[],feedbackWarnings:[],updatedAt:null};}
|
|
17
55
|
export function parseCompareSession(input:unknown,p:ComparePackage,strict=true):CompareSession {
|
|
18
56
|
const value=object(input,'compare session'),fresh=freshCompareSession(p);
|
|
@@ -196,9 +196,21 @@ export function projectSessionCorrection(input: SessionInput) {
|
|
|
196
196
|
return { ...common, kind: 'checked-patch' as const, applied, sessionBytes, patchBytes: patchText(patch), outcome: null };
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
type PartsCorrectionVerdict = PartsVerdict | {
|
|
200
|
+
schema?: string;
|
|
201
|
+
mode: PartsVerdict['mode'];
|
|
202
|
+
tool?: { name: string; version: string };
|
|
203
|
+
source: PartsVerdict['source'];
|
|
204
|
+
status?: string;
|
|
205
|
+
parts?: Record<string, { outcome: string; note: string; flags: string[] }>;
|
|
206
|
+
comments?: import('./parts-comment.ts').PartsComment[];
|
|
207
|
+
issues?: import('./parts-comment.ts').PartsIssue[];
|
|
208
|
+
updatedAt?: string;
|
|
209
|
+
};
|
|
210
|
+
|
|
199
211
|
/** Standalone parts notes and pointed comments keep their original parts identity. */
|
|
200
212
|
export function projectPartsDescription(input: {
|
|
201
|
-
verdict:
|
|
213
|
+
verdict: PartsCorrectionVerdict;
|
|
202
214
|
source: PartsVerdict['source'];
|
|
203
215
|
selector: Extract<Selector, { kind: 'parts' }>;
|
|
204
216
|
selection: { kind: 'comment'; itemId: string } | { kind: 'note'; itemId: string; part: string };
|
|
@@ -210,13 +222,24 @@ export function projectPartsDescription(input: {
|
|
|
210
222
|
}
|
|
211
223
|
const { itemId } = selection;
|
|
212
224
|
if (selection.kind === 'comment') {
|
|
213
|
-
|
|
225
|
+
if ('issues' in verdict && Array.isArray(verdict.issues)) {
|
|
226
|
+
const matches = verdict.issues.filter(issue => issue.id === itemId);
|
|
227
|
+
const item = matches[0];
|
|
228
|
+
if (matches.length !== 1 || !item || item.sourceHash !== source.sha256) {
|
|
229
|
+
return refuse('CORRECTION_ITEM_INVALID', 'expected one source-bound parts comment');
|
|
230
|
+
}
|
|
231
|
+
const primary = item.parts[0]!;
|
|
232
|
+
return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, item.summary), stage: selector.stage, on, source, part: primary.name, imageHash: primary.imageHash, parts: item.parts, comment: item, outcome: null };
|
|
233
|
+
}
|
|
234
|
+
const comments = ('comments' in verdict && Array.isArray(verdict.comments)) ? verdict.comments : [];
|
|
235
|
+
const matches = comments.filter(comment => comment.id === itemId);
|
|
214
236
|
const item = matches[0];
|
|
215
237
|
if (matches.length !== 1 || !item || item.sourceHash !== source.sha256) {
|
|
216
238
|
return refuse('CORRECTION_ITEM_INVALID', 'expected one source-bound parts comment');
|
|
217
239
|
}
|
|
218
240
|
return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, item.summary), stage: selector.stage, on, source, part: item.part, imageHash: item.imageHash, comment: item, outcome: null };
|
|
219
241
|
}
|
|
220
|
-
|
|
221
|
-
|
|
242
|
+
const parts = ('parts' in verdict && verdict.parts) ? verdict.parts : null;
|
|
243
|
+
if (!parts || !Object.hasOwn(parts, selection.part)) return refuse('CORRECTION_ITEM_INVALID', 'expected a saved part note');
|
|
244
|
+
return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, parts[selection.part]!.note), stage: selector.stage, on, source, part: selection.part, outcome: null };
|
|
222
245
|
}
|
|
@@ -5,6 +5,8 @@ export const DIRECTION_MAX_BYTES = 256 * 1024;
|
|
|
5
5
|
type Binding = { path: string; sha256: string };
|
|
6
6
|
export interface DirectionInspection {
|
|
7
7
|
file: Binding;
|
|
8
|
+
model: Binding;
|
|
9
|
+
scene?: Binding & { n: number };
|
|
8
10
|
joined?: {
|
|
9
11
|
postVersion: number;
|
|
10
12
|
projectHash: string;
|
|
@@ -12,6 +14,7 @@ export interface DirectionInspection {
|
|
|
12
14
|
packageRoot: string;
|
|
13
15
|
projectModel: Binding;
|
|
14
16
|
};
|
|
17
|
+
postVersion?: number;
|
|
15
18
|
rigVersion: number;
|
|
16
19
|
camera: { space: 'rig-world-y-up'; keys: { time: number; easing: string; box: { x: number; y: number; width: number; height: number } }[] };
|
|
17
20
|
take: { duration: number; loop: boolean };
|
|
@@ -20,7 +23,7 @@ export interface DirectionInspection {
|
|
|
20
23
|
|
|
21
24
|
/**
|
|
22
25
|
* Read the inspection subset of Create's rig-create/direction@1 or rig-create/direction@2.
|
|
23
|
-
*
|
|
26
|
+
* Scene bytes are inspected separately when the manifest declares them.
|
|
24
27
|
* Create validates scene, project history and citations.
|
|
25
28
|
*/
|
|
26
29
|
export function readDirectionInspection(value: unknown, file: Binding, model: Binding | null): DirectionInspection {
|
|
@@ -73,5 +76,6 @@ export function readDirectionInspection(value: unknown, file: Binding, model: Bi
|
|
|
73
76
|
return { source_time };
|
|
74
77
|
});
|
|
75
78
|
if (timingKeys.at(-1)?.time !== duration) throw new Error('DIRECTION_SCHEMA: timing must end at take duration');
|
|
76
|
-
|
|
79
|
+
const scene = doc.schema === 'rig-create/direction@2' ? object(doc.scene, 'direction.scene') : undefined;
|
|
80
|
+
return { file, model, ...(scene ? { scene: { n: numberField(scene.n, 'direction.scene.n', 1), path: packagePath(scene.path, 'direction.scene.path'), sha256: String(scene.sha256) } } : {}), rigVersion, camera: { space: camera.space, keys: cameraKeys }, take: { duration, loop: take.loop }, timing: timingKeys };
|
|
77
81
|
}
|
package/src/feedback-export.ts
CHANGED
|
@@ -9,6 +9,73 @@ import { environmentSummary, parseEnvironmentContext } from './environment.ts';
|
|
|
9
9
|
import { appliedSummary } from './applied-context.ts';
|
|
10
10
|
import { requirementsSummaryLine } from './requirements.ts';
|
|
11
11
|
import { scheduleContextLine } from './environment-schedule.ts';
|
|
12
|
+
import {parseCommentsSession} from './session.ts';
|
|
13
|
+
import {projectComments} from './stage-comment.ts';
|
|
14
|
+
import type {ReviewCommentsSession, JobCommentFeedbackAnchor, JobCommentPartsAnchor} from './job-contract.ts';
|
|
15
|
+
import type {PartsIssue} from './parts-comment.ts';
|
|
16
|
+
import type {JobComment, JobActValues, ActV3, JobCommentsAct} from './job-contract.ts';
|
|
17
|
+
import type {CompareFeedback} from './compare-session.ts';
|
|
18
|
+
import {parseRecordAct} from './job-api.ts';
|
|
19
|
+
|
|
20
|
+
/** Browser-safe mappers live beside projectComments; this module keeps exporting them. */
|
|
21
|
+
export {feedbackItemComments, checkpointNoteComments} from './stage-comment.ts';
|
|
22
|
+
|
|
23
|
+
/** Per-ask feedback has no ask anchor in act@6. */
|
|
24
|
+
export function feedbackWordsComments(words: string): JobComment[] {
|
|
25
|
+
return [{text: words}];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {partsIssueComments} from './parts-comment.ts';
|
|
29
|
+
|
|
30
|
+
/** A blank note has no comment form: it maps to no comments, never to a padded entry. */
|
|
31
|
+
export function noteComments(words: string): JobComment[] {
|
|
32
|
+
return words.trim() ? feedbackWordsComments(words) : [];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Named-image notes retain sealed image names; no region evidence is manufactured. */
|
|
36
|
+
export function imageNoteComments(notes: readonly {readonly name: string; readonly words: string}[]): JobComment[] {
|
|
37
|
+
return notes.map(({name, words}) => ({text: words, anchor: {name}}));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Display only over decoded legacy sessions: historical fields are general comments. */
|
|
41
|
+
export function legacySessionComments(session: Pick<ReviewSession, 'feedback'> & Partial<Pick<ReviewSession, 'checkpoints'>>): {text: string}[] {
|
|
42
|
+
return legacyFeedbackComments([
|
|
43
|
+
...Object.values(session.checkpoints ?? {}).map(checkpoint => checkpoint.note),
|
|
44
|
+
...session.feedback.map(item => item.summary),
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Reuse the record decoder; survey answers must never become feedback. */
|
|
49
|
+
export function legacyRecordActComments(raw: unknown): {text: string}[] {
|
|
50
|
+
return legacyActComments(parseRecordAct(raw));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Display projection of already-decoded @2–@5 acts, without upgrading their envelopes. */
|
|
54
|
+
export function legacyActComments(act: Exclude<ActV3, JobCommentsAct>): {text: string}[] {
|
|
55
|
+
if (act.kind === 'interview-picks') return [];
|
|
56
|
+
const value = act.value;
|
|
57
|
+
const fields = [value.words];
|
|
58
|
+
if ('imageNotes' in value) fields.push(...(value.imageNotes ?? []).map(note => note.words));
|
|
59
|
+
if ('issues' in value) fields.push(...value.issues.map(issue => issue.summary));
|
|
60
|
+
else if ('parts' in value) fields.push(...value.parts.flatMap(part => [part.part.note, part.mesh.note]));
|
|
61
|
+
return legacyFeedbackComments(fields);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** A display view over explicitly selected legacy feedback fields, including empty strings. */
|
|
65
|
+
export function legacyFeedbackComments(fields: readonly string[]): {text: string}[] {
|
|
66
|
+
if (!Array.isArray(fields) || fields.some(value => typeof value !== 'string')) throw new Error('JOB_ACT_INVALID');
|
|
67
|
+
return fields.map(text => ({text}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Pure adapter arguments. The source session/2 bytes stay in the consumer's receipt. */
|
|
71
|
+
export function projectSelectedCommentsFeedback(session: ReviewCommentsSession, itemId: string): {
|
|
72
|
+
anchor: JobCommentFeedbackAnchor; summary: string;
|
|
73
|
+
} {
|
|
74
|
+
const parsed = parseCommentsSession(session);
|
|
75
|
+
const matches = parsed.comments.filter(comment => comment.anchor && 'frameStart' in comment.anchor && comment.anchor.id === itemId);
|
|
76
|
+
if (matches.length !== 1) throw new Error('JOB_ACT_INVALID');
|
|
77
|
+
return {anchor: matches[0]!.anchor as JobCommentFeedbackAnchor, summary: projectComments(matches)};
|
|
78
|
+
}
|
|
12
79
|
type Category = Feedback['category'];
|
|
13
80
|
type Side = 'single' | 'a' | 'b';
|
|
14
81
|
type ParsedFeedbackSession = FeedbackHistory<ReviewSession | CompareSession>;
|
|
@@ -247,7 +314,7 @@ export function formatFeedbackIssues(input: ParsedFeedbackSession): string {
|
|
|
247
314
|
|
|
248
315
|
/** Selected handoff uses the existing issue export surface with exact JSON-escaped words and evidence. */
|
|
249
316
|
export function formatCorrectionIssue(
|
|
250
|
-
correction: {kind:string;itemId:string;stage:string;on:readonly string[];verbatim:string;source:unknown;createSource?:string;operation?:string;patchBytes?:string;target?:unknown;part?:string;imageHash?:string;comment?:import('./parts-comment.ts').PartsComment},
|
|
317
|
+
correction: {kind:string;itemId:string;stage:string;on:readonly string[];verbatim:string;source:unknown;createSource?:string;operation?:string;patchBytes?:string;target?:unknown;part?:string;imageHash?:string;comment?:import('./parts-comment.ts').PartsComment|import('./parts-comment.ts').PartsIssue},
|
|
251
318
|
context?:Json,
|
|
252
319
|
): string {
|
|
253
320
|
const state=correction.kind==='described'?'Unresolved request':
|