feat: add ctrl+shift+z alternative shortcut for redoing actions (#5536)

* Added alternative for redo

* Added redo alternative on hotkeys

* added redo alternative type

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This commit is contained in:
Lucas Oliveira 2025-01-08 13:03:46 -03:00 committed by GitHub
commit 723a31051e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 0 deletions

View file

@ -831,6 +831,11 @@ export const defaultShortcuts = [
name: "Redo",
shortcut: "mod+y",
},
{
display_name: "Redo (alternative)",
name: "Redo Alt",
shortcut: "mod+shift+z",
},
{
display_name: "Group",
name: "Group",

View file

@ -290,6 +290,7 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
const undoAction = useShortcutsStore((state) => state.undo);
const redoAction = useShortcutsStore((state) => state.redo);
const redoAltAction = useShortcutsStore((state) => state.redoAlt);
const copyAction = useShortcutsStore((state) => state.copy);
const duplicate = useShortcutsStore((state) => state.duplicate);
const deleteAction = useShortcutsStore((state) => state.delete);
@ -301,6 +302,8 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
//@ts-ignore
useHotkeys(redoAction, handleRedo);
//@ts-ignore
useHotkeys(redoAltAction, handleRedo);
//@ts-ignore
useHotkeys(groupAction, handleGroup);
//@ts-ignore
useHotkeys(duplicate, handleDuplicate);

View file

@ -13,6 +13,7 @@ export const useShortcutsStore = create<shortcutsStoreType>((set, get) => ({
flow: "mod+shift+b",
undo: "mod+z",
redo: "mod+y",
redoAlt: "mod+shift+z",
openPlayground: "mod+k",
advancedSettings: "mod+shift+a",
minimize: "mod+.",

View file

@ -31,6 +31,7 @@ export type shortcutsStoreType = {
openPlayground: string;
undo: string;
redo: string;
redoAlt: string;
advancedSettings: string;
minimize: string;
code: string;