refactor: migrate keybindings to DDD structure (#8369)

## Summary

Migrate keybindings domain to `src/platform/keybindings/` following DDD
principles.

## Changes

- **What**: Consolidate keybinding-related code (types, store, service,
defaults, reserved keys) into a single domain module with flat structure
- Extracted `KeyComboImpl` and `KeybindingImpl` classes into separate
files
- Updated all consumers to import from new location
- Colocated tests with source files
- Updated stores/README.md and services/README.md to remove migrated
entries

## Review Focus

- Verify all import paths were updated correctly
- Check that the flat structure is appropriate (vs nested core/data/ui
layers)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8369-refactor-migrate-keybindings-to-DDD-structure-2f66d73d36508120b169dc737075fb45)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Subagent 5 <subagent@example.com>
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Christian Byrne
2026-01-29 18:40:58 -08:00
committed by GitHub
parent 13311a46ea
commit 47113b117e
25 changed files with 328 additions and 449 deletions

View File

@@ -0,0 +1,198 @@
import type { Keybinding } from './types'
export const CORE_KEYBINDINGS: Keybinding[] = [
{
combo: {
ctrl: true,
key: 'Enter'
},
commandId: 'Comfy.QueuePrompt'
},
{
combo: {
ctrl: true,
shift: true,
key: 'Enter'
},
commandId: 'Comfy.QueuePromptFront'
},
{
combo: {
ctrl: true,
alt: true,
key: 'Enter'
},
commandId: 'Comfy.Interrupt'
},
{
combo: {
key: 'r'
},
commandId: 'Comfy.RefreshNodeDefinitions'
},
{
combo: {
key: 'w'
},
commandId: 'Workspace.ToggleSidebarTab.workflows'
},
{
combo: {
key: 'n'
},
commandId: 'Workspace.ToggleSidebarTab.node-library'
},
{
combo: {
key: 'm'
},
commandId: 'Workspace.ToggleSidebarTab.model-library'
},
{
combo: {
key: 's',
ctrl: true
},
commandId: 'Comfy.SaveWorkflow'
},
{
combo: {
key: 'o',
ctrl: true
},
commandId: 'Comfy.OpenWorkflow'
},
{
combo: {
key: 'g',
ctrl: true
},
commandId: 'Comfy.Graph.GroupSelectedNodes'
},
{
combo: {
key: ',',
ctrl: true
},
commandId: 'Comfy.ShowSettingsDialog'
},
{
combo: {
key: '=',
alt: true
},
commandId: 'Comfy.Canvas.ZoomIn',
targetElementId: 'graph-canvas'
},
{
combo: {
key: '+',
alt: true,
shift: true
},
commandId: 'Comfy.Canvas.ZoomIn',
targetElementId: 'graph-canvas'
},
{
combo: {
key: '+',
alt: true
},
commandId: 'Comfy.Canvas.ZoomIn',
targetElementId: 'graph-canvas'
},
{
combo: {
key: '-',
alt: true
},
commandId: 'Comfy.Canvas.ZoomOut',
targetElementId: 'graph-canvas'
},
{
combo: {
key: '.'
},
commandId: 'Comfy.Canvas.FitView',
targetElementId: 'graph-canvas-container'
},
{
combo: {
key: 'p'
},
commandId: 'Comfy.Canvas.ToggleSelected.Pin',
targetElementId: 'graph-canvas-container'
},
{
combo: {
key: 'c',
alt: true
},
commandId: 'Comfy.Canvas.ToggleSelectedNodes.Collapse',
targetElementId: 'graph-canvas-container'
},
{
combo: {
key: 'b',
ctrl: true
},
commandId: 'Comfy.Canvas.ToggleSelectedNodes.Bypass',
targetElementId: 'graph-canvas-container'
},
{
combo: {
key: 'm',
ctrl: true
},
commandId: 'Comfy.Canvas.ToggleSelectedNodes.Mute',
targetElementId: 'graph-canvas-container'
},
{
combo: {
key: '`',
ctrl: true
},
commandId: 'Workspace.ToggleBottomPanelTab.logs-terminal'
},
{
combo: {
key: 'e',
ctrl: true,
shift: true
},
commandId: 'Comfy.Graph.ConvertToSubgraph'
},
{
combo: {
key: 'm',
alt: true
},
commandId: 'Comfy.Canvas.ToggleMinimap'
},
{
combo: {
ctrl: true,
shift: true,
key: 'k'
},
commandId: 'Workspace.ToggleBottomPanel.Shortcuts'
},
{
combo: {
key: 'v'
},
commandId: 'Comfy.Canvas.Unlock'
},
{
combo: {
key: 'h'
},
commandId: 'Comfy.Canvas.Lock'
},
{
combo: {
key: 'Escape'
},
commandId: 'Comfy.Graph.ExitSubgraph'
}
]