From b2766509e3565bc97c1514ecf35963c14e0973b3 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Sun, 26 Oct 2025 12:10:41 -0700 Subject: [PATCH] Hotkey for creating environment when dialog open --- src-web/components/EnvironmentEditDialog.tsx | 2 ++ src-web/components/core/Button.tsx | 12 +++++++++--- src-web/hooks/useHotKey.ts | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src-web/components/EnvironmentEditDialog.tsx b/src-web/components/EnvironmentEditDialog.tsx index 5362d53f..8797b9b2 100644 --- a/src-web/components/EnvironmentEditDialog.tsx +++ b/src-web/components/EnvironmentEditDialog.tsx @@ -98,6 +98,8 @@ export const EnvironmentEditDialog = function ({ initialEnvironment }: Props) { , 'color' | 'onC leftSlot?: ReactNode; rightSlot?: ReactNode; hotkeyAction?: HotkeyAction; + hotkeyPriority?: number; }; export const Button = forwardRef(function Button( @@ -39,6 +40,7 @@ export const Button = forwardRef(function Button rightSlot, disabled, hotkeyAction, + hotkeyPriority, title, onClick, ...props @@ -94,9 +96,13 @@ export const Button = forwardRef(function Button () => buttonRef.current, ); - useHotKey(hotkeyAction ?? null, () => { - buttonRef.current?.click(); - }); + useHotKey( + hotkeyAction ?? null, + () => { + buttonRef.current?.click(); + }, + { priority: hotkeyPriority }, + ); return (