Replace hotkey scopes by focus stack (Part 6 - Remove Hotkey scopes 🫳🎤) (#13127)
# Replace hotkey scopes by focus stack (Part 6 - Remove Hotkey scopes) This PR is the last part of a refactoring aiming to deprecate the hotkey scopes api in favor of the new focus stack api which is more robust. Part 1: https://github.com/twentyhq/twenty/pull/12673 Part 2: https://github.com/twentyhq/twenty/pull/12798 Part 3: https://github.com/twentyhq/twenty/pull/12910 Part 4: https://github.com/twentyhq/twenty/pull/12933 Part 5: https://github.com/twentyhq/twenty/pull/13106 In this part, we completely remove the hotkey scopes.
This commit is contained in:
@@ -11,7 +11,6 @@ import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useLis
|
||||
import { useRef } from 'react';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
import { Button } from 'twenty-ui/input';
|
||||
import { DialogHotkeyScope } from '../types/DialogHotkeyScope';
|
||||
|
||||
const StyledDialogOverlay = styled(motion.div)`
|
||||
align-items: center;
|
||||
@@ -116,7 +115,6 @@ export const Dialog = ({
|
||||
keys: [Key.Enter],
|
||||
callback: handleEnter,
|
||||
focusId: DIALOG_FOCUS_ID,
|
||||
scope: DialogHotkeyScope.Dialog,
|
||||
dependencies: [buttons],
|
||||
});
|
||||
|
||||
@@ -124,7 +122,6 @@ export const Dialog = ({
|
||||
keys: [Key.Escape],
|
||||
callback: handleEscape,
|
||||
focusId: DIALOG_FOCUS_ID,
|
||||
scope: DialogHotkeyScope.Dialog,
|
||||
dependencies: [handleEscape],
|
||||
});
|
||||
|
||||
|
||||
-6
@@ -1,8 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { DIALOG_FOCUS_ID } from '@/ui/feedback/dialog-manager/constants/DialogFocusId';
|
||||
import { DIALOG_MANAGER_HOTKEY_SCOPE_MEMOIZE_KEY } from '@/ui/feedback/dialog-manager/constants/DialogManagerHotkeyScopeMemoizeKey';
|
||||
import { DialogHotkeyScope } from '@/ui/feedback/dialog-manager/types/DialogHotkeyScope';
|
||||
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
|
||||
import { FocusComponentType } from '@/ui/utilities/focus/types/FocusComponentType';
|
||||
import { useDialogManagerScopedStates } from '../hooks/internal/useDialogManagerScopedStates';
|
||||
@@ -23,10 +21,6 @@ export const DialogManagerEffect = () => {
|
||||
type: FocusComponentType.DIALOG,
|
||||
instanceId: DIALOG_FOCUS_ID,
|
||||
},
|
||||
hotkeyScope: {
|
||||
scope: DialogHotkeyScope.Dialog,
|
||||
},
|
||||
memoizeKey: DIALOG_MANAGER_HOTKEY_SCOPE_MEMOIZE_KEY,
|
||||
});
|
||||
}, [dialogInternal.queue, pushFocusItemToFocusStack]);
|
||||
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
export enum DialogHotkeyScope {
|
||||
Dialog = 'dialog',
|
||||
}
|
||||
Reference in New Issue
Block a user