@rig-c/review 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/PANELS.md +3 -1
- package/docs/REVIEW_PACKAGE.md +1 -1
- package/package.json +2 -2
- package/web/animation-inspection.ts +29 -10
- package/web/compare.css +4 -3
- package/web/i18n.ts +46 -2
- package/web/idle-panel.ts +3 -2
- package/web/main.ts +42 -23
- package/web/playback-clock.ts +6 -4
- package/web/readings-panel.ts +2 -1
- package/web/rig-fields-panel.ts +3 -1
- package/web/scrub-box.ts +20 -0
- package/web/stage-comments.ts +3 -1
- package/web/styles.css +4 -3
package/docs/PANELS.md
CHANGED
|
@@ -35,6 +35,8 @@ Animate plays in fixed 1/60 s steps taken from wall-clock time
|
|
|
35
35
|
any display refresh rate; a frame with less than one step's worth of time draws
|
|
36
36
|
nothing new. A repeating clip wraps without a seek, so physics carries across
|
|
37
37
|
the loop seam; only **Reset physics**, a seek or choosing a clip restarts it.
|
|
38
|
+
While paused, physics continues in fixed `PLAYBACK_STEP` (1/60 s) steps,
|
|
39
|
+
independent of display refresh.
|
|
38
40
|
|
|
39
41
|
**Settings** (`#workspace-settings`) stores workspace-level preferences across
|
|
40
42
|
tabs under `rig-review.workspace.v1` (`web/workspace-preferences.ts`):
|
|
@@ -261,7 +263,7 @@ The pinned published `@rig-c/play`1.14.0 supplies `slotIdentity()` and frame gen
|
|
|
261
263
|
|
|
262
264
|
Source-bound links/drafts and explicit feedback preserve that side/slot plus exact attachment/owning skin/set/active skin/null reason. A restored explicit target is checked after restoring its animation/time/set and drawing; `PART_IDENTITY_MISMATCH` rolls back rather than silently substituting another key. Older slot-only links remain readable and resolve from the current authoritative snapshot. Runtime generation is current observation/feedback evidence, never a persistent identity. Named vertex weights and original source alpha remain unavailable in this inspection; packed pages are not original part images.
|
|
263
265
|
|
|
264
|
-
**A drag on the rig view moves the physics.** A plain drag on the rig pane pans the camera and, on the same move, tells the rig's player it was carried, so hair and cloth trail the way they do in the Family viewer (rig-c/examples `family/viewer/index.html`, whose tuning this takes as written): each pointer move of `dx`, `dy` page px at root scale `s` calls `player.moved({x: clamp(dx/s × 0.25, ±8), y: clamp(−dy/s × 0.25, ±6)})`. A press is a click until it travels more than 3 px from where it went down (`CLICK_SLOP_PX` in `web/stage-pick.ts`, the one line both the pick and the drag read); a click selects a part as below and moves nothing, and a press that once passed the line is a drag even if it is released where it started. The first impulse carries the whole travel since the press. A press made with **Space** held pans only, a press an editor handle or comment mode takes is unchanged, and the reference pane pans without an impulse. On the compare page a drag on either build carries both, each by its own root scale, so A and B take the same stimulus. `player.moved` applies on the player's next step, so
|
|
266
|
+
**A drag on the rig view moves the physics.** A plain drag on the rig pane pans the camera and, on the same move, tells the rig's player it was carried, so hair and cloth trail the way they do in the Family viewer (rig-c/examples `family/viewer/index.html`, whose tuning this takes as written): each pointer move of `dx`, `dy` page px at root scale `s` calls `player.moved({x: clamp(dx/s × 0.25, ±8), y: clamp(−dy/s × 0.25, ±6)})`. A press is a click until it travels more than 3 px from where it went down (`CLICK_SLOP_PX` in `web/stage-pick.ts`, the one line both the pick and the drag read); a click selects a part as below and moves nothing, and a press that once passed the line is a drag even if it is released where it started. The first impulse carries the whole travel since the press. A press made with **Space** held pans only, a press an editor handle or comment mode takes is unchanged, and the reference pane pans without an impulse. On the compare page a drag on either build carries both, each by its own root scale, so A and B take the same stimulus. `player.moved` applies on the player's next step, so dragging a paused rig in single-review Animate swings its physics on the continuing held steps. It is inspection only: nothing is recorded in drafts, feedback or exports. The earlier **Drag to trail** toggle, which moved the physics with the camera held, is retired (#331): the default drag covers it and **Jolt** gives an impulse without moving the camera.
|
|
265
267
|
|
|
266
268
|
**Hover preview on the stage.** In **Animate**, where a click on drawn part geometry selects its slot, resting the mouse over the rig view previews that click: the part a click at that point would select gets a solid white outline (dark halo) over a faint light tint, and its slot name sits beside the pointer. It is distinct from the selection's dashed amber box. The preview and the click are one hit test (`web/stage-pick.ts` `pickAt`: the held drawn primitives with their resolved clip, the last drawn on top, only a slot the inspection lists); where a click would select nothing — empty stage, Setup, a button or handle under the pointer, Space held — nothing is shown. It is hidden while a button is pressed (a pan or a drag), while comment mode or an editor handle owns the press, and when the pointer leaves the view. It repaints only when what it would draw changes, so a still pointer over a paused rig paints nothing. Touch and keyboard show no preview, and tap and keyboard selection are unchanged. On the compare page it follows the picked build's own rig. The preview is never recorded: sessions, drafts, feedback and exports are unchanged.
|
|
267
269
|
|
package/docs/REVIEW_PACKAGE.md
CHANGED
|
@@ -589,7 +589,7 @@ Browser players retain play's default DOM mode and default mesh backend. Rigid
|
|
|
589
589
|
parts remain DOM images; a WebGL mesh label does not claim full-frame GL drawing.
|
|
590
590
|
WebGL is requested by the published default, with Canvas2D as the supported mesh
|
|
591
591
|
fallback. Accurate public actual-flush telemetry requires play 1.11.1 or later;
|
|
592
|
-
this checkout consumes pinned 1.
|
|
592
|
+
this checkout consumes pinned 1.23.0. The consumer does not probe GL or inspect
|
|
593
593
|
private renderer state. The separate Node strip exporter remains Canvas2D.
|
|
594
594
|
|
|
595
595
|
The backend badge is sampled only after successful draw/frame calls. Fresh mesh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rig-c/review",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local human rig inspection and structured feedback export",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@napi-rs/canvas": "1.0.11",
|
|
22
|
-
"@rig-c/play": "1.
|
|
22
|
+
"@rig-c/play": "1.23.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/bun": "^1.3.0",
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
type TrackClassification,
|
|
27
27
|
} from '../src/animation-ops.ts';
|
|
28
28
|
import type {AppliedAnimation} from '../src/applied-context.ts';
|
|
29
|
-
import {sourceTextContent} from './i18n.ts';
|
|
29
|
+
import {setSourceText,sourceTextContent} from './i18n.ts';
|
|
30
30
|
import type {AnimationSourceView} from './rebuild-client.ts';
|
|
31
31
|
import {bindStagePick,domHoverPainter,type StagePick} from './stage-pick.ts';
|
|
32
32
|
import {InspectionSelection} from './inspection-selection.ts';
|
|
@@ -129,6 +129,9 @@ export class AnimationInspectionPanel {
|
|
|
129
129
|
private curvePlot:SVGSVGElement;
|
|
130
130
|
private curveSegment=0;
|
|
131
131
|
private readout:HTMLOutputElement;
|
|
132
|
+
/** #356: nodes update() writes every played frame, found once (the curve time input is static template). */
|
|
133
|
+
private curveTimeInput:HTMLInputElement|null=null;
|
|
134
|
+
private playheadNodes:ArrayLike<HTMLElement>|null=null; private readonly playheadTranslate=new WeakMap<HTMLElement,string>();
|
|
132
135
|
private status:HTMLElement;
|
|
133
136
|
private gateBanner:HTMLElement;
|
|
134
137
|
private previewBadge:HTMLElement;
|
|
@@ -1389,7 +1392,7 @@ export class AnimationInspectionPanel {
|
|
|
1389
1392
|
timeIn.type='number';
|
|
1390
1393
|
timeIn.step='any';
|
|
1391
1394
|
timeIn.min='0';
|
|
1392
|
-
timeIn.dataset.insertTime='';
|
|
1395
|
+
timeIn.dataset.insertTime='';timeIn.classList.add('animation-insert-time');
|
|
1393
1396
|
timeIn.disabled=!gate.editable||editableTracks.length===0;
|
|
1394
1397
|
timeIn.value=String(cleanMotionNumber(this.at));
|
|
1395
1398
|
timeLabel.append(timeIn);
|
|
@@ -2504,18 +2507,34 @@ export class AnimationInspectionPanel {
|
|
|
2504
2507
|
}
|
|
2505
2508
|
|
|
2506
2509
|
update(time:number,duration:number){
|
|
2507
|
-
this.at=time;this.runtimeDuration=duration;
|
|
2508
|
-
const
|
|
2510
|
+
this.at=time;this.runtimeDuration=duration;
|
|
2511
|
+
const host=this.options.host,timeInput=this.curveTimeInput??=host.querySelector<HTMLInputElement>('[data-curve-time]')!;
|
|
2512
|
+
const max=String(formatSeconds(duration));if(timeInput.max!==max)timeInput.max=max;if(document.activeElement!==timeInput)timeInput.value=String(formatSeconds(time));
|
|
2513
|
+
const insertTimeInput=typeof host.getElementsByClassName==='function'?host.getElementsByClassName('animation-insert-time')[0] as HTMLInputElement|undefined:host.querySelector<HTMLInputElement>('[data-insert-time]');
|
|
2509
2514
|
if(insertTimeInput&&document.activeElement!==insertTimeInput)insertTimeInput.value=String(cleanMotionNumber(time));
|
|
2510
|
-
this.placePlayheads();const t=this.track,c=t&&CHANNELS[t.name]?.[this.channel];
|
|
2511
|
-
|
|
2515
|
+
this.placePlayheads();const t=this.track,c=t&&CHANNELS[t.name]?.[this.channel];
|
|
2516
|
+
// #356: the readout is written once per update, and only when its text or data changes (it was written twice
|
|
2517
|
+
// per call, unavailable first, and update runs twice per played frame).
|
|
2518
|
+
if(!t||!c||!this.inspection){
|
|
2519
|
+
for(const key of ['time','channelValue','localValue','bone','property'])if(key in this.readout.dataset)delete this.readout.dataset[key];
|
|
2520
|
+
setSourceText(this.readout,`Runtime evaluation unavailable: ${this.unavailableChannel||'select a numeric stored channel'}.`);return;
|
|
2521
|
+
}
|
|
2512
2522
|
const value=evaluateStoredChannel(t,this.channel,time),local=evaluateBoneLocals(this.inspection,t.target,time)[c.local];
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2523
|
+
const data:Record<string,string>={time:String(time),channelValue:value===null?'setup':numeric(value),localValue:numeric(local),bone:t.target,property:c.local};
|
|
2524
|
+
for(const [key,v] of Object.entries(data))if(this.readout.dataset[key]!==v)this.readout.dataset[key]=v;
|
|
2525
|
+
setSourceText(this.readout,`Runtime evaluation · ${formatSeconds(time)} s · ${c.local} track: ${value===null?'before first key (setup)':numeric(value)} · authored local: ${numeric(local)}`);
|
|
2526
|
+
if(this.cursor&&this.plot){const cursor=this.cursor,set=(name:string,v:string)=>{if(cursor.getAttribute(name)!==v)cursor.setAttribute(name,v);};set('visibility',value===null?'hidden':'visible');if(value!==null){const p=this.plot(time,value);set('cx',String(p.x));set('cy',String(p.y));}}
|
|
2516
2527
|
}
|
|
2517
2528
|
|
|
2518
|
-
private placePlayheads(){
|
|
2529
|
+
private placePlayheads(){
|
|
2530
|
+
// #356: a translate in the lane's container units (each playhead parent is an inline-size container), snapped to
|
|
2531
|
+
// the device pixel the way a left offset is: moving it needs no layout, where a left change relaid every lane.
|
|
2532
|
+
const end=this.effectiveEnd(),at=Math.max(0,Math.min(100,this.at/end*100)),step=1/(globalThis.devicePixelRatio||1),host=this.options.host;
|
|
2533
|
+
const translate=`round(${at}cqw,${step}px)`;
|
|
2534
|
+
// #356: a live collection of the playheads (one query for the panel's life) instead of a subtree query per call.
|
|
2535
|
+
const nodes=typeof host.getElementsByClassName==='function'?(this.playheadNodes??=host.getElementsByClassName('animation-playhead') as unknown as ArrayLike<HTMLElement>):host.querySelectorAll<HTMLElement>('[data-playhead]');
|
|
2536
|
+
for(let i=0;i<nodes.length;i++){const n=nodes[i]!;if(this.playheadTranslate.get(n)!==translate){this.playheadTranslate.set(n,translate);n.style.translate=translate;}}
|
|
2537
|
+
}
|
|
2519
2538
|
|
|
2520
2539
|
boneWorldMatrix(boneName:string):{x:number;y:number;a:number;b:number;c:number;d:number}{
|
|
2521
2540
|
const captured=this.bones.get(boneName);
|
package/web/compare.css
CHANGED
|
@@ -221,7 +221,7 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
|
|
|
221
221
|
.animation-ruler{position:sticky;top:0;z-index:6;display:grid;grid-template-columns:190px minmax(340px,1fr);height:20px;min-height:20px;align-items:center;background:var(--rv-bar);border-bottom:1px solid var(--border-strong);user-select:none;-webkit-user-select:none}
|
|
222
222
|
.animation-ruler-corner{position:sticky;left:0;z-index:7;display:flex;align-items:center;height:100%;padding:0 6px;background:var(--rv-bar);border-right:1px solid var(--border)}
|
|
223
223
|
.animation-axis{color:var(--fg-muted);font:10px var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
224
|
-
.animation-ruler-track{position:relative;height:100%;margin:0 8px;cursor:ew-resize;touch-action:none}
|
|
224
|
+
.animation-ruler-track{position:relative;height:100%;margin:0 8px;cursor:ew-resize;touch-action:none;container-type:inline-size}
|
|
225
225
|
.animation-ruler-tick{position:absolute;top:0;bottom:0;transform:translateX(-50%);display:inline-flex;align-items:center;padding-left:3px;border-left:1px solid var(--border-strong);color:var(--fg-muted);font:9px var(--font-mono);white-space:nowrap;pointer-events:none}
|
|
226
226
|
.animation-ruler-tick:first-child{transform:none}
|
|
227
227
|
.animation-ruler-tick:nth-last-child(2){transform:translateX(-100%);border-left:0;border-right:1px solid var(--border-strong);padding-left:0;padding-right:3px}
|
|
@@ -236,12 +236,13 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
|
|
|
236
236
|
.animation-readonly-badge{display:block;font:8.5px/10px var(--font-mono);color:var(--fg-muted);white-space:normal;overflow-wrap:anywhere;text-overflow:clip;max-width:100%;padding:1px 4px;pointer-events:none}
|
|
237
237
|
.animation-readonly-subrow{grid-column:2;margin:0 8px;padding:0 4px;font:8.5px/10px var(--font-mono)}
|
|
238
238
|
.readonly-lane-track .animation-readonly-badge{max-width:100%;padding:1px 4px}
|
|
239
|
-
.animation-key-lane{position:relative;height:22px;margin:0 8px}
|
|
239
|
+
.animation-key-lane{position:relative;height:22px;margin:0 8px;container-type:inline-size}
|
|
240
240
|
.animation-key{position:absolute;top:0;transform:translateX(-50%);padding:0 2px;border:0;background:transparent;color:var(--link);font-size:11px;line-height:22px;height:22px;min-width:10px;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2}
|
|
241
241
|
.animation-key[data-editable=true]{cursor:ew-resize}
|
|
242
242
|
.animation-key.selected{color:var(--warn);font-weight:700;z-index:4;text-shadow:0 0 4px var(--code-bg)}
|
|
243
243
|
.animation-key:hover,.animation-key:focus-visible{color:var(--pass);z-index:3}
|
|
244
|
-
|
|
244
|
+
/* #356: the playhead moves by an inline translate in its lane's container units (cqw), not by left: a left change relaid every lane on each played frame. */
|
|
245
|
+
.animation-playhead{position:absolute;top:0;bottom:0;left:0;width:1px;background:var(--warn);pointer-events:none;z-index:5}
|
|
245
246
|
.animation-selection-box{position:absolute;border:1.5px dashed var(--link);background:transparent;pointer-events:none;z-index:1;box-sizing:border-box}
|
|
246
247
|
.animation-curve-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-size:11px;margin-bottom:4px}
|
|
247
248
|
.animation-curve-toolbar select,.animation-curve-toolbar input{width:auto;padding:2px 6px;font-size:11px}
|
package/web/i18n.ts
CHANGED
|
@@ -325,6 +325,10 @@ function buildPatterns(fromCatalog: Readonly<Record<string, string>>, toCatalog:
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
function getPatterns(lang: ResolvedLanguage): readonly CompiledPattern[] {
|
|
328
|
+
// #356: return the compiled list before expanding the catalogs (that expansion walked every entry on each
|
|
329
|
+
// uncached translation, and a string that changes every played frame is always uncached).
|
|
330
|
+
const cached = lang === 'ko' ? enToKoPatterns : koToEnPatterns;
|
|
331
|
+
if (cached) return cached;
|
|
328
332
|
const { enToKo } = ensureMaps();
|
|
329
333
|
const expandedEn: Record<string, string> = {};
|
|
330
334
|
const expandedKo: Record<string, string> = {};
|
|
@@ -753,11 +757,42 @@ export function sourceTextContent(node: Node | null | undefined): string {
|
|
|
753
757
|
* a translated UI and a played frame would rewrite (and re-translate) unchanged text.
|
|
754
758
|
*/
|
|
755
759
|
export function setSourceText(node: Element, value: string): boolean {
|
|
756
|
-
|
|
757
|
-
node
|
|
760
|
+
const count = node.childNodes?.length ?? 0;
|
|
761
|
+
if (count <= 1 && sourceTextContent(node) === value) return false;
|
|
762
|
+
// #356: a lone text child keeps its node (a characterData change, not a childList swap that wakes every
|
|
763
|
+
// subtree observer), and the text is translated here, so the DOM observer has nothing left to do.
|
|
764
|
+
const only = count === 1 ? node.childNodes[0] : null;
|
|
765
|
+
if (only && only.nodeType === 3) only.nodeValue = value;
|
|
766
|
+
else node.textContent = value;
|
|
767
|
+
const written = node.childNodes?.[0];
|
|
768
|
+
if (written && written.nodeType === 3) translateNow(() => applyTextNodeI18n(written, currentLanguage));
|
|
758
769
|
return true;
|
|
759
770
|
}
|
|
760
771
|
|
|
772
|
+
/** #356: apply the observer's own translation at the write, so the frame's mutation records arrive already settled. */
|
|
773
|
+
function translateNow(apply: () => void): void {
|
|
774
|
+
if (!domObserver || isApplyingDom) return;
|
|
775
|
+
isApplyingDom = true;
|
|
776
|
+
try {
|
|
777
|
+
apply();
|
|
778
|
+
} finally {
|
|
779
|
+
isApplyingDom = false;
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
/** #356: a record whose node already shows what the observer would write (it was translated at the write). */
|
|
784
|
+
function settledRecord(m: MutationRecord): boolean {
|
|
785
|
+
if (m.type === 'characterData') {
|
|
786
|
+
const entry = textNodeSource.get(m.target);
|
|
787
|
+
return !!entry && m.target.nodeValue === entry.lastApplied;
|
|
788
|
+
}
|
|
789
|
+
if (m.type === 'attributes' && m.attributeName && m.target.nodeType === 1) {
|
|
790
|
+
const entry = elementAttrSource.get(m.target as Element)?.get(m.attributeName);
|
|
791
|
+
return !!entry && (m.target as Element).getAttribute(m.attributeName) === entry.lastApplied;
|
|
792
|
+
}
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
|
|
761
796
|
/** #347: an attribute's English source: what the caller last wrote, before the DOM observer translated it. */
|
|
762
797
|
export function sourceAttribute(el: Element, attr: string): string | null {
|
|
763
798
|
const current = typeof el.getAttribute === 'function' ? el.getAttribute(attr) : null;
|
|
@@ -769,6 +804,7 @@ export function sourceAttribute(el: Element, attr: string): string | null {
|
|
|
769
804
|
export function setSourceAttribute(el: Element, attr: string, value: string): boolean {
|
|
770
805
|
if (sourceAttribute(el, attr) === value) return false;
|
|
771
806
|
el.setAttribute(attr, value);
|
|
807
|
+
translateNow(() => applyElementI18n(el, currentLanguage));
|
|
772
808
|
return true;
|
|
773
809
|
}
|
|
774
810
|
|
|
@@ -811,6 +847,13 @@ export function applyDomI18n(root: Document | Element = boundRoot ?? document):
|
|
|
811
847
|
}
|
|
812
848
|
}
|
|
813
849
|
|
|
850
|
+
/** Stop following DOM writes (the counterpart of `bindDomI18n`). */
|
|
851
|
+
export function unbindDomI18n(): void {
|
|
852
|
+
domObserver?.disconnect();
|
|
853
|
+
domObserver = null;
|
|
854
|
+
boundRoot = null;
|
|
855
|
+
}
|
|
856
|
+
|
|
814
857
|
export function bindDomI18n(root?: Document | Element | null): void {
|
|
815
858
|
const target = root === undefined ? (typeof document !== 'undefined' ? document : null) : root;
|
|
816
859
|
if (!target) return;
|
|
@@ -835,6 +878,7 @@ export function bindDomI18n(root?: Document | Element | null): void {
|
|
|
835
878
|
try {
|
|
836
879
|
const lang = currentLanguage;
|
|
837
880
|
for (const m of mutations) {
|
|
881
|
+
if (settledRecord(m)) continue;
|
|
838
882
|
if (m.type === 'characterData') {
|
|
839
883
|
applyTextNodeI18n(m.target, lang);
|
|
840
884
|
} else if (m.type === 'attributes' && m.target.nodeType === 1) {
|
package/web/idle-panel.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* pending ops (`#idle-pending`) and the panel's own inputs carry no ids.
|
|
9
9
|
*/
|
|
10
10
|
import {AMP_RANGE,addTrack,entryChanged,idleDraftState,idleDraftText,idleOps,initialState,isChain,orderedEntries,periodFits,periodOffers,precheck,previewPlan,removeTrack,setBlink,stateFromOps,setField,setLinkAmp,SINGLE_PROPS,type BlinkField,type ChainField,type IdleKeying,type IdleSource,type IdleState,type IdleStatus,type PreviewPlan,type SingleField} from '../src/idle-tracks.ts';
|
|
11
|
+
import {scrubBox} from './scrub-box.ts';
|
|
11
12
|
import type {PatchOp} from '../src/config-patch.ts';
|
|
12
13
|
import type {BoneAdjust} from '@rig-c/play';
|
|
13
14
|
import {idlePreviewAdjust,type BoneSetup} from './preview.ts';
|
|
@@ -224,11 +225,11 @@ export function bindIdlePanel(deps:IdlePanelDeps):IdlePanel {
|
|
|
224
225
|
function placeMarker(duration:number,force=false){
|
|
225
226
|
lastDuration=duration;
|
|
226
227
|
const b=state?.blink,visible=!!b&&duration>0&&!!source&&Math.abs(duration-source.duration)<1e-6;
|
|
227
|
-
const key=`${visible}|${b?.t}|${duration}|${
|
|
228
|
+
const box=scrubBox(scrub),key=`${visible}|${b?.t}|${duration}|${box.left},${box.top},${box.width}|${busy}`;
|
|
228
229
|
if(!force&&key===markerKey)return;markerKey=key;
|
|
229
230
|
strip.hidden=!visible;transport.classList.toggle('has-idle-blink',visible);
|
|
230
231
|
if(!visible)return;
|
|
231
|
-
strip.style.left=`${
|
|
232
|
+
strip.style.left=`${box.left+THUMB/2}px`;strip.style.width=`${Math.max(0,box.width-THUMB)}px`;strip.style.top=`${box.top-12}px`;
|
|
232
233
|
marker.style.left=`${(b!.t/duration)*100}%`;marker.disabled=busy;
|
|
233
234
|
const text=`blink t ${shown(b!.t)} s${b!.t!==source!.blink!.t?` (was ${shown(source!.blink!.t)})`:''} · drag to move`;marker.title=text;marker.setAttribute('aria-label',text);marker.classList.toggle('pending',b!.t!==source!.blink!.t);
|
|
234
235
|
}
|
package/web/main.ts
CHANGED
|
@@ -31,7 +31,8 @@ import {historyRow,isPatchJob,recordFor,refusedText,restoredOutcomeForJob,retarg
|
|
|
31
31
|
import {meshEditBinding,meshEditText,type MeshEditDocument} from '../src/mesh-edit.ts';
|
|
32
32
|
import {chestRegionsBinding,cropWorldMapping,type CropWorldMapping} from '../src/chest-regions.ts';
|
|
33
33
|
import {bindWorkspaceUI,selectedInspector,type WorkspaceUI} from './workspace-ui.ts';
|
|
34
|
-
import {setSourceText,
|
|
34
|
+
import {setSourceAttribute,setSourceText,sourceTextContent,tr} from './i18n.ts';
|
|
35
|
+
import {holdScrubBox,releaseScrubBox,scrubBox} from './scrub-box.ts';
|
|
35
36
|
import {bindInspectorBlocks,activeBlocksUI,restoreActiveBlocksUI,type InspectorBlocks} from './inspector-blocks.ts';
|
|
36
37
|
import {connectControl} from './control.ts';
|
|
37
38
|
import {connectLiveWindow} from './live-connection.ts';
|
|
@@ -82,7 +83,7 @@ const select = (id: string) => el<HTMLSelectElement>(id);
|
|
|
82
83
|
const button = (id: string) => el<HTMLButtonElement>(id);
|
|
83
84
|
const titledIds = new Set(['message', 'player-state', 'layout-state', 'renderer-state', 'layer-state', 'idle-state', 'control-state', 'draft-state', 'rig-label', 'reference-label', 'coordinates']);
|
|
84
85
|
// #347: write only a changed source, so a played frame does not rewrite (and re-translate) unchanged text.
|
|
85
|
-
const text = (id: string, value: string) => { const node = el(id); setSourceText(node, value); if (titledIds.has(id)
|
|
86
|
+
const text = (id: string, value: string) => { const node = el(id); setSourceText(node, value); if (titledIds.has(id)) setSourceAttribute(node, 'title', value); };
|
|
86
87
|
const option = (value: string, label: string) => { const item = document.createElement('option'); item.value = value; item.textContent = label; return item; };
|
|
87
88
|
const errorText = (error: unknown) => error instanceof Error ? error.message : String(error);
|
|
88
89
|
// First, before any URL use: take the `#cap=` handoff into memory/session storage and strip it.
|
|
@@ -100,6 +101,7 @@ let assets: ModelAssets | null = null;
|
|
|
100
101
|
let player: RigPlayer | null = null;
|
|
101
102
|
let animation = '';
|
|
102
103
|
let playing = false;
|
|
104
|
+
let heldPhysicsFailed = false;
|
|
103
105
|
let time = 0;
|
|
104
106
|
/** The clock a scratch build on the stage states for its own animation (a retarget's report frameTimes, #164). */
|
|
105
107
|
let stageClock: StageClock | null = null;
|
|
@@ -437,7 +439,7 @@ function renderTransport(): void {
|
|
|
437
439
|
/** Re-lay the reading ticks only when what places them changes (renderTransport runs every played frame). */
|
|
438
440
|
function renderReadingTicks(force = false): void {
|
|
439
441
|
if (!readingsPanel) return;
|
|
440
|
-
const
|
|
442
|
+
const box = scrubBox(input('scrub')), key = `${readingsJob?.id ?? ''}|${readingsJob?.runs.map(r => r.results.length).join(',')}|${animation}|${duration}|${box.left},${box.top},${box.width}`;
|
|
441
443
|
if (!force && key === readingsTickKey) return;
|
|
442
444
|
readingsTickKey = key; readingsPanel.ticks(readingsJob, animation, duration);
|
|
443
445
|
}
|
|
@@ -523,7 +525,7 @@ function seek(value: number, move?: ClipMove): void {
|
|
|
523
525
|
}
|
|
524
526
|
|
|
525
527
|
function stopAudio(): void { for (const audio of audioPlaying) audio.pause(); audioPlaying.clear(); }
|
|
526
|
-
function pause(): void { ++playbackIntent;desiredPlay=false;suspendedPreview=false;idleHeld=true; playing = false; lastFrame = 0; playbackCarry = 0; player?.
|
|
528
|
+
function pause(): void { ++playbackIntent;desiredPlay=false;suspendedPreview=false;idleHeld=true; heldPhysicsFailed=false; playing = false; lastFrame = 0; playbackCarry = 0; player?.hold(true); player?.resume(); video?.pause(); stopAudio(); button('play').textContent = '▶'; button('play').setAttribute('aria-label', 'Play'); }
|
|
527
529
|
|
|
528
530
|
async function audition(clipId: string): Promise<void> {
|
|
529
531
|
const clip = data.manifest.audio.clips.find(item => item.id === clipId); if (!clip) return;
|
|
@@ -648,22 +650,39 @@ function seekReading(clip: string, frame: number, exact: number | null, label: s
|
|
|
648
650
|
}
|
|
649
651
|
|
|
650
652
|
function tick(now: number): void {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
const previous = time, next = advancePlayback({ time, duration, carry: playbackCarry, elapsed: dt, repeat: canRepeatIdle() && !idleHeld });
|
|
655
|
-
playbackCarry = next.carry; time = next.time;
|
|
656
|
-
const stepped = next.steps.reduce((sum, step) => sum + step, 0);
|
|
657
|
-
// The wrap does what the replaced seek(0) did besides the player: restart the wind clock and re-hold the reference at the wrapped time.
|
|
658
|
-
if (next.wrapped) { stopAudio(); clipMoved({ kind: 'replay' }); if (video) { if (video.readyState >= 1) holdVideoReference(video, referenceGeneration); void video.play().catch(error => { pause(); message(errorText(error), true); }); } }
|
|
659
|
-
if (player && player.current && next.steps.length) { try { stepEnvironment(stepped); drawRig(()=>{ for (const step of next.steps) player!.advance(step); player!.draw(); }); } catch (error) { pause(); message(errorText(error), true); } }
|
|
660
|
-
if (video && video.readyState >= 1 && time > video.duration) { if (referenceInput.state !== 'out-of-domain') holdVideoReference(video, referenceGeneration); } else if (video && referenceInput.state === 'loaded' && Math.abs(video.currentTime - time) > .15) video.currentTime = time;
|
|
661
|
-
if (input('sync-audio').checked) for (const cue of activeCues()) if (cueDue(cue.time, previous, next, duration)) void audition(cue.clip);
|
|
662
|
-
renderSequenceFrame(); renderTransport(); if (next.ended) pause(); lastFrame = now;
|
|
663
|
-
}
|
|
653
|
+
// #356: the scrub box is read before this frame writes anything (a read after the writes forces a layout).
|
|
654
|
+
if (playing) try { holdScrubBox(input('scrub')); tickPlaying(now); } finally { releaseScrubBox(); }
|
|
655
|
+
else tickHeldPhysics(now);
|
|
664
656
|
requestAnimationFrame(tick);
|
|
665
657
|
}
|
|
666
658
|
|
|
659
|
+
/** Animate steps held physics under the standing environment; wind time and queued jolts stay frozen. */
|
|
660
|
+
function tickHeldPhysics(now:number):void {
|
|
661
|
+
const elapsed=lastFrame?Math.min((now-lastFrame)/1000,.1):0;lastFrame=now;
|
|
662
|
+
if(heldPhysicsFailed||!player?.current||document.hidden||selectedInspector(document)!=='playback'||seekingControl){playbackCarry=0;return;}
|
|
663
|
+
const next=advancePlayback({time,duration,carry:playbackCarry,elapsed,repeat:false,held:true});
|
|
664
|
+
playbackCarry=next.carry;
|
|
665
|
+
if(!next.steps.length)return;
|
|
666
|
+
try{
|
|
667
|
+
player.hold(true);player.resume();
|
|
668
|
+
drawRig(()=>{for(const step of next.steps)player!.advance(step);player!.draw();});
|
|
669
|
+
}catch(error){heldPhysicsFailed=true;player.pause();playbackCarry=0;message(errorText(error),true);}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function tickPlaying(now: number): void {
|
|
673
|
+
const dt = lastFrame ? Math.min((now - lastFrame) / 1000, .1) : 0;
|
|
674
|
+
// #346: fixed PLAYBACK_STEP steps from wall-clock time; a repeating clip wraps here with no seek, so physics carries across the loop.
|
|
675
|
+
const previous = time, next = advancePlayback({ time, duration, carry: playbackCarry, elapsed: dt, repeat: canRepeatIdle() && !idleHeld });
|
|
676
|
+
playbackCarry = next.carry; time = next.time;
|
|
677
|
+
const stepped = next.steps.reduce((sum, step) => sum + step, 0);
|
|
678
|
+
// The wrap does what the replaced seek(0) did besides the player: restart the wind clock and re-hold the reference at the wrapped time.
|
|
679
|
+
if (next.wrapped) { stopAudio(); clipMoved({ kind: 'replay' }); if (video) { if (video.readyState >= 1) holdVideoReference(video, referenceGeneration); void video.play().catch(error => { pause(); message(errorText(error), true); }); } }
|
|
680
|
+
if (player && player.current && next.steps.length) { try { stepEnvironment(stepped); drawRig(()=>{ for (const step of next.steps) player!.advance(step); player!.draw(); }); } catch (error) { pause(); message(errorText(error), true); } }
|
|
681
|
+
if (video && video.readyState >= 1 && time > video.duration) { if (referenceInput.state !== 'out-of-domain') holdVideoReference(video, referenceGeneration); } else if (video && referenceInput.state === 'loaded' && Math.abs(video.currentTime - time) > .15) video.currentTime = time;
|
|
682
|
+
if (input('sync-audio').checked) for (const cue of activeCues()) if (cueDue(cue.time, previous, next, duration)) void audition(cue.clip);
|
|
683
|
+
renderSequenceFrame(); renderTransport(); if (next.ended) pause(); lastFrame = now;
|
|
684
|
+
}
|
|
685
|
+
|
|
667
686
|
function configureTurnPad(model:unknown):void {
|
|
668
687
|
const previous=turnPad?.snapshot();turnPad?.dispose();turnPad=null;turnAdjust=null;document.getElementById('turn-pad-host')?.remove();
|
|
669
688
|
const dials=discoverTurnDials(model,assets?.animations);if(!dials.length){setAdjust();workspace?.refresh();return;}
|
|
@@ -1054,7 +1073,7 @@ async function playPreview():Promise<void> {
|
|
|
1054
1073
|
if((!player&&!video&&!sequence)||duration<=0)return;
|
|
1055
1074
|
const intent=++playbackIntent;desiredPlay=true;idleHeld=false;syncPlayerLoop();if(time>=duration)seek(0,{kind:'replay'});
|
|
1056
1075
|
if(video&&referenceInput.state==='loaded'){try{await video.play();}catch(error){pause();message(`Playback is paused: ${errorText(error)}. Use Play to retry.`,true);return;}}
|
|
1057
|
-
if(intent!==playbackIntent||!desiredPlay){if(!desiredPlay)video?.pause();return;}playing=true;lastFrame=0;player?.resume();button('play').textContent='Ⅱ';button('play').setAttribute('aria-label','Pause');
|
|
1076
|
+
if(intent!==playbackIntent||!desiredPlay){if(!desiredPlay)video?.pause();return;}playing=true;lastFrame=0;player?.hold(false);player?.resume();button('play').textContent='Ⅱ';button('play').setAttribute('aria-label','Pause');
|
|
1058
1077
|
}
|
|
1059
1078
|
function localDraft():boolean{return !!comments?.draft()||dirty||!!input('feedback-summary').value.trim()||!!input('feedback-start').value.trim()||!!input('feedback-end').value.trim()||!!select('feedback-category').value||!!input('feedback-target-name').value.trim()&&input('feedback-target-name').value!==data.manifest.id;}
|
|
1060
1079
|
function controlState():ControlInspection {
|
|
@@ -1273,7 +1292,7 @@ function renderEnvironment():void {
|
|
|
1273
1292
|
if(!player)return;
|
|
1274
1293
|
const reading=wind.read();
|
|
1275
1294
|
text('wind-readout',(environmentApplied()?windReadout(reading,gravityValue()):RUNTIME_START_READOUT)+environmentNote);
|
|
1276
|
-
const gust=button('wind-gust');gust.disabled=reading.gusting;gust.setAttribute('aria-pressed',String(reading.gusting));gust
|
|
1295
|
+
const gust=button('wind-gust');gust.disabled=reading.gusting;if(gust.getAttribute('aria-pressed')!==String(reading.gusting))gust.setAttribute('aria-pressed',String(reading.gusting));setSourceText(gust,reading.gusting?'Gusting…':'Gust');
|
|
1277
1296
|
text('wind-base-label',input('wind-base').value);text('gravity-label',gravityValue().toFixed(2));
|
|
1278
1297
|
renderSchedule();
|
|
1279
1298
|
}
|
|
@@ -1738,8 +1757,8 @@ async function applyPatch(patch:ConfigPatch,world:StageWorld|null=null):Promise<
|
|
|
1738
1757
|
replay:(t:number,dt:number,steps:readonly {t:number;wind?:[number,number];gravity?:[number,number]}[]=[])=>{
|
|
1739
1758
|
if(!player?.current||!(dt>0)||!(t>=0))return null;
|
|
1740
1759
|
const at=(k:number)=>{for(const step of steps)if(Math.max(0,Math.ceil(step.t/dt-1e-9))===k)player!.environment({...(step.wind?{wind:step.wind}:{}),...(step.gravity?{gravity:step.gravity}:{})});};
|
|
1741
|
-
pause();if(steps.length)player.environment(null);at(0);player.seek(0);player.resume();
|
|
1742
|
-
try{for(let k=1,n=Math.round(t/dt);k<=n;k++){at(k);player.frame(dt);}}finally{player.pause();}
|
|
1760
|
+
pause();if(steps.length)player.environment(null);at(0);player.seek(0);player.hold(false);player.resume();
|
|
1761
|
+
try{for(let k=1,n=Math.round(t/dt);k<=n;k++){at(k);player.frame(dt);}}finally{player.hold(true);player.pause();}
|
|
1743
1762
|
drawRig(()=>player!.draw());time=player.time;renderTransport();
|
|
1744
1763
|
const posedTime=player.time;if(steps.length){if(environmentApplied())player.environment(environmentFor(wind.read(),gravityValue()));else player.environment(null);}
|
|
1745
1764
|
return posedTime;},
|
|
@@ -2134,8 +2153,8 @@ function sampleLocals(bone:string,dt:number,n:number):{t:number;rotation:number;
|
|
|
2134
2153
|
let recording=false;
|
|
2135
2154
|
const read:BoneAdjust=(bones,ctx)=>{inner?.(bones,ctx);if(!recording)return;const l=bones.bone(bone);rows.set(ctx.trackTime??0,{t:ctx.trackTime??0,rotation:l.rotation,x:l.x,y:l.y,scaleX:l.scaleX,scaleY:l.scaleY,shearX:l.shearX,shearY:l.shearY});};
|
|
2136
2155
|
pause();p.adjust=read;
|
|
2137
|
-
try{p.seek(0);recording=true;p.repose();p.resume();for(let k=1;k<=n;k++)p.frame(dt);}
|
|
2138
|
-
finally{recording=false;p.pause();p.adjust=inner;drawRig(()=>p.draw());time=p.time;renderTransport();}
|
|
2156
|
+
try{p.seek(0);recording=true;p.repose();p.hold(false);p.resume();for(let k=1;k<=n;k++)p.frame(dt);}
|
|
2157
|
+
finally{recording=false;p.hold(true);p.pause();p.adjust=inner;drawRig(()=>p.draw());time=p.time;renderTransport();}
|
|
2139
2158
|
return [...rows.values()].sort((a,b)=>a.t-b.t);
|
|
2140
2159
|
}
|
|
2141
2160
|
async function resetRebuild(world:StageWorld|null=null):Promise<void> {
|
package/web/playback-clock.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface PlaybackInput {
|
|
|
17
17
|
/** Wall-clock seconds since the previous frame. */
|
|
18
18
|
elapsed: number;
|
|
19
19
|
repeat: boolean;
|
|
20
|
+
/** Keep the clip time fixed while supplying wall-clock physics steps. */
|
|
21
|
+
held?: boolean;
|
|
20
22
|
step?: number;
|
|
21
23
|
}
|
|
22
24
|
export interface PlaybackAdvance {
|
|
@@ -33,16 +35,16 @@ export interface PlaybackAdvance {
|
|
|
33
35
|
export function advancePlayback(input: PlaybackInput): PlaybackAdvance {
|
|
34
36
|
const step = input.step ?? PLAYBACK_STEP, duration = input.duration, steps: number[] = [];
|
|
35
37
|
let time = input.time, carry = input.carry + Math.max(0, input.elapsed), wrapped = false, ended = false;
|
|
36
|
-
if (!(duration > 0)) return { steps, time, carry: 0, wrapped, ended };
|
|
38
|
+
if (!input.held && !(duration > 0)) return { steps, time, carry: 0, wrapped, ended };
|
|
37
39
|
while (carry >= step - STEP_SLACK) {
|
|
38
|
-
if (!input.repeat && time + step >= duration) {
|
|
40
|
+
if (!input.held && !input.repeat && time + step >= duration) {
|
|
39
41
|
const last = duration - time;
|
|
40
42
|
if (last > 0) steps.push(last);
|
|
41
43
|
time = duration; carry = 0; ended = true;
|
|
42
44
|
break;
|
|
43
45
|
}
|
|
44
|
-
steps.push(step); carry = Math.max(0, carry - step); time += step;
|
|
45
|
-
if (input.repeat) while (time >= duration) { time -= duration; wrapped = true; }
|
|
46
|
+
steps.push(step); carry = Math.max(0, carry - step); if (!input.held) time += step;
|
|
47
|
+
if (!input.held && input.repeat) while (time >= duration) { time -= duration; wrapped = true; }
|
|
46
48
|
}
|
|
47
49
|
return { steps, time, carry, wrapped, ended };
|
|
48
50
|
}
|
package/web/readings-panel.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* tick a button that seeks to its frame's time. The server runs `rigc render`; this draws what came back.
|
|
6
6
|
*/
|
|
7
7
|
import {readingTicks,ticksOnClip,TICK_EDGE,worstLine,type ReadingBuild,type ReadingRequest,type ReadingResult,type ReadingTick} from '../src/readings.ts';
|
|
8
|
+
import {scrubBox} from './scrub-box.ts';
|
|
8
9
|
|
|
9
10
|
export interface ReadingsJobView {id:string;status:'running'|'done'|'failed';error:string|null;request:{animation:string;readings:ReadingRequest[];environment:import('../src/readings.ts').ReadingsRequest['environment']};environment:{requested:boolean;flag:boolean;passed:boolean};compiler:{package:string;version:string};runs:{build:ReadingBuild;id:string;modelHash:string;results:ReadingResult[]}[]}
|
|
10
11
|
export interface ReadingsRefusal {status:'refused';error:string}
|
|
@@ -80,7 +81,7 @@ export function bindReadingsPanel(deps:ReadingsPanelDeps):ReadingsPanel {
|
|
|
80
81
|
strip.hidden=!visible.length;transport.classList.toggle('has-reading-ticks',!!visible.length);
|
|
81
82
|
if(!visible.length)return visible;
|
|
82
83
|
// Under the scrub's track: its own box inside the transport row.
|
|
83
|
-
strip.style.left=`${
|
|
84
|
+
const box=scrubBox(scrub);strip.style.left=`${box.left+THUMB/2}px`;strip.style.width=`${Math.max(0,box.width-THUMB)}px`;strip.style.top=`${box.top+box.height}px`;
|
|
84
85
|
// One button per (build, frame): the labels of every reading that lists the frame, so overlapping ticks stay one target.
|
|
85
86
|
const byFrame=new Map<string,ReadingTick[]>();for(const t of visible){const key=`${t.build}:${t.frame}`;byFrame.set(key,[...(byFrame.get(key)??[]),t]);}
|
|
86
87
|
for(const group of byFrame.values()){
|
package/web/rig-fields-panel.ts
CHANGED
|
@@ -253,7 +253,9 @@ export function bindRigFieldsPanel(deps:RigFieldsDeps):RigFieldsPanel {
|
|
|
253
253
|
const out=turnArea.querySelector('output');if(out)out.textContent=`${dial} px`;const r=turnArea.querySelector<HTMLInputElement>('input[aria-label="turn dial (rig px)"]');if(r&&Number(r.value)!==dial)r.value=String(dial);
|
|
254
254
|
},
|
|
255
255
|
dialState:()=>({x:dial,on:!dialLabel.hidden,label:dialLabel.textContent??''}),
|
|
256
|
-
|
|
256
|
+
// #356: the comment layer asks for these on every played frame; the stage rect (a forced layout after that frame's
|
|
257
|
+
// writes) is read only when there is a handle to place.
|
|
258
|
+
handles(){if(stage.hidden)return [];const list=[...stage.querySelectorAll<HTMLElement>('.rig-fields-handle')];if(!list.length)return [];const rect=stage.getBoundingClientRect();return list.map(h=>({kind:h.dataset.kind!,x:rect.left+parseFloat(h.style.left),y:rect.top+parseFloat(h.style.top)}));},
|
|
257
259
|
revert(path){const next=new Map(edits);next.delete(path);change(()=>next);},
|
|
258
260
|
applied(list){appliedOps=(list??[]).map(o=>JSON.stringify({path:o.path,value:o.value??null}));renderPending();},
|
|
259
261
|
status:panelStatus,
|
package/web/scrub-box.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #356: the scrub's box inside the transport row, for the readers that lay things under it (reading ticks, the
|
|
3
|
+
* idle blink strip). A played frame writes text before those readers run, so reading the box there forces a
|
|
4
|
+
* layout mid-frame. The frame instead reads it once before it writes anything, and its readers use that box.
|
|
5
|
+
*/
|
|
6
|
+
export interface ScrubBox { left: number; top: number; width: number; height: number }
|
|
7
|
+
|
|
8
|
+
type Measurable = Pick<HTMLElement, 'offsetLeft' | 'offsetTop' | 'offsetWidth' | 'offsetHeight'>;
|
|
9
|
+
|
|
10
|
+
let held: { scrub: Measurable; box: ScrubBox } | null = null;
|
|
11
|
+
|
|
12
|
+
const read = (scrub: Measurable): ScrubBox => ({ left: scrub.offsetLeft, top: scrub.offsetTop, width: scrub.offsetWidth, height: scrub.offsetHeight });
|
|
13
|
+
|
|
14
|
+
/** Read the box now (before the frame's writes) and hand it to every reader until `releaseScrubBox`. */
|
|
15
|
+
export function holdScrubBox(scrub: Measurable): void { held = { scrub, box: read(scrub) }; }
|
|
16
|
+
|
|
17
|
+
export function releaseScrubBox(): void { held = null; }
|
|
18
|
+
|
|
19
|
+
/** The held box for this scrub inside a frame; a live read anywhere else (seek, resize, load). */
|
|
20
|
+
export function scrubBox(scrub: Measurable): ScrubBox { return held && held.scrub === scrub ? held.box : read(scrub); }
|
package/web/stage-comments.ts
CHANGED
|
@@ -151,7 +151,9 @@ export function bindStageComments(host:Host):{refresh:()=>void;dispose:()=>void;
|
|
|
151
151
|
window.addEventListener('blur',cancel);window.addEventListener('resize',placeList);document.addEventListener('keydown',key);toggle.onclick=()=>setOpen(list.hidden);
|
|
152
152
|
const ro=typeof ResizeObserver==='function'?new ResizeObserver(()=>{if(!disposed&&!list.hidden)placeList();}):null;if(ro){try{ro.observe(host.toolbar);if(workspace)ro.observe(workspace);}catch{}}
|
|
153
153
|
const renderPins=()=>{if(disposed)return;if(!list.hidden)placeList();const refusal=updateRefusal();if(refusal&&(enabled||pending||composer&&!composerReadOnly)){cancel();setCapture(false);host.error(refusal);}const all=host.feedback().map(f=>({f,mark:markOf(f)})).filter(x=>x.mark);
|
|
154
|
-
|
|
154
|
+
// #356: a pose reads the pane's size (a forced layout after the played frame's writes); with no mark, draft or pending
|
|
155
|
+
// capture there is nothing to place, so this per-frame loop skips it.
|
|
156
|
+
const poses=new Map(all.length||draftMark||pending?[...layers.keys()].map(view=>[view,host.pose(view)]):[]);
|
|
155
157
|
if(draftMark&&poses.get(draftMark.view)?.mode!==draftMark.mode||pending&&poses.get(pending.view)?.mode!==pending.mode)cancel();
|
|
156
158
|
const signature=JSON.stringify([curLang(),refusal,all.map(({f,mark})=>[f.id,f.summary,mark!.mode,mark!.world]),[...poses].map(([view,p])=>[view,p?.mode,p?.animation,p?.frame,p?.timeBasis,p?.time,p?.turn,p?.camera,p?.referenceId,p?.referenceHash]),draftMark]);
|
|
157
159
|
if(signature!==last){last=signature;for(const layer of layers.values())layer.replaceChildren();for(const [i,{f,mark:m}]of all.entries()){
|
package/web/styles.css
CHANGED
|
@@ -332,7 +332,7 @@ footer.status-bar{flex-wrap:nowrap}
|
|
|
332
332
|
.animation-ruler{position:sticky;top:0;z-index:6;display:grid;grid-template-columns:190px minmax(340px,1fr);height:20px;min-height:20px;align-items:center;background:var(--rv-bar);border-bottom:1px solid var(--border-strong);user-select:none;-webkit-user-select:none}
|
|
333
333
|
.animation-ruler-corner{position:sticky;left:0;z-index:7;display:flex;align-items:center;height:100%;padding:0 6px;background:var(--rv-bar);border-right:1px solid var(--border)}
|
|
334
334
|
.animation-axis{color:var(--fg-muted);font:10px var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
335
|
-
.animation-ruler-track{position:relative;height:100%;margin:0 8px;cursor:ew-resize;touch-action:none}
|
|
335
|
+
.animation-ruler-track{position:relative;height:100%;margin:0 8px;cursor:ew-resize;touch-action:none;container-type:inline-size}
|
|
336
336
|
.animation-ruler-tick{position:absolute;top:0;bottom:0;transform:translateX(-50%);display:inline-flex;align-items:center;padding-left:3px;border-left:1px solid var(--border-strong);color:var(--fg-muted);font:9px var(--font-mono);white-space:nowrap;pointer-events:none}
|
|
337
337
|
.animation-ruler-tick:first-child{transform:none}
|
|
338
338
|
.animation-ruler-tick:nth-last-child(2){transform:translateX(-100%);border-left:0;border-right:1px solid var(--border-strong);padding-left:0;padding-right:3px}
|
|
@@ -347,12 +347,13 @@ footer.status-bar{flex-wrap:nowrap}
|
|
|
347
347
|
.animation-readonly-badge{display:block;font:8.5px/10px var(--font-mono);color:var(--fg-muted);white-space:normal;overflow-wrap:anywhere;text-overflow:clip;max-width:100%;padding:1px 4px;pointer-events:none}
|
|
348
348
|
.animation-readonly-subrow{grid-column:2;margin:0 8px;padding:0 4px;font:8.5px/10px var(--font-mono)}
|
|
349
349
|
.readonly-lane-track .animation-readonly-badge{max-width:100%;padding:1px 4px}
|
|
350
|
-
.animation-key-lane{position:relative;height:22px;margin:0 8px}
|
|
350
|
+
.animation-key-lane{position:relative;height:22px;margin:0 8px;container-type:inline-size}
|
|
351
351
|
.animation-key{position:absolute;top:0;transform:translateX(-50%);padding:0 2px;border:0;background:transparent;color:var(--link);font-size:11px;line-height:22px;height:22px;min-width:10px;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2}
|
|
352
352
|
.animation-key[data-editable=true]{cursor:ew-resize}
|
|
353
353
|
.animation-key.selected{color:var(--warn);font-weight:700;z-index:4;text-shadow:0 0 4px var(--code-bg)}
|
|
354
354
|
.animation-key:hover,.animation-key:focus-visible{color:var(--pass);z-index:3}
|
|
355
|
-
|
|
355
|
+
/* #356: the playhead moves by an inline translate in its lane's container units (cqw), not by left: a left change relaid every lane on each played frame. */
|
|
356
|
+
.animation-playhead{position:absolute;top:0;bottom:0;left:0;width:1px;background:var(--warn);pointer-events:none;z-index:5}
|
|
356
357
|
.animation-selection-box{position:absolute;border:1.5px dashed var(--link);background:transparent;pointer-events:none;z-index:1;box-sizing:border-box}
|
|
357
358
|
.animation-curve-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-size:11px;margin-bottom:4px}
|
|
358
359
|
.animation-curve-toolbar select,.animation-curve-toolbar input{width:auto;padding:2px 6px;font-size:11px}
|