Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Add separator lines between expanded timeline rows (fixes #6758)

Jonny Burgerc45f852474b8
diff --git a/packages/studio/src/components/Timeline/TimelineExpandedSection.tsx b/packages/studio/src/components/Timeline/TimelineExpandedSection.tsx
index cb1b71a88a..d051d78b41 100644
--- a/packages/studio/src/components/Timeline/TimelineExpandedSection.tsx
+++ b/packages/studio/src/components/Timeline/TimelineExpandedSection.tsx
@@ -17,11 +17,14 @@ const expandedSectionBase: React.CSSProperties = {
fontSize: 12,
display: 'flex',
flexDirection: 'column',
- paddingLeft: 28,
- paddingRight: 10,
borderBottom: `1px solid ${TIMELINE_TRACK_SEPARATOR}`,
};
+const separator: React.CSSProperties = {
+ height: 1,
+ backgroundColor: TIMELINE_TRACK_SEPARATOR,
+};
+
export const TimelineExpandedSection: React.FC<{
readonly sequence: TSequence;
readonly originalLocation: OriginalPosition | null;
@@ -63,14 +66,16 @@ export const TimelineExpandedSection: React.FC<{
return (
<div style={style}>
{schemaFields
- ? schemaFields.map((field) => {
+ ? schemaFields.map((field, i) => {
return (
- <TimelineFieldRow
- key={field.key}
- field={field}
- overrideId={overrideId}
- validatedLocation={validatedLocation}
- />
+ <React.Fragment key={field.key}>
+ {i > 0 ? <div style={separator} /> : null}
+ <TimelineFieldRow
+ field={field}
+ overrideId={overrideId}
+ validatedLocation={validatedLocation}
+ />
+ </React.Fragment>
);
})
: 'No schema'}
diff --git a/packages/studio/src/components/Timeline/TimelineFieldRow.tsx b/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
index 1069787870..a93c140864 100644
--- a/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
+++ b/packages/studio/src/components/Timeline/TimelineFieldRow.tsx
@@ -10,7 +10,8 @@ const fieldRow: React.CSSProperties = {
display: 'flex',
alignItems: 'center',
gap: 8,
- paddingLeft: 24,
+ paddingLeft: 52,
+ paddingRight: 10,
};
const fieldName: React.CSSProperties = {
diff --git a/packages/studio/src/helpers/timeline-layout.ts b/packages/studio/src/helpers/timeline-layout.ts
index 5044229fed..375902aa5b 100644
--- a/packages/studio/src/helpers/timeline-layout.ts
+++ b/packages/studio/src/helpers/timeline-layout.ts
@@ -53,7 +53,8 @@ export const getExpandedTrackHeight = (
return TIMELINE_TRACK_EXPANDED_HEIGHT;
}
- return fields.reduce((sum, f) => sum + f.rowHeight, 0);
+ const separators = Math.max(0, fields.length - 1);
+ return fields.reduce((sum, f) => sum + f.rowHeight, 0) + separators;
};
export const getTimelineLayerHeight = (type: 'video' | 'other') => {