Skip to content

🎥 Make videos programmatically with React

@remotion/studio: Show keyframed label for interpolated props

JonnyBurger854c85a65ef8
diff --git a/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx b/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
index bf1ceb3ec8..49978ffdce 100644
--- a/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
+++ b/packages/studio/src/components/Timeline/TimelineEffectFieldRow.tsx
@@ -12,7 +12,11 @@ import {getTimelineFieldLabelRowStyle} from './timeline-field-row-layout';
import {TimelineExpandArrowSpacer} from './TimelineExpandArrowButton';
import {TimelineLayerEyeSpacer} from './TimelineLayerEye';
import {TimelineRowChrome} from './TimelineRowChrome';
-import {TimelineFieldValue, UnsupportedStatus} from './TimelineSchemaField';
+import {
+ getComputedStatusLabel,
+ TimelineFieldValue,
+ UnsupportedStatus,
+} from './TimelineSchemaField';
const fieldRowBase: React.CSSProperties = {
paddingRight: EXPANDED_SECTION_PADDING_RIGHT,
@@ -181,7 +185,7 @@ const Value: React.FC<{
if (propStatus === null || !propStatus.canUpdate) {
if (propStatus?.reason === 'computed') {
- return <UnsupportedStatus label="computed" />;
+ return <UnsupportedStatus label={getComputedStatusLabel(propStatus)} />;
}
return null;
diff --git a/packages/studio/src/components/Timeline/TimelineSchemaField.tsx b/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
index d2e0620690..794df49ac7 100644
--- a/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSchemaField.tsx
@@ -37,6 +37,18 @@ export const UnsupportedStatus: React.FC<{
return <span style={unsupportedLabel}>{label}</span>;
};
+export const getComputedStatusLabel = (
+ propStatus: CanUpdateSequencePropStatusFalse,
+): string => {
+ if (propStatus.reason !== 'computed') {
+ throw new Error(
+ `Unsupported prop status: ${propStatus.reason satisfies never}`,
+ );
+ }
+
+ return propStatus.keyframes?.length ? 'keyframed' : 'computed';
+};
+
export const TimelineNonEditableStatus: React.FC<{
readonly propStatus: CanUpdateSequencePropStatusFalse;
}> = ({propStatus}) => {
@@ -45,7 +57,9 @@ export const TimelineNonEditableStatus: React.FC<{
}
if (propStatus.reason === 'computed') {
- return <span style={unsupportedLabel}>computed</span>;
+ return (
+ <span style={unsupportedLabel}>{getComputedStatusLabel(propStatus)}</span>
+ );
}
throw new Error(