Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Make Quick Switcher search separator-insensitive (#10621)

Igor Samokhovets987375a76a07
diff --git a/packages/example/e2e/studio.test.mts b/packages/example/e2e/studio.test.mts
index 343b4ab678..165c56fc00 100644
--- a/packages/example/e2e/studio.test.mts
+++ b/packages/example/e2e/studio.test.mts
@@ -522,11 +522,18 @@ test.describe('visual mode', () => {
).toHaveText('100', {timeout: 15_000});
});
- test('should show the composition list', async ({page}) => {
+ test('should show and search the composition list', async ({page}) => {
await page.goto(STUDIO_URL);
await expect(page.getByRole('button', {name: 'Schema'})).toBeVisible({
timeout: 15_000,
});
+
+ await page.keyboard.press('ControlOrMeta+k');
+ await page
+ .getByPlaceholder('Search compositions...')
+ .fill('timeline virtualization');
+ await page.keyboard.press('Enter');
+ await expect(page).toHaveURL(/timeline-virtualization-testbed/);
});
test('should play when a composition in the sidebar is focused', async ({
diff --git a/packages/studio/src/components/QuickSwitcher/fuzzy-search.ts b/packages/studio/src/components/QuickSwitcher/fuzzy-search.ts
index f862bfc86b..67199705c0 100644
--- a/packages/studio/src/components/QuickSwitcher/fuzzy-search.ts
+++ b/packages/studio/src/components/QuickSwitcher/fuzzy-search.ts
@@ -4,7 +4,7 @@ export function fuzzySearch(
query: string,
dataset: TQuickSwitcherResult[],
): TQuickSwitcherResult[] {
- const q = query ? query.trim().toLowerCase() : '';
+ const q = query.trim().toLowerCase().replace(/[\s-]/g, '');
const matchingIndices: number[] = [];
if (q.length === 0) {