Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Show arrow on Browse Elements action (#10618)

Jonny Burgera5665de906b1
diff --git a/packages/example/e2e/studio-protocol.test.mts b/packages/example/e2e/studio-protocol.test.mts
index 1b41e24f69..4595f55c12 100644
--- a/packages/example/e2e/studio-protocol.test.mts
+++ b/packages/example/e2e/studio-protocol.test.mts
@@ -202,7 +202,7 @@ export const MyComponent = () => {
await studioPage.locator('[data-sidebar-toggle="right"]').click();
const browseElements = studioPage.getByRole('button', {
- name: 'Browse Elements...',
+ name: 'Browse Elements',
});
await expect(browseElements).toBeVisible();
const senderPagePromise = context.waitForEvent('page', {timeout: 10_000});
diff --git a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
index d11596ac32..ee65601db3 100644
--- a/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
+++ b/packages/studio/src/components/InspectorPanel/CompositionInspector.tsx
@@ -7,6 +7,7 @@ import React, {
} from 'react';
import type {_InternalTypes} from 'remotion';
import {StudioServerConnectionCtx} from '../../helpers/client-id';
+import {CURRENT_COLOR} from '../../helpers/colors';
import {isStudioInteractivityEnabled} from '../../helpers/interactivity-enabled';
import {BrowseElementsIcon} from '../../icons/browse-elements';
import {PicIcon} from '../../icons/frame';
@@ -68,6 +69,14 @@ const browseElementsIconContainerStyle: React.CSSProperties = {
width: 22,
};
+const browseElementsArrowStyle: React.CSSProperties = {
+ display: 'inline-block',
+ height: 12,
+ marginLeft: 4,
+ verticalAlign: -2,
+ width: 12,
+};
+
const CompositionActions: React.FC<{
readonly readOnlyStudio: boolean;
}> = ({readOnlyStudio}) => {
@@ -143,7 +152,21 @@ const CompositionActions: React.FC<{
)}
title="Open the Remotion Elements library in a new tab. Install an Element there to send it to this composition."
>
- Browse Elements...
+ Browse Elements
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 16 16"
+ style={browseElementsArrowStyle}
+ >
+ <path
+ d="M4 12 12 4M6 4h6v6"
+ fill="none"
+ stroke={CURRENT_COLOR}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </svg>
</InspectorQuickAction>
) : null}
</InspectorQuickActionsSection>