chore: Combine search keybinding definitions

This commit is contained in:
Eric Tuvesson
2024-11-18 17:50:41 +01:00
parent 6205d08451
commit b4ef346d25
2 changed files with 4 additions and 3 deletions

View File

@@ -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'),

View File

@@ -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'