Skip to content

Commit 6e37e12

Browse files
committed
feat(studio): app shell swap — mount EditorShell, retire the legacy engine
What: the final swap (43 files): App mounts EditorShell; contexts, hotkeys, sidebar (AssetsTab→AssetCard, toolbar, audio row), useTimelineEditing and the store drop the legacy single-select API and trimmed callbacks; deletes the 7 files this orphans (StudioPreviewArea, NLELayout, useTimelineGroupEditing, timelineLayerDrag + suites, legacy hook test); .fallowrc.jsonc lands at final content, dropping every TEMP(studio-dnd) suppression — everything shipped unwired is now reachable. Why: last step of the NLE integration; after this the tree is byte-identical to the previously-green integration checkpoint. How: modified files to final content + gate-forced deletions + suppression cleanup. Tree parity with checkpoint 86dd2a32b verified. Test plan: tsc --noEmit in studio, studio-server, core; bun run --filter @hyperframes/studio build; bunx vitest run (full suite); fallow audit clean with zero remaining TEMP entries; tree-diff vs 86dd2a32b empty.
1 parent 0938959 commit 6e37e12

79 files changed

Lines changed: 5180 additions & 6625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.fallowrc.jsonc‎

Lines changed: 1 addition & 278 deletions
Large diffs are not rendered by default.

‎docs/contributing/studio-manual-dom-editing.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ The main implementation lives in:
274274

275275
Supporting Studio shell changes also landed in:
276276

277-
- `packages/studio/src/components/nle/NLELayout.tsx`
277+
- `packages/studio/src/components/EditorShell.tsx`
278278
- `packages/studio/src/components/nle/NLEPreview.tsx`
279279
- `packages/studio/src/components/sidebar/CompositionsTab.tsx`
280280
- `packages/studio/src/components/sidebar/LeftSidebar.tsx`

‎docs/packages/studio.mdx‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,20 @@ Peer dependencies: `react` (19), `react-dom` (19), `zustand` (4 or 5).
6161
### Layout
6262

6363
```typescript
64-
import { NLELayout, NLEPreview, CompositionBreadcrumb } from '@hyperframes/studio';
64+
import { EditorShell, NLEPreview, CompositionBreadcrumb } from '@hyperframes/studio';
6565
import type { CompositionLevel } from '@hyperframes/studio';
6666

67-
// Main NLE (Non-Linear Editor) layout container
68-
<NLELayout>
69-
{/* Preview, timeline, and editor panels */}
70-
</NLELayout>
67+
// Main NLE (Non-Linear Editor) layout container. It arranges the sidebar
68+
// (`left`), inspector (`right`), preview, and timeline, and takes the editor
69+
// callbacks (timeline edits, drops, clip rendering) as props — see StudioApp
70+
// for a fully wired setup.
71+
<EditorShell
72+
left={sidebar}
73+
right={inspector}
74+
timelineToolbar={toolbar}
75+
renderClipContent={renderClip}
76+
/* …timeline edit / drop / delete handlers */
77+
/>
7178

7279
// Preview panel
7380
<NLEPreview />

‎packages/core/src/runtime/timeline.ts‎

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -51,60 +51,6 @@ function maxDefinedNumber(...values: Array<number | null>): number | null {
5151
return Math.max(...finite);
5252
}
5353

54-
/**
55-
* When multiple content kinds share the same track number, split them
56-
* onto separate tracks so the timeline UI shows distinct rows.
57-
*
58-
* Preferred kind order (top → bottom): composition, video, image, element, audio.
59-
* Tracks that contain only one kind are left untouched.
60-
*/
61-
const KIND_ORDER: Record<string, number> = {
62-
composition: 0,
63-
video: 1,
64-
image: 2,
65-
element: 3,
66-
audio: 4,
67-
};
68-
69-
function normalizeTrackAssignments(clips: RuntimeTimelineClip[]): void {
70-
if (clips.length === 0) return;
71-
72-
// Group clips by their raw track number and detect which tracks have mixed kinds
73-
const trackKinds = new Map<number, Set<string>>();
74-
for (const clip of clips) {
75-
const kinds = trackKinds.get(clip.track) ?? new Set();
76-
kinds.add(clip.kind);
77-
trackKinds.set(clip.track, kinds);
78-
}
79-
80-
const hasMixedTracks = Array.from(trackKinds.values()).some((kinds) => kinds.size > 1);
81-
if (!hasMixedTracks) return;
82-
83-
// Build new contiguous track numbers, splitting mixed tracks by kind
84-
let nextTrack = 0;
85-
const newTrackMap = new Map<string, number>(); // "origTrack:kind" → newTrack
86-
87-
const sortedTracks = [...trackKinds.keys()].sort((a, b) => a - b);
88-
for (const track of sortedTracks) {
89-
const kinds = trackKinds.get(track)!;
90-
if (kinds.size === 1) {
91-
newTrackMap.set(`${track}:${[...kinds][0]}`, nextTrack++);
92-
} else {
93-
// Split by kind in preferred order
94-
const sorted = [...kinds].sort((a, b) => (KIND_ORDER[a] ?? 99) - (KIND_ORDER[b] ?? 99));
95-
for (const kind of sorted) {
96-
newTrackMap.set(`${track}:${kind}`, nextTrack++);
97-
}
98-
}
99-
}
100-
101-
for (const clip of clips) {
102-
const key = `${clip.track}:${clip.kind}`;
103-
const newTrack = newTrackMap.get(key);
104-
if (newTrack != null) clip.track = newTrack;
105-
}
106-
}
107-
10854
function toAbsoluteAssetUrl(rawValue: string | null | undefined): string | null {
10955
const raw = String(rawValue ?? "").trim();
11056
if (!raw) return null;
@@ -638,11 +584,12 @@ export function collectRuntimeTimelinePayload(params: {
638584
}
639585
}
640586

641-
// ── Track normalization ────────────────────────────────────────────────
642-
// When multiple content kinds (composition, audio, video, …) share the same
643-
// data-track-index value, split them onto separate tracks so the timeline UI
644-
// shows distinct rows for each kind.
645-
normalizeTrackAssignments(clips);
587+
// Track assignment honors the authored data-track-index verbatim: a clip stays
588+
// on the track it was placed on, regardless of kind. (Previously mixed-kind
589+
// tracks were split onto separate rows, but that renumbered tracks — breaking
590+
// "drop a clip onto an existing track" and causing the written track to drift
591+
// from the displayed one on every move. Track index is display-only; render
592+
// never reads it, so honoring it verbatim is the correct NLE behavior.)
646593

647594
for (const compositionNode of compositionNodes) {
648595
if (compositionNode === root) continue;

0 commit comments

Comments
 (0)