From b4ef346d25c78e63e8fb0018677ebbe337d78c7d Mon Sep 17 00:00:00 2001 From: Eric Tuvesson Date: Mon, 18 Nov 2024 17:50:41 +0100 Subject: [PATCH] chore: Combine search keybinding definitions --- .../src/editor/src/pages/EditorPage/EditorPage.tsx | 3 ++- .../src/editor/src/views/panels/search-panel/search-panel.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/noodl-editor/src/editor/src/pages/EditorPage/EditorPage.tsx b/packages/noodl-editor/src/editor/src/pages/EditorPage/EditorPage.tsx index 68e6807..ac78d92 100644 --- a/packages/noodl-editor/src/editor/src/pages/EditorPage/EditorPage.tsx +++ b/packages/noodl-editor/src/editor/src/pages/EditorPage/EditorPage.tsx @@ -8,6 +8,7 @@ import { ipcRenderer } from 'electron'; import React, { useEffect, useState } from 'react'; import { platform } from '@noodl/platform'; +import { Keybindings } from '@noodl-constants/Keybindings'; import { App } from '@noodl-models/app'; import { AppRegistry } from '@noodl-models/app_registry'; import { CloudService } from '@noodl-models/CloudServices'; @@ -156,7 +157,7 @@ export function EditorPage({ route }: EditorPageProps) { useKeyboardCommands(() => [ { handler: () => SidebarModel.instance.switch('search'), - keybinding: KeyMod.CtrlCmd | KeyCode.KEY_F + keybinding: Keybindings.SEARCH.hash }, { handler: () => EventDispatcher.instance.emit('viewer-open-devtools'), diff --git a/packages/noodl-editor/src/editor/src/views/panels/search-panel/search-panel.tsx b/packages/noodl-editor/src/editor/src/views/panels/search-panel/search-panel.tsx index e9d3298..d6b9825 100644 --- a/packages/noodl-editor/src/editor/src/views/panels/search-panel/search-panel.tsx +++ b/packages/noodl-editor/src/editor/src/views/panels/search-panel/search-panel.tsx @@ -5,9 +5,9 @@ import { useSidePanelKeyboardCommands } from '@noodl-hooks/useKeyboardCommands'; import classNames from 'classnames'; import React, { useEffect, useRef, useState } from 'react'; +import { Keybindings } from '@noodl-constants/Keybindings'; import { ComponentModel } from '@noodl-models/componentmodel'; import { NodeGraphNode } from '@noodl-models/nodegraphmodel'; -import { KeyCode, KeyMod } from '@noodl-utils/keyboard/KeyCode'; import { performSearch } from '@noodl-utils/universal-search'; import { SearchInput } from '@noodl-core-ui/components/inputs/SearchInput'; @@ -40,7 +40,7 @@ export function SearchPanel() { inputRef.current.focus(); inputRef.current.select(); }, - keybinding: KeyMod.CtrlCmd | KeyCode.KEY_F + keybinding: Keybindings.SEARCH.hash } ], 'search'