Skip to content

🎥 Make videos programmatically with React

fix(studio): render effects below sequence control fields

Jonny Burger364e5816fee8
diff --git a/packages/studio/src/helpers/timeline-layout.ts b/packages/studio/src/helpers/timeline-layout.ts
index bf8f969a45..626d0cf841 100644
--- a/packages/studio/src/helpers/timeline-layout.ts
+++ b/packages/studio/src/helpers/timeline-layout.ts
@@ -81,6 +81,31 @@ export const buildTimelineTree = ({
const roots: TimelineTreeNode[] = [];
const {sequenceSubscriptionKey, index, auxiliaryKeys} = nodePathInfo;
+ const controlFields = getFieldsToShow({
+ schema: sequence.controls!.schema,
+ currentRuntimeValueDotNotation:
+ sequence.controls!.currentRuntimeValueDotNotation,
+ getDragOverrides,
+ codeValues,
+ nodePath: sequenceSubscriptionKey,
+ });
+
+ if (controlFields && controlFields.length > 0) {
+ for (const f of controlFields) {
+ roots.push({
+ kind: 'field',
+ nodePathInfo: {
+ sequenceSubscriptionKey,
+ auxiliaryKeys: [...auxiliaryKeys, 'controls', f.key],
+ index,
+ numberOfSequencesWithThisNodePath: 0,
+ },
+ label: f.description ?? f.key,
+ field: f,
+ });
+ }
+ }
+
if (sequence.effects.length > 0) {
roots.push({
kind: 'group',
@@ -127,31 +152,6 @@ export const buildTimelineTree = ({
});
}
- const controlFields = getFieldsToShow({
- schema: sequence.controls!.schema,
- currentRuntimeValueDotNotation:
- sequence.controls!.currentRuntimeValueDotNotation,
- getDragOverrides,
- codeValues,
- nodePath: sequenceSubscriptionKey,
- });
-
- if (controlFields && controlFields.length > 0) {
- for (const f of controlFields) {
- roots.push({
- kind: 'field',
- nodePathInfo: {
- sequenceSubscriptionKey,
- auxiliaryKeys: [...auxiliaryKeys, 'controls', f.key],
- index,
- numberOfSequencesWithThisNodePath: 0,
- },
- label: f.description ?? f.key,
- field: f,
- });
- }
- }
-
return roots;
};
diff --git a/packages/studio/src/test/timeline-tree-layout.test.ts b/packages/studio/src/test/timeline-tree-layout.test.ts
index b1b2c27242..0fd57c45f7 100644
--- a/packages/studio/src/test/timeline-tree-layout.test.ts
+++ b/packages/studio/src/test/timeline-tree-layout.test.ts
@@ -118,10 +118,10 @@ test('flattenVisibleTreeNodes assigns increasing tree depth', () => {
});
expect(flat.map(({node, depth}) => ({label: node.label, depth}))).toEqual([
+ {label: 'Translate', depth: 0},
{label: 'Effects', depth: 0},
{label: 'Halftone', depth: 1},
{label: 'Color', depth: 2},
- {label: 'Translate', depth: 0},
]);
});