🎥 Make videos programmatically with React
@remotion/studio: Match typeahead on label only (drop value fallback)
Jonny Burger53fcc6ea8391
diff --git a/packages/studio/src/components/NewComposition/menu-typeahead.ts b/packages/studio/src/components/NewComposition/menu-typeahead.tsindex e4a0d808e6..552847738d 100644--- a/packages/studio/src/components/NewComposition/menu-typeahead.ts+++ b/packages/studio/src/components/NewComposition/menu-typeahead.ts@@ -9,10 +9,6 @@ const getLabelToMatch = (value: ComboboxValue): string | null => {return value.label;}- if (typeof value.value === 'string') {- return value.value;- }-return null;};diff --git a/packages/studio/src/test/menu-typeahead.test.ts b/packages/studio/src/test/menu-typeahead.test.tsindex e53cb39dc4..0db05a809c 100644--- a/packages/studio/src/test/menu-typeahead.test.ts+++ b/packages/studio/src/test/menu-typeahead.test.ts@@ -41,6 +41,17 @@ const values: ComboboxValue[] = [subMenu: null,quickSwitcherLabel: 'Custom Label',},+ {+ type: 'item',+ id: 'label-vs-value',+ label: 'VisibleText',+ value: 'DifferentValue',+ onClick: () => undefined,+ keyHint: null,+ leftItem: null,+ subMenu: null,+ quickSwitcherLabel: null,+ },];test('finds item by label prefix', () => {@@ -60,6 +71,11 @@ test('matches visible label when quickSwitcherLabel differs', () => {expect(findTypeaheadMenuItem({query: 'not', values})).toBe('custom');});+test('does not match on value when label is a different string', () => {+ expect(findTypeaheadMenuItem({query: 'diff', values})).toBe(null);+ expect(findTypeaheadMenuItem({query: 'vis', values})).toBe('label-vs-value');+});+test('returns null for empty or unmatched query', () => {expect(findTypeaheadMenuItem({query: ' ', values})).toBe(null);expect(findTypeaheadMenuItem({query: 'zzz', values})).toBe(null);