Browse Source

fix: pass outputDuration through parent-child ease curve connections

The easeCurve settings handle propagated bezierHandles and easingPreset
but omitted outputDuration, so children always used their local duration
instead of the parent's.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
96649de97e
  1. 2
      src/store/execution/__tests__/videoProcessingExecutors.test.ts
  2. 5
      src/store/execution/videoProcessingExecutors.ts
  3. 2
      src/store/utils/__tests__/connectedInputs.test.ts
  4. 3
      src/store/utils/connectedInputs.ts

2
src/store/execution/__tests__/videoProcessingExecutors.test.ts

@ -219,6 +219,7 @@ describe("executeEaseCurve", () => {
easeCurve: {
bezierHandles: [0.42, 0, 0.58, 1],
easingPreset: "ease-in-out",
outputDuration: 10,
},
}),
getEdges: vi.fn().mockReturnValue([
@ -232,6 +233,7 @@ describe("executeEaseCurve", () => {
expect(ctx.updateNodeData).toHaveBeenCalledWith("ec-1", expect.objectContaining({
bezierHandles: [0.42, 0, 0.58, 1],
easingPreset: "ease-in-out",
outputDuration: 10,
inheritedFrom: "parent-ec",
}));
});

5
src/store/execution/videoProcessingExecutors.ts

@ -235,9 +235,11 @@ export async function executeEaseCurve(ctx: NodeExecutionContext): Promise<void>
// Propagate parent easeCurve settings if inherited
let activeBezierHandles = nodeData.bezierHandles;
let activeEasingPreset = nodeData.easingPreset;
let activeOutputDuration = nodeData.outputDuration;
if (inputs.easeCurve) {
activeBezierHandles = inputs.easeCurve.bezierHandles;
activeEasingPreset = inputs.easeCurve.easingPreset;
activeOutputDuration = inputs.easeCurve.outputDuration;
const edges = getEdges();
const easeCurveSourceId =
edges.filter(
@ -246,6 +248,7 @@ export async function executeEaseCurve(ctx: NodeExecutionContext): Promise<void>
updateNodeData(node.id, {
bezierHandles: activeBezierHandles,
easingPreset: activeEasingPreset,
outputDuration: activeOutputDuration,
inheritedFrom: easeCurveSourceId,
});
}
@ -295,7 +298,7 @@ export async function executeEaseCurve(ctx: NodeExecutionContext): Promise<void>
const outputBlob = await applySpeedCurveAsync(
videoBlob,
videoDuration,
nodeData.outputDuration,
activeOutputDuration,
(progress) => {
updateNodeData(node.id, { progress: progress.progress });
},

2
src/store/utils/__tests__/connectedInputs.test.ts

@ -255,6 +255,7 @@ describe("getConnectedInputsPure", () => {
makeNode("ec", "easeCurve", {
bezierHandles: [0.25, 0.1, 0.25, 1.0],
easingPreset: "ease-in-out",
outputDuration: 8,
outputVideo: null,
}),
makeNode("vs", "videoStitch"),
@ -270,6 +271,7 @@ describe("getConnectedInputsPure", () => {
expect(result.easeCurve).toEqual({
bezierHandles: [0.25, 0.1, 0.25, 1.0],
easingPreset: "ease-in-out",
outputDuration: 8,
});
});

3
src/store/utils/connectedInputs.ts

@ -39,7 +39,7 @@ export interface ConnectedInputs {
model3d: string | null;
text: string | null;
dynamicInputs: Record<string, string | string[]>;
easeCurve: { bezierHandles: [number, number, number, number]; easingPreset: string | null } | null;
easeCurve: { bezierHandles: [number, number, number, number]; easingPreset: string | null; outputDuration: number } | null;
}
/**
@ -308,6 +308,7 @@ export function getConnectedInputsPure(
easeCurve = {
bezierHandles: sourceData.bezierHandles,
easingPreset: sourceData.easingPreset,
outputDuration: sourceData.outputDuration,
};
}
}

Loading…
Cancel
Save