Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Restore Ctrl+Shift+Z redo shortcut

JonnyBurger3c4aac4a5b0f
diff --git a/packages/docs/docs/studio/shortcuts.mdx b/packages/docs/docs/studio/shortcuts.mdx
index 967ce0e8b3..24e47dde9f 100644
--- a/packages/docs/docs/studio/shortcuts.mdx
+++ b/packages/docs/docs/studio/shortcuts.mdx
@@ -38,7 +38,7 @@ You can also press <kbd>?</kbd> to open this tab.
| `zoomOut` | `-` | Zoom out of the preview |
| `resetZoom` | `0` | Reset the preview zoom |
| `undo` | `Cmd/Ctrl+Z` | Undo the last props edit |
-| `redo` | `Cmd+Shift+Z` on macOS, `Ctrl+Y` otherwise | Redo the last props edit |
+| `redo` | `Cmd/Ctrl+Shift+Z`; `Ctrl+Y` outside macOS | Redo the last props edit |
| `selectAllSequenceRows` | `Cmd/Ctrl+A` | Select all sequence rows |
| `selectTranslateProp` | `P` | Select the `style.translate` property |
| `selectOpacityProp` | `T` | Select the `style.opacity` property |
diff --git a/packages/studio/src/components/keyboard-shortcuts.ts b/packages/studio/src/components/keyboard-shortcuts.ts
index 6e36870b68..6a23d4c2b7 100644
--- a/packages/studio/src/components/keyboard-shortcuts.ts
+++ b/packages/studio/src/components/keyboard-shortcuts.ts
@@ -61,9 +61,8 @@ export const defaultKeyboardShortcuts: Record<
resetZoom: [{key: '0'}],
undo: [{key: 'z', commandOrControl: true}],
redo: [
- isMac
- ? {key: 'z', commandOrControl: true, shift: true}
- : {key: 'y', commandOrControl: true},
+ ...(isMac ? [] : [{key: 'y', commandOrControl: true}]),
+ {key: 'z', commandOrControl: true, shift: true},
],
selectAllSequenceRows: [{key: 'a', commandOrControl: true}],
selectTranslateProp: [{key: 'p'}],
diff --git a/packages/studio/src/test/keyboard-shortcuts.test.ts b/packages/studio/src/test/keyboard-shortcuts.test.ts
index 2ac217257c..c5eb9d02f3 100644
--- a/packages/studio/src/test/keyboard-shortcuts.test.ts
+++ b/packages/studio/src/test/keyboard-shortcuts.test.ts
@@ -1,5 +1,6 @@
import {expect, test} from 'bun:test';
import {
+ defaultKeyboardShortcuts,
formatKeyboardShortcut,
formatKeyboardShortcutForAria,
keyboardEventMatchesShortcut,
@@ -16,6 +17,17 @@ const event = (overrides: Partial<KeyboardEvent>): KeyboardEvent =>
...overrides,
}) as KeyboardEvent;
+test('includes the platform redo shortcuts', () => {
+ expect(defaultKeyboardShortcuts.redo).toEqual(
+ isMac
+ ? [{key: 'z', commandOrControl: true, shift: true}]
+ : [
+ {key: 'y', commandOrControl: true},
+ {key: 'z', commandOrControl: true, shift: true},
+ ],
+ );
+});
+
test('matches all shortcut modifiers exactly', () => {
expect(
keyboardEventMatchesShortcut({