Move keybinds to coreKeybindings (#1078)

* Refactor core keybinds

* Prevent default

* Add playwright test
This commit is contained in:
Chenlei Hu
2024-10-03 11:25:53 -04:00
committed by GitHub
parent 65cad74eba
commit 142882a8ff
9 changed files with 259 additions and 97 deletions

View File

@@ -5,10 +5,7 @@ import { ComfySettingsDialog } from './ui/settings'
import { ComfyApp, app } from './app'
import { TaskItem } from '@/types/apiTypes'
import { showSettingsDialog } from '@/services/dialogService'
import { useToastStore } from '@/stores/toastStore'
import { LGraphGroup } from '@comfyorg/litegraph'
import { useSettingStore } from '@/stores/settingStore'
import { useTitleEditorStore } from '@/stores/graphStore'
export const ComfyDialog = _ComfyDialog
@@ -695,32 +692,6 @@ export class ComfyUI {
onclick: async () => {
app.resetView()
}
}),
$el('button', {
id: 'comfy-group-selected-nodes-button',
textContent: 'Group',
hidden: true,
onclick: () => {
if (
!app.canvas.selected_nodes ||
Object.keys(app.canvas.selected_nodes).length === 0
) {
useToastStore().add({
severity: 'error',
summary: 'No nodes selected',
detail: 'Please select nodes to group',
life: 3000
})
return
}
const group = new LGraphGroup()
const padding = useSettingStore().get(
'Comfy.GroupSelectedNodes.Padding'
)
group.addNodes(Object.values(app.canvas.selected_nodes), padding)
app.canvas.graph.add(group)
useTitleEditorStore().titleEditorTarget = group
}
})
]) as HTMLDivElement