fix(studio): address review findings on graded-element editing

Review follow-ups (both reviewers, all findings):

- resize captures scope to the resize group: convert-to-keyframes
  resolvedFromValues and the whole-offset backfill pass the group filter,
  so an opacity-touching intro tween can't ride into a converted scale
  tween (the rotation fix's contract, now uniform across intercepts)
- commitStaticSet resolves every group's target set BEFORE committing and
  coalesces groups landing on the same legacy mixed set into one commit —
  the second commit can no longer chase a stale group-derived id
- installAuthoredOpacityCapture also stamps an element the moment it GAINS
  data-color-grading at runtime (attributeFilter), not just at insertion
- both writer twins now share the same emitted-set dedupe shape
- applySoftReload's positional tail becomes a SoftReloadOptions object
- readAllAnimatedProperties builds the group-filtered key set immutably
  instead of deleting from the set mid-iteration
- applyAuthoredInlineOpacity documents the priority-lossy round-trip
- the marquee hit-test reads activeCompositionPathRef like its neighbors

New tests: resize intercept (scale route + group filter + non-uniform
longhands), after-write-HTML / stamp / empty-stamp opacity restore, the
no-op-commit-with-missed-instant-patch soft-reload contract, and the
runtime-gained-grading stamp.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-11 15:18:49 -04:00
parent 67cfae2587
commit 5d1cafff82
13 changed files with 367 additions and 88 deletions
@@ -106,11 +106,9 @@ export function readAllAnimatedProperties(
// point of property-group tweens is that a rotation commit never carries
// opacity/rotationX/etc. captured from unrelated tweens on the element.
const inGroup = (p: string) => !group || classifyPropertyGroup(p) === group;
for (const p of propKeys) {
if (!inGroup(p)) propKeys.delete(p);
}
const groupedPropKeys = new Set([...propKeys].filter(inGroup));
for (const prop of propKeys) {
for (const prop of groupedPropKeys) {
const val = readLiveGsapValue(gsap, el, prop);
if (Number.isFinite(val)) {
result[prop] = POSITION_PROPS.has(prop) ? Math.round(val) : roundTo3(val);
@@ -142,7 +140,7 @@ export function readAllAnimatedProperties(
}
}
} catch {}
for (const p of propKeys) otherTweenProps.delete(p);
for (const p of groupedPropKeys) otherTweenProps.delete(p);
// Tier 1: Transform + visual properties with universal CSS defaults.
// Safe to compare against hardcoded values — these are always 0 or 1
@@ -174,7 +172,7 @@ export function readAllAnimatedProperties(
// Collect all properties that ANY tween on this element explicitly targets.
// Only capture baseline values for these — GSAP reports non-default values
// (scaleZ=0, brightness=0) for untouched properties, polluting keyframes.
const allTweenedProps = new Set([...propKeys, ...otherTweenProps]);
const allTweenedProps = new Set([...groupedPropKeys, ...otherTweenProps]);
for (const [prop, defaultVal] of Object.entries(UNIVERSAL_BASELINE)) {
if (prop in result) continue;
if (!allTweenedProps.has(prop)) continue;