Skip to content

Commit 2a55fa3

Browse files
committed
feat(studio): glue API coexistence layer for the NLE swap
What: extends 21 glue files so the OLD timeline/canvas engine and the NEW NLE components type-check side by side: playerStore (multi-select setters, zoom pin, snap toggle, non-reactive scale scratch), drag-state types gain optional NLE fields, timelineLayout/timelineAssetDrop/timelineEditingHelpers/ timelineEditing/timelineElementHelpers/studioHelpers/assetHelpers gain the NLE exports, DomEditOverlay + gestures + AssetContextMenu + Timeline props gain optional callbacks/params, contexts gain *Optional hooks, and TimelineEditCallbacks.onMoveElements becomes a bivariant method accepting both engines' change shapes. patchDocumentRootDuration's test rides along. Why: this is the keystone that dissolves the old "welded glue" problem — every symbol the NLE components need is ADDED next to what the old engine still uses, so the engine components and the swaps can land as separate reviewable PRs. How: 15 authored intermediate files (main content + additive symbols; no behavior changes — new fields optional, new callbacks unused until wired) plus 6 files whose final content is already purely additive. New exports without consumers yet carry TEMP(studio-dnd) ignoreExports entries, removed by the app-shell swap. Test plan: tsc --noEmit in studio + studio-server (verifies BOTH engines compile); bunx vitest run (full suite green incl. the 6 new patchDocumentRootDuration tests); fallow audit clean.
1 parent 37f90ba commit 2a55fa3

24 files changed

Lines changed: 1176 additions & 56 deletions

‎.fallowrc.jsonc‎

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,104 @@
103103
"packages/cli/src/cloud/_gen/**",
104104
],
105105
"ignoreExports": [
106+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
107+
{
108+
"file": "packages/studio/src/player/lib/timelineElementHelpers.ts",
109+
"exports": ["furthestClipEndFromDocument"],
110+
},
111+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
112+
{
113+
"file": "packages/studio/src/hooks/timelineEditingHelpers.ts",
114+
"exports": ["patchIframeRootDuration"],
115+
},
116+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
117+
{
118+
"file": "packages/studio/src/components/sidebar/AssetContextMenu.tsx",
119+
"exports": ["DeleteConfirm"],
120+
},
121+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
122+
{
123+
"file": "packages/studio/src/components/editor/domEditOverlayGeometry.ts",
124+
"exports": ["overlayCornersCentroid", "elementCornerOverlayPoints", "orientedOverlayRect"],
125+
},
126+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
127+
{
128+
"file": "packages/studio/src/contexts/DomEditContext.tsx",
129+
"exports": ["useDomEditActionsContextOptional"],
130+
},
131+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
132+
{
133+
"file": "packages/studio/src/contexts/StudioContext.tsx",
134+
"exports": ["useStudioShellContextOptional"],
135+
},
136+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
137+
{
138+
"file": "packages/studio/src/components/editor/domEditOverlayGestures.ts",
139+
"exports": ["ResizeHandle"],
140+
},
141+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
142+
{
143+
"file": "packages/studio/src/components/sidebar/assetHelpers.ts",
144+
"exports": ["truncateMiddle", "formatDuration"],
145+
},
146+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
147+
{
148+
"file": "packages/studio/src/utils/studioHelpers.ts",
149+
"exports": ["resolveDroppedAssetDimensions"],
150+
},
151+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
152+
{
153+
"file": "packages/studio/src/player/lib/timelineElementHelpers.ts",
154+
"exports": ["furthestClipEndFromSource", "readTimelineElementZIndex"],
155+
},
156+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
157+
{
158+
"file": "packages/studio/src/components/editor/manualOffsetDrag.ts",
159+
"exports": ["applyManualOffsetNudgeDraft", "applyManualOffsetNudgeCommit"],
160+
},
161+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
162+
{
163+
"file": "packages/studio/src/player/components/timelineEditing.ts",
164+
"exports": [
165+
"applyTimelineAutoScrollStep",
166+
"resolveTimelineAutoScrollLoopAction",
167+
"resolveTimelineDragEscape",
168+
"TimelineDragEscapeInput",
169+
],
170+
},
171+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
172+
{
173+
"file": "packages/studio/src/hooks/timelineEditingHelpers.ts",
174+
"exports": [
175+
"shiftGsapPositionsBatch",
176+
"syncTimingEditPreview",
177+
"GsapMutationOutcome",
178+
"readGsapMutationScriptText",
179+
],
180+
},
181+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
182+
{
183+
"file": "packages/studio/src/utils/timelineAssetDrop.ts",
184+
"exports": [
185+
"setCompositionDurationToContent",
186+
"extendCompositionDurationIfNeeded",
187+
"fitTimelineAssetGeometry",
188+
"resolveTimelineAssetCompositionSize",
189+
],
190+
},
191+
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
192+
{
193+
"file": "packages/studio/src/player/components/timelineLayout.ts",
194+
"exports": [
195+
"getTimelineRowTop",
196+
"getTimelineRowFromY",
197+
"DRAG_EXTEND_MARGIN_PX",
198+
"getTimelineFitPps",
199+
"getTimelineDisplayContentWidth",
200+
"TRACKS_TOP_PAD",
201+
"MIN_TIMELINE_EXTENT_S",
202+
],
203+
},
106204
// TEMP(studio-dnd): consumers land later in the stack; removed by studio-dnd/pr22.
107205
{
108206
"file": "packages/studio/src/components/editor/domEditNudge.ts",
@@ -331,6 +429,51 @@
331429
// require intrusive middleware changes beyond this PR's scope.
332430
"minLines": 6,
333431
"ignore": [
432+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
433+
// studio-dnd pr22 removes this with the final config.
434+
"packages/studio/src/components/editor/domEditOverlayGeometry.ts",
435+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
436+
// studio-dnd pr22 removes this with the final config.
437+
"packages/studio/src/components/nle/NLEContext.tsx",
438+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
439+
// studio-dnd pr22 removes this with the final config.
440+
"packages/studio/src/components/nle/NLELayout.tsx",
441+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
442+
// studio-dnd pr22 removes this with the final config.
443+
"packages/studio/src/components/nle/PreviewPane.tsx",
444+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
445+
// studio-dnd pr22 removes this with the final config.
446+
"packages/studio/src/components/sidebar/AssetContextMenu.tsx",
447+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
448+
// studio-dnd pr22 removes this with the final config.
449+
"packages/studio/src/hooks/timelineEditingHelpers.ts",
450+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
451+
// studio-dnd pr22 removes this with the final config.
452+
"packages/studio/src/player/components/Timeline.tsx",
453+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
454+
// studio-dnd pr22 removes this with the final config.
455+
"packages/studio/src/player/components/TimelineCanvas.tsx",
456+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
457+
// studio-dnd pr22 removes this with the final config.
458+
"packages/studio/src/player/components/TimelineOverlays.tsx",
459+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
460+
// studio-dnd pr22 removes this with the final config.
461+
"packages/studio/src/player/components/timelineClipDragTypes.ts",
462+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
463+
// studio-dnd pr22 removes this with the final config.
464+
"packages/studio/src/player/components/useTimelineClipDrag.ts",
465+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
466+
// studio-dnd pr22 removes this with the final config.
467+
"packages/studio/src/player/components/useTimelineMarqueeSelection.ts",
468+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
469+
// studio-dnd pr22 removes this with the final config.
470+
"packages/studio/src/player/hooks/useTimelinePlayer.ts",
471+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
472+
// studio-dnd pr22 removes this with the final config.
473+
"packages/studio/src/player/hooks/useTimelinePlayerLoop.ts",
474+
// TEMP(studio-dnd): coexistence-window clone (extraction vs still-live original);
475+
// studio-dnd pr22 removes this with the final config.
476+
"packages/studio/src/player/lib/timelineElementHelpers.ts",
334477
// sourcePatcher.ts: pre-existing internal clones between the inline-style
335478
// and attribute tag-patchers; only the PatchOperation type gained two
336479
// optional fields here, but the line shift makes fallow re-flag them.
@@ -456,6 +599,12 @@
456599
// complexity pre-dates the computed-timeline work. Exempted at file level
457600
// rather than refactored as scope creep.
458601
"ignore": [
602+
// TEMP(studio-dnd): coexistence-window complexity flare (inherited/CRAP-no-coverage);
603+
// removed by studio-dnd/pr22 when the final config lands.
604+
"packages/studio/src/components/editor/domEditOverlayGeometry.ts",
605+
"packages/studio/src/components/editor/manualOffsetDrag.ts",
606+
"packages/studio/src/player/components/timelineEditing.ts",
607+
"packages/studio/src/player/lib/timelineElementHelpers.ts",
459608
// TEMP(studio-dnd): coexistence-window complexity flare (inherited/CRAP-no-coverage);
460609
// removed by studio-dnd/pr22 when the final config lands.
461610
"packages/studio/src/player/components/TimelineOverlays.tsx",

‎packages/studio/src/components/editor/DomEditOverlay.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { readDomEditSelectionShapeStyles, resolveBoxChromeClass } from "./domEdi
2727
import { useDomEditCompositionRect } from "./useDomEditCompositionRect";
2828
import { useMountEffect } from "../../hooks/useMountEffect";
2929
import { startOffCanvasIndicatorRefresh } from "./offCanvasIndicatorRefresh";
30+
import type { ZOrderPatch } from "./canvasContextMenuZOrder";
3031

3132
// Re-exports for external consumers — preserving existing import paths.
3233
export {
@@ -73,6 +74,7 @@ interface DomEditOverlayProps {
7374
onBoxSizeCommit: (
7475
selection: DomEditSelection,
7576
next: { width: number; height: number },
77+
offset?: { x: number; y: number },
7678
) => Promise<void> | void;
7779
onRotationCommit: (selection: DomEditSelection, next: { angle: number }) => Promise<void> | void;
7880
onStyleCommit?: (property: string, value: string) => Promise<void> | void;
@@ -81,6 +83,19 @@ interface DomEditOverlayProps {
8183
recordingState?: GestureRecordingState;
8284
onToggleRecording?: () => void;
8385
onMarqueeSelect?: (selections: DomEditSelection[], additive: boolean) => void;
86+
/**
87+
* Delete the selected canvas element.
88+
* Wire to handleDomEditElementDelete from useDomEditActionsContext —
89+
* same handler the Delete/Backspace hotkey uses.
90+
*/
91+
onDeleteSelection?: (selection: DomEditSelection) => void;
92+
/**
93+
* Called with the resolved z-order patch list after an optimistic DOM update.
94+
* The patch list is tie-aware and may include sibling elements (see
95+
* canvasContextMenuZOrder). Wire to handleDomZIndexReorderCommit from
96+
* useDomEditActionsContext. See CanvasContextMenu.tsx module comment.
97+
*/
98+
onApplyZIndex?: (selection: DomEditSelection, patches: ZOrderPatch[]) => void;
8499
}
85100

86101
// fallow-ignore-next-line complexity

0 commit comments

Comments
 (0)