summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/commands/timeline/element/move-elements.ts
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2026-04-06 00:02:23 +0200
committerMaze Winther <mazewinther@gmail.com>2026-04-06 00:02:23 +0200
commit44d8c4c8764d49a8e8d0ae713432c07f07cb7597 (patch)
tree4657187279adb475ea710231feb3d0bd4add36ed /apps/web/src/lib/commands/timeline/element/move-elements.ts
parent20235d0724a70e6787b6cbdbfa054b1c5d8f62e9 (diff)
downloadopencut-44d8c4c8764d49a8e8d0ae713432c07f07cb7597.tar.gz
refactor: unify element updates into pipeline and centralize ripple
Diffstat (limited to 'apps/web/src/lib/commands/timeline/element/move-elements.ts')
-rw-r--r--apps/web/src/lib/commands/timeline/element/move-elements.ts14
1 files changed, 1 insertions, 13 deletions
diff --git a/apps/web/src/lib/commands/timeline/element/move-elements.ts b/apps/web/src/lib/commands/timeline/element/move-elements.ts
index e944ca81..cf3afa6d 100644
--- a/apps/web/src/lib/commands/timeline/element/move-elements.ts
+++ b/apps/web/src/lib/commands/timeline/element/move-elements.ts
@@ -10,7 +10,6 @@ import {
validateElementTrackCompatibility,
enforceMainTrackStart,
} from "@/lib/timeline/placement";
-import { rippleShiftElements } from "@/lib/timeline/ripple-utils";
export class MoveElementCommand extends Command {
private savedState: TimelineTrack[] | null = null;
@@ -19,7 +18,6 @@ export class MoveElementCommand extends Command {
private readonly elementId: string;
private readonly newStartTime: number;
private readonly createTrack: { type: TrackType; index: number } | undefined;
- private readonly rippleEnabled: boolean;
constructor({
sourceTrackId,
@@ -27,14 +25,12 @@ export class MoveElementCommand extends Command {
elementId,
newStartTime,
createTrack,
- rippleEnabled = false,
}: {
sourceTrackId: string;
targetTrackId: string;
elementId: string;
newStartTime: number;
createTrack?: { type: TrackType; index: number };
- rippleEnabled?: boolean;
}) {
super();
this.sourceTrackId = sourceTrackId;
@@ -42,7 +38,6 @@ export class MoveElementCommand extends Command {
this.elementId = elementId;
this.newStartTime = newStartTime;
this.createTrack = createTrack;
- this.rippleEnabled = rippleEnabled;
}
execute(): CommandResult | undefined {
@@ -113,14 +108,7 @@ export class MoveElementCommand extends Command {
const remainingElements = track.elements.filter(
(trackElement) => trackElement.id !== this.elementId,
);
- const shiftedElements = this.rippleEnabled
- ? rippleShiftElements({
- elements: remainingElements,
- afterTime: element.startTime,
- shiftAmount: element.duration,
- })
- : remainingElements;
- return { ...track, elements: shiftedElements } as typeof track;
+ return { ...track, elements: remainingElements } as typeof track;
}
if (track.id === this.targetTrackId) {