Skip to content

🎥 Make videos programmatically with React

yo

Jonny Burger5575cbba580e
diff --git a/packages/studio/src/components/PreviewToolbar.tsx b/packages/studio/src/components/PreviewToolbar.tsx
index 8f95963e8e..4060d7e666 100644
--- a/packages/studio/src/components/PreviewToolbar.tsx
+++ b/packages/studio/src/components/PreviewToolbar.tsx
@@ -8,7 +8,6 @@ import {
} from '../helpers/is-current-selected-still';
import {useMobileLayout} from '../helpers/mobile-layout';
import {TIMELINE_PADDING} from '../helpers/timeline-layout';
-import {ENABLE_OUTLINES} from '../state/editor-outlines';
import {loadLoopOption} from '../state/loop';
import {CheckboardToggle} from './CheckboardToggle';
import {FpsCounter} from './FpsCounter';
@@ -23,6 +22,7 @@ import {PlaybackRateSelector} from './PlaybackRateSelector';
import {PlayPause} from './PlayPause';
import {RenderButton} from './RenderButton';
import {SizeSelector} from './SizeSelector';
+import {ENABLE_OUTLINES} from './Timeline/TimelineSelection';
import {TimelineZoomControls} from './Timeline/TimelineZoomControls';
import {TimelineInOutPointToggle} from './TimelineInOutToggle';
@@ -195,12 +195,18 @@ export const PreviewToolbar: React.FC<{
<Spacing x={2} />
</>
) : null}
- {canvasContent?.type === 'composition' ? <CheckboardToggle /> : null}
- {ENABLE_OUTLINES && canvasContent?.type === 'composition' ? (
- <OutlineToggle />
+ {canvasContent?.type === 'composition' ? (
+ <>
+ <CheckboardToggle />
+ {ENABLE_OUTLINES ? <OutlineToggle /> : null}
+ </>
+ ) : null}
+ {canvasContent && isFullscreenSupported ? (
+ <>
+ <Spacing x={2} />
+ <FullScreenToggle />
+ </>
) : null}
- <Spacing x={1} />
- {canvasContent && isFullscreenSupported ? <FullScreenToggle /> : null}
<Flex />
{isMobileLayout && (
<>
diff --git a/packages/studio/src/components/SelectedOutlineOverlay.tsx b/packages/studio/src/components/SelectedOutlineOverlay.tsx
index 574ff9477e..b803cef976 100644
--- a/packages/studio/src/components/SelectedOutlineOverlay.tsx
+++ b/packages/studio/src/components/SelectedOutlineOverlay.tsx
@@ -21,10 +21,7 @@ import {formatFileLocation} from '../helpers/format-file-location';
import {getBoxQuadsPonyfill} from '../helpers/get-box-quads-ponyfill';
import type {SequenceNodePathInfo} from '../helpers/get-timeline-sequence-sort-key';
import {openOriginalPositionInEditor} from '../helpers/open-in-editor';
-import {
- EditorShowOutlinesContext,
- ENABLE_OUTLINES,
-} from '../state/editor-outlines';
+import {EditorShowOutlinesContext} from '../state/editor-outlines';
import {ScaleLockContext} from '../state/scale-lock';
import {ContextMenuForTarget} from './ContextMenu';
import type {ComboboxValue} from './NewComposition/ComboBox';
@@ -42,6 +39,7 @@ import {
} from './Timeline/timeline-translate-utils';
import {getLinkedScale} from './Timeline/TimelineScaleField';
import {
+ ENABLE_OUTLINES,
getTimelineSequenceSelectionKey,
useTimelineSelection,
type TimelineSelection,
diff --git a/packages/studio/src/components/Timeline/TimelineSelection.tsx b/packages/studio/src/components/Timeline/TimelineSelection.tsx
index 43f0275227..e2f4ebcac8 100644
--- a/packages/studio/src/components/Timeline/TimelineSelection.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSelection.tsx
@@ -17,10 +17,7 @@ import type {
import {TIMELINE_PADDING} from '../../helpers/timeline-layout';
import {timelineNodePathInfoToKey} from '../../helpers/timeline-node-path-key';
import {useKeybinding} from '../../helpers/use-keybinding';
-import {
- EditorShowOutlinesContext,
- ENABLE_OUTLINES as ENABLE_OUTLINES_FLAG,
-} from '../../state/editor-outlines';
+import {EditorShowOutlinesContext} from '../../state/editor-outlines';
import {TimelineClipboardKeybindings} from './TimelineClipboardKeybindings';
import {TimelineDeleteKeybindings} from './TimelineDeleteKeybindings';
@@ -64,9 +61,9 @@ export const getTimelineSelectedTrackHighlightStyle = (
width: timelineWidth,
});
-export const SELECTION_ENABLED = false;
-export const TIMELINE_TOP_DRAG = false;
-export {ENABLE_OUTLINES} from '../../state/editor-outlines';
+export const SELECTION_ENABLED = true;
+export const TIMELINE_TOP_DRAG = true;
+export const ENABLE_OUTLINES = true;
type TimelineSelectionBase = {
readonly nodePathInfo: SequenceNodePathInfo;
@@ -449,7 +446,7 @@ export const TimelineSelectionProvider: React.FC<{
const {previewServerState} = useContext(StudioServerConnectionCtx);
const {editorShowOutlines} = useContext(EditorShowOutlinesContext);
const canSelect =
- (SELECTION_ENABLED || (ENABLE_OUTLINES_FLAG && editorShowOutlines)) &&
+ (SELECTION_ENABLED || (ENABLE_OUTLINES && editorShowOutlines)) &&
previewServerState.type === 'connected' &&
!window.remotion_isReadOnlyStudio;
const [selectedItems, setSelectedItems] = useState<
diff --git a/packages/studio/src/state/editor-outlines.ts b/packages/studio/src/state/editor-outlines.ts
index 7435446469..465768dfed 100644
--- a/packages/studio/src/state/editor-outlines.ts
+++ b/packages/studio/src/state/editor-outlines.ts
@@ -7,8 +7,6 @@ type State = {
const key = 'remotion.editorShowOutlines';
-export const ENABLE_OUTLINES = true;
-
export const persistEditorShowOutlinesOption = (option: boolean) => {
localStorage.setItem(key, String(option));
};
diff --git a/packages/studio/src/test/timeline-selection.test.ts b/packages/studio/src/test/timeline-selection.test.ts
index edfdabef65..5c2866b352 100644
--- a/packages/studio/src/test/timeline-selection.test.ts
+++ b/packages/studio/src/test/timeline-selection.test.ts
@@ -36,6 +36,7 @@ import {
type PasteEffectsTarget,
} from '../components/Timeline/TimelineClipboardKeybindings';
import {
+ ENABLE_OUTLINES,
getSelectableTimelineSequenceSelections,
getTimelineSelectionAfterInteraction,
getTimelineSelectionFromNodePathInfo,
@@ -54,7 +55,6 @@ import {
} from '../components/Timeline/TimelineSequenceRightEdgeDragHandle';
import type {SequenceNodePathInfo} from '../helpers/get-timeline-sequence-sort-key';
import {
- ENABLE_OUTLINES,
loadEditorShowOutlinesOption,
persistEditorShowOutlinesOption,
} from '../state/editor-outlines';