feat(studio): s7.5 — delete shadow scaffolding; keep cutover flag (dark launch) (#1462)

Removes the SDK shadow telemetry: STUDIO_SDK_SHADOW_ENABLED, sdkShadow.ts +
sdkShadowGsapFidelity/GsapKeyframe/Numeric and their tests, the runShadow*
call-sites across the GSAP/timeline hooks, and the onDomEditPersisted shadow
callback in useDomEditSession. Moves patchOpsToSdkEditOps into sdkCutover.ts.

KEEPS STUDIO_SDK_CUTOVER_ENABLED as a dark-launch kill-switch — default false,
enable per-environment via VITE_STUDIO_SDK_CUTOVER_ENABLED=true. shouldUseSdkCutover
stays flag-gated. The stack can merge with zero behavior change; cutover is
validated by flipping the flag, not by removing it.

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>
This commit is contained in:
Vance Ingalls
2026-06-17 16:27:03 -07:00
committed by GitHub
co-authored by Miguel Ángel
parent 0ca1a8a9d1
commit ca1a8a6879
15 changed files with 54 additions and 2110 deletions
@@ -1,6 +1,5 @@
import { useCallback } from "react";
import type { GsapAnimation } from "@hyperframes/core/gsap-parser";
import type { ShadowKeyframeOp } from "../utils/sdkShadowGsapKeyframe";
import type { DomEditSelection } from "../components/editor/domEditingTypes";
import { executeOptimistic } from "../utils/optimisticUpdate";
import type { KeyframeCacheEntry } from "../player/store/playerStore";
@@ -59,13 +58,6 @@ export function useGsapKeyframeOps({
percentage,
properties: { [property]: value },
};
// Shadow op (gsap_keyframe): SDK equivalent diffed via the commit chokepoint.
const shadowKeyframeOp: ShadowKeyframeOp = {
kind: "add",
animationId,
percentage,
properties: { [property]: value },
};
void executeOptimisticKeyframeCacheUpdate({
sourceFile,
elementId: selection.id,
@@ -79,7 +71,6 @@ export function useGsapKeyframeOps({
commitMutation(selection, mutation, {
label: `Add keyframe at ${percentage}%`,
softReload: true,
shadowKeyframeOp,
}),
}).catch((error) => {
trackGsapSaveFailure(error, selection, mutation, `Add keyframe at ${percentage}%`);
@@ -95,16 +86,10 @@ export function useGsapKeyframeOps({
percentage: number,
properties: Record<string, number | string>,
) => {
const shadowKeyframeOp: ShadowKeyframeOp = {
kind: "add",
animationId,
percentage,
properties,
};
return commitMutation(
selection,
{ type: "add-keyframe", animationId, percentage, properties },
{ label: `Add keyframe at ${percentage}%`, softReload: true, shadowKeyframeOp },
{ label: `Add keyframe at ${percentage}%`, softReload: true },
);
},
[commitMutation],
@@ -114,10 +99,6 @@ export function useGsapKeyframeOps({
(selection: DomEditSelection, animationId: string, percentage: number) => {
const sourceFile = selection.sourceFile || activeCompPath || "index.html";
const mutation = { type: "remove-keyframe", animationId, percentage };
// Shadow op (gsap_keyframe): SDK has no %-based removeGsapKeyframe on main,
// so the runner resolves percentage → keyframeIndex against the pre-op
// script and no-ops on ambiguity (duplicate-percentage keyframes).
const shadowKeyframeOp: ShadowKeyframeOp = { kind: "remove", animationId, percentage };
void executeOptimisticKeyframeCacheUpdate({
sourceFile,
elementId: selection.id,
@@ -131,7 +112,6 @@ export function useGsapKeyframeOps({
commitMutation(selection, mutation, {
label: `Remove keyframe at ${percentage}%`,
softReload: true,
shadowKeyframeOp,
}),
}).catch((error) => {
trackGsapSaveFailure(error, selection, mutation, `Remove keyframe at ${percentage}%`);