Skip to content

🎥 Make videos programmatically with React

Add Quick Switcher labels for composition actions

Cursor Agent260486324488
diff --git a/packages/studio/src/components/composition-menu-items.ts b/packages/studio/src/components/composition-menu-items.ts
index fd48fa90a8..33600ff246 100644
--- a/packages/studio/src/components/composition-menu-items.ts
+++ b/packages/studio/src/components/composition-menu-items.ts
@@ -41,7 +41,7 @@ export const getCompositionMenuItems = ({
showNotification((err as Error).message, 2000);
}
},
- quickSwitcherLabel: null,
+ quickSwitcherLabel: `Show composition in ${editorName}`,
subMenu: null,
type: 'item' as const,
value: 'show-in-editor',
@@ -73,7 +73,7 @@ export const getCompositionMenuItems = ({
compositionId: composition.id,
});
},
- quickSwitcherLabel: null,
+ quickSwitcherLabel: 'Rename composition...',
subMenu: null,
type: 'item' as const,
value: 'rename',
@@ -97,7 +97,7 @@ export const getCompositionMenuItems = ({
composition.durationInFrames === 1 ? 'still' : 'composition',
});
},
- quickSwitcherLabel: null,
+ quickSwitcherLabel: 'Duplicate composition...',
subMenu: null,
type: 'item' as const,
value: 'duplicate',
@@ -119,7 +119,7 @@ export const getCompositionMenuItems = ({
compositionId: composition.id,
});
},
- quickSwitcherLabel: null,
+ quickSwitcherLabel: 'Delete composition...',
subMenu: null,
type: 'item' as const,
value: 'delete',
@@ -152,7 +152,7 @@ export const getCompositionMenuItems = ({
);
});
},
- quickSwitcherLabel: null,
+ quickSwitcherLabel: 'Copy composition ID',
subMenu: null,
type: 'item' as const,
value: 'copy-id',
diff --git a/packages/studio/src/helpers/use-menu-structure.tsx b/packages/studio/src/helpers/use-menu-structure.tsx
index 717299b641..b79ad125fc 100644
--- a/packages/studio/src/helpers/use-menu-structure.tsx
+++ b/packages/studio/src/helpers/use-menu-structure.tsx
@@ -996,6 +996,10 @@ const itemToSearchResult = (
setSelectedModal: (value: React.SetStateAction<ModalState | null>) => void,
prefixes: string[],
): TQuickSwitcherResult[] => {
+ if (item.disabled) {
+ return [];
+ }
+
if (item.subMenu) {
return item.subMenu.items
.map((subItem) => {