From 42ffdb21412945e383797ed5da2f4e4f96fbd002 Mon Sep 17 00:00:00 2001 From: bymyself Date: Tue, 23 Sep 2025 22:18:34 -0700 Subject: [PATCH] refactor keybinding files --- docs/DDD_KEYBINDING_REFACTORING.md | 134 ++++++++++++++++++ .../keybinding}/reservedKeyCombos.ts | 0 src/components/sidebar/SideToolbar.vue | 2 +- .../keybinding}/constants/coreKeybindings.ts | 2 +- .../keybinding/types/keybinding.ts} | 0 .../settings/composables/useSettingUI.ts | 2 +- .../settings/constants/coreSettings.ts | 2 +- src/schemas/apiSchema.ts | 2 +- src/scripts/app.ts | 5 +- src/services/extensionService.ts | 5 +- src/stores/commandStore.ts | 6 +- src/stores/workspace/bottomPanelStore.ts | 2 +- src/types/comfy.ts | 2 +- src/views/GraphView.vue | 2 +- .../components}/KeyComboDisplay.vue | 2 +- .../components}/KeybindingPanel.vue | 10 +- .../components/shortcuts/EssentialsPanel.vue | 33 +++++ .../components/shortcuts/ShortcutsList.vue | 120 ++++++++++++++++ .../shortcuts/ViewControlsPanel.vue | 0 .../composables}/useShortcutsTab.ts | 4 +- .../services/keybindingService.ts | 4 +- .../keybindings}/stores/keybindingStore.ts | 7 +- .../services/keybindingService.escape.test.ts | 6 +- .../keybindingService.forwarding.test.ts | 2 +- tests-ui/tests/store/keybindingStore.test.ts | 5 +- 25 files changed, 330 insertions(+), 29 deletions(-) create mode 100644 docs/DDD_KEYBINDING_REFACTORING.md rename src/{constants => base/keybinding}/reservedKeyCombos.ts (100%) rename src/{ => platform/keybinding}/constants/coreKeybindings.ts (97%) rename src/{schemas/keyBindingSchema.ts => platform/keybinding/types/keybinding.ts} (100%) rename src/{components/dialog/content/setting/keybinding => workbench/keybindings/components}/KeyComboDisplay.vue (87%) rename src/{components/dialog/content/setting => workbench/keybindings/components}/KeybindingPanel.vue (96%) create mode 100644 src/workbench/keybindings/components/shortcuts/EssentialsPanel.vue create mode 100644 src/workbench/keybindings/components/shortcuts/ShortcutsList.vue rename src/{components/bottomPanel/tabs => workbench/keybindings/components}/shortcuts/ViewControlsPanel.vue (100%) rename src/{composables/bottomPanelTabs => workbench/keybindings/composables}/useShortcutsTab.ts (81%) rename src/{ => workbench/keybindings}/services/keybindingService.ts (97%) rename src/{ => workbench/keybindings}/stores/keybindingStore.ts (98%) diff --git a/docs/DDD_KEYBINDING_REFACTORING.md b/docs/DDD_KEYBINDING_REFACTORING.md new file mode 100644 index 000000000..016b79af9 --- /dev/null +++ b/docs/DDD_KEYBINDING_REFACTORING.md @@ -0,0 +1,134 @@ +# Keybinding Domain DDD Refactoring + +## Overview + +This document outlines the refactoring of ComfyUI's keybinding functionality from technical layers to domain-driven design (DDD) following VSCode's proven three-layer architecture. + +## Architecture + +### Three-Layer Design + +Following VSCode's enterprise-grade architecture: + +1. **Base Layer** - Foundational utilities (no dependencies) +2. **Platform Layer** - Core abstractions (reusable across frontends) +3. **Workbench Layer** - UI-specific implementation + +### Final Structure + +``` +src/ +├── base/keybinding/ # Base Layer +│ └── reservedKeyCombos.ts # Reserved key combinations +│ +├── platform/keybinding/ # Platform Layer +│ ├── constants/ +│ │ └── coreKeybindings.ts # Core keybinding definitions +│ └── types/ +│ └── keybinding.ts # Schema types and interfaces +│ +└── workbench/keybindings/ # Workbench Layer + ├── components/ # UI Components + │ ├── KeybindingPanel.vue # Settings panel + │ ├── KeyComboDisplay.vue # Key display component + │ └── shortcuts/ # Shortcuts panel + │ ├── EssentialsPanel.vue + │ ├── ShortcutsList.vue + │ └── ViewControlsPanel.vue + ├── composables/ + │ └── useShortcutsTab.ts # UI logic + ├── services/ + │ └── keybindingService.ts # Service implementation + └── stores/ + └── keybindingStore.ts # State management +``` + +## Migration Summary + +### Before (Technical Layers) +- `services/keybindingService.ts` +- `stores/keybindingStore.ts` +- `constants/coreKeybindings.ts` +- `schemas/keyBindingSchema.ts` +- `components/dialog/content/setting/KeybindingPanel.vue` +- `components/bottomPanel/tabs/shortcuts/` +- `composables/bottomPanelTabs/useShortcutsTab.ts` + +### After (Domain-Driven) +All keybinding functionality organized by architectural layer and domain responsibility. + +## Key Import Paths + +```typescript +// Platform types and constants +import type { Keybinding, KeyCombo } from '@/platform/keybinding/types/keybinding' +import { CORE_KEYBINDINGS } from '@/platform/keybinding/constants/coreKeybindings' + +// Base utilities +import { RESERVED_BY_TEXT_INPUT } from '@/base/keybinding/reservedKeyCombos' + +// Workbench services +import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService' +import { + KeyComboImpl, + KeybindingImpl, + useKeybindingStore +} from '@/workbench/keybindings/stores/keybindingStore' + +// UI components +import KeybindingPanel from '@/workbench/keybindings/components/KeybindingPanel.vue' +import { useShortcutsTab } from '@/workbench/keybindings/composables/useShortcutsTab' +``` + +## Benefits + +### 1. Clear Architectural Boundaries +- **Base**: Reusable across any JavaScript environment +- **Platform**: Reusable across any UI framework +- **Workbench**: Vue/PrimeVue specific implementation + +### 2. Frontend Flexibility +The base + platform layers enable building alternative frontends (React, Angular, etc.) while reusing core keybinding logic. + +### 3. VSCode Alignment +Follows the same proven patterns used by one of the most successful code editors, ensuring scalability and maintainability. + +### 4. Domain Cohesion +All keybinding-related functionality is now located together, making it easier to: +- Find related code +- Make changes across the domain +- Test domain functionality +- Understand feature scope + +### 5. Dependency Management +Clear dependency flow: `base/` ← `platform/` ← `workbench/` + +## Migration Process + +1. ✅ **Analysis**: Identified all keybinding-related files +2. ✅ **Structure Creation**: Built three-layer directory structure +3. ✅ **File Migration**: Moved files to appropriate layers +4. ✅ **Import Updates**: Updated all import paths using `@` aliases +5. ✅ **Testing**: Verified TypeScript compilation and linting +6. ✅ **Cleanup**: Removed old files and empty directories + +## Quality Assurance + +- **TypeScript**: `pnpm typecheck` passes +- **Code Quality**: `pnpm lint --fix` applied +- **Testing**: All test imports updated +- **No Breaking Changes**: All functionality preserved + +## Future Considerations + +### Potential Enhancements +- Add platform-level abstractions as needed +- Create additional keybinding editor components +- Consider splitting large components into smaller, focused ones + +### Extension Points +- New UI components can be added to `workbench/keybindings/components/` +- Platform-level services can be extended in `platform/keybinding/` +- Base utilities can be enhanced in `base/keybinding/` + +This refactoring establishes a solid foundation for future keybinding feature development while maintaining backward compatibility and improving code organization. \ No newline at end of file diff --git a/src/constants/reservedKeyCombos.ts b/src/base/keybinding/reservedKeyCombos.ts similarity index 100% rename from src/constants/reservedKeyCombos.ts rename to src/base/keybinding/reservedKeyCombos.ts diff --git a/src/components/sidebar/SideToolbar.vue b/src/components/sidebar/SideToolbar.vue index 288deade8..67886e664 100644 --- a/src/components/sidebar/SideToolbar.vue +++ b/src/components/sidebar/SideToolbar.vue @@ -38,10 +38,10 @@ import ExtensionSlot from '@/components/common/ExtensionSlot.vue' import SidebarBottomPanelToggleButton from '@/components/sidebar/SidebarBottomPanelToggleButton.vue' import SidebarShortcutsToggleButton from '@/components/sidebar/SidebarShortcutsToggleButton.vue' import { useSettingStore } from '@/platform/settings/settingStore' -import { useKeybindingStore } from '@/stores/keybindingStore' import { useUserStore } from '@/stores/userStore' import { useWorkspaceStore } from '@/stores/workspaceStore' import type { SidebarTabExtension } from '@/types/extensionTypes' +import { useKeybindingStore } from '@/workbench/keybindings/stores/keybindingStore' import SidebarHelpCenterIcon from './SidebarHelpCenterIcon.vue' import SidebarIcon from './SidebarIcon.vue' diff --git a/src/constants/coreKeybindings.ts b/src/platform/keybinding/constants/coreKeybindings.ts similarity index 97% rename from src/constants/coreKeybindings.ts rename to src/platform/keybinding/constants/coreKeybindings.ts index fe2bde835..f8aec98e0 100644 --- a/src/constants/coreKeybindings.ts +++ b/src/platform/keybinding/constants/coreKeybindings.ts @@ -1,4 +1,4 @@ -import type { Keybinding } from '@/schemas/keyBindingSchema' +import type { Keybinding } from '@/platform/keybinding/types/keybinding' export const CORE_KEYBINDINGS: Keybinding[] = [ { diff --git a/src/schemas/keyBindingSchema.ts b/src/platform/keybinding/types/keybinding.ts similarity index 100% rename from src/schemas/keyBindingSchema.ts rename to src/platform/keybinding/types/keybinding.ts diff --git a/src/platform/settings/composables/useSettingUI.ts b/src/platform/settings/composables/useSettingUI.ts index 8a01ec1e2..11acde1b0 100644 --- a/src/platform/settings/composables/useSettingUI.ts +++ b/src/platform/settings/composables/useSettingUI.ts @@ -101,7 +101,7 @@ export function useSettingUI( children: [] }, component: defineAsyncComponent( - () => import('@/components/dialog/content/setting/KeybindingPanel.vue') + () => import('@/workbench/keybindings/components/KeybindingPanel.vue') ) } diff --git a/src/platform/settings/constants/coreSettings.ts b/src/platform/settings/constants/coreSettings.ts index 63c4e7c8d..fb6fc1039 100644 --- a/src/platform/settings/constants/coreSettings.ts +++ b/src/platform/settings/constants/coreSettings.ts @@ -1,8 +1,8 @@ import { LinkMarkerShape, LiteGraph } from '@/lib/litegraph/src/litegraph' +import type { Keybinding } from '@/platform/keybinding/types/keybinding' import { useSettingStore } from '@/platform/settings/settingStore' import type { SettingParams } from '@/platform/settings/types' import type { ColorPalettes } from '@/schemas/colorPaletteSchema' -import type { Keybinding } from '@/schemas/keyBindingSchema' import { NodeBadgeMode } from '@/types/nodeSource' import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes' diff --git a/src/schemas/apiSchema.ts b/src/schemas/apiSchema.ts index 007b3e58d..8e67ef88e 100644 --- a/src/schemas/apiSchema.ts +++ b/src/schemas/apiSchema.ts @@ -1,12 +1,12 @@ import { z } from 'zod' import { LinkMarkerShape } from '@/lib/litegraph/src/litegraph' +import { zKeybinding } from '@/platform/keybinding/types/keybinding' import { zComfyWorkflow, zNodeId } from '@/platform/workflow/validation/schemas/workflowSchema' import { colorPalettesSchema } from '@/schemas/colorPaletteSchema' -import { zKeybinding } from '@/schemas/keyBindingSchema' import { NodeBadgeMode } from '@/types/nodeSource' import { LinkReleaseTriggerAction } from '@/types/searchBoxTypes' diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 49423436d..70837aa37 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -53,7 +53,6 @@ import { useExecutionStore } from '@/stores/executionStore' import { useExtensionStore } from '@/stores/extensionStore' import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore' import { useNodeOutputStore } from '@/stores/imagePreviewStore' -import { KeyComboImpl, useKeybindingStore } from '@/stores/keybindingStore' import { useModelStore } from '@/stores/modelStore' import { SYSTEM_NODE_DEFS, useNodeDefStore } from '@/stores/nodeDefStore' import { useSubgraphStore } from '@/stores/subgraphStore' @@ -81,6 +80,10 @@ import { } from '@/utils/migration/migrateReroute' import { getSelectedModelsMetadata } from '@/utils/modelMetadataUtil' import { deserialiseAndCreate } from '@/utils/vintageClipboard' +import { + KeyComboImpl, + useKeybindingStore +} from '@/workbench/keybindings/stores/keybindingStore' import { type ComfyApi, PromptExecutionError, api } from './api' import { defaultGraph } from './defaultGraph' diff --git a/src/services/extensionService.ts b/src/services/extensionService.ts index 26b67fba7..45c777a68 100644 --- a/src/services/extensionService.ts +++ b/src/services/extensionService.ts @@ -5,11 +5,14 @@ import { api } from '@/scripts/api' import { app } from '@/scripts/app' import { useCommandStore } from '@/stores/commandStore' import { useExtensionStore } from '@/stores/extensionStore' -import { KeybindingImpl, useKeybindingStore } from '@/stores/keybindingStore' import { useMenuItemStore } from '@/stores/menuItemStore' import { useWidgetStore } from '@/stores/widgetStore' import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore' import type { ComfyExtension } from '@/types/comfy' +import { + KeybindingImpl, + useKeybindingStore +} from '@/workbench/keybindings/stores/keybindingStore' export const useExtensionService = () => { const extensionStore = useExtensionStore() diff --git a/src/stores/commandStore.ts b/src/stores/commandStore.ts index 7ef99335d..a90121410 100644 --- a/src/stores/commandStore.ts +++ b/src/stores/commandStore.ts @@ -3,8 +3,10 @@ import { computed, ref } from 'vue' import { useErrorHandling } from '@/composables/useErrorHandling' import type { ComfyExtension } from '@/types/comfy' - -import { type KeybindingImpl, useKeybindingStore } from './keybindingStore' +import { + type KeybindingImpl, + useKeybindingStore +} from '@/workbench/keybindings/stores/keybindingStore' export interface ComfyCommand { id: string diff --git a/src/stores/workspace/bottomPanelStore.ts b/src/stores/workspace/bottomPanelStore.ts index 017c2e0b2..30a78d319 100644 --- a/src/stores/workspace/bottomPanelStore.ts +++ b/src/stores/workspace/bottomPanelStore.ts @@ -1,7 +1,6 @@ import { defineStore } from 'pinia' import { computed, ref } from 'vue' -import { useShortcutsTab } from '@/composables/bottomPanelTabs/useShortcutsTab' import { useCommandTerminalTab, useLogsTerminalTab @@ -10,6 +9,7 @@ import { useCommandStore } from '@/stores/commandStore' import type { ComfyExtension } from '@/types/comfy' import type { BottomPanelExtension } from '@/types/extensionTypes' import { isElectron } from '@/utils/envUtil' +import { useShortcutsTab } from '@/workbench/keybindings/composables/useShortcutsTab' type PanelType = 'terminal' | 'shortcuts' diff --git a/src/types/comfy.ts b/src/types/comfy.ts index 0ce8d89dc..1a2752f72 100644 --- a/src/types/comfy.ts +++ b/src/types/comfy.ts @@ -1,8 +1,8 @@ import type { Positionable } from '@/lib/litegraph/src/interfaces' import type { LGraphNode } from '@/lib/litegraph/src/litegraph' +import type { Keybinding } from '@/platform/keybinding/types/keybinding' import type { SettingParams } from '@/platform/settings/types' import type { ComfyWorkflowJSON } from '@/platform/workflow/validation/schemas/workflowSchema' -import type { Keybinding } from '@/schemas/keyBindingSchema' import type { ComfyNodeDef } from '@/schemas/nodeDefSchema' import type { ComfyApp } from '@/scripts/app' import type { ComfyWidgetConstructor } from '@/scripts/widgets' diff --git a/src/views/GraphView.vue b/src/views/GraphView.vue index bbfca6ea0..99a6a11db 100644 --- a/src/views/GraphView.vue +++ b/src/views/GraphView.vue @@ -53,7 +53,6 @@ import type { StatusWsMessageStatus } from '@/schemas/apiSchema' import { api } from '@/scripts/api' import { app } from '@/scripts/app' import { setupAutoQueueHandler } from '@/services/autoQueueService' -import { useKeybindingService } from '@/services/keybindingService' import { useCommandStore } from '@/stores/commandStore' import { useExecutionStore } from '@/stores/executionStore' import { useMenuItemStore } from '@/stores/menuItemStore' @@ -69,6 +68,7 @@ import { useColorPaletteStore } from '@/stores/workspace/colorPaletteStore' import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore' import { useWorkspaceStore } from '@/stores/workspaceStore' import { electronAPI, isElectron } from '@/utils/envUtil' +import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService' setupAutoQueueHandler() useProgressFavicon() diff --git a/src/components/dialog/content/setting/keybinding/KeyComboDisplay.vue b/src/workbench/keybindings/components/KeyComboDisplay.vue similarity index 87% rename from src/components/dialog/content/setting/keybinding/KeyComboDisplay.vue rename to src/workbench/keybindings/components/KeyComboDisplay.vue index ded8cb18b..d991ce847 100644 --- a/src/components/dialog/content/setting/keybinding/KeyComboDisplay.vue +++ b/src/workbench/keybindings/components/KeyComboDisplay.vue @@ -13,7 +13,7 @@ import Tag from 'primevue/tag' import { computed } from 'vue' -import type { KeyComboImpl } from '@/stores/keybindingStore' +import type { KeyComboImpl } from '@/workbench/keybindings/stores/keybindingStore' const { keyCombo, isModified = false } = defineProps<{ keyCombo: KeyComboImpl diff --git a/src/components/dialog/content/setting/KeybindingPanel.vue b/src/workbench/keybindings/components/KeybindingPanel.vue similarity index 96% rename from src/components/dialog/content/setting/KeybindingPanel.vue rename to src/workbench/keybindings/components/KeybindingPanel.vue index dbe61f089..1f3e88313 100644 --- a/src/components/dialog/content/setting/KeybindingPanel.vue +++ b/src/workbench/keybindings/components/KeybindingPanel.vue @@ -142,17 +142,17 @@ import { computed, ref, watchEffect } from 'vue' import { useI18n } from 'vue-i18n' import SearchBox from '@/components/common/SearchBox.vue' -import { useKeybindingService } from '@/services/keybindingService' +import PanelTemplate from '@/components/dialog/content/setting/PanelTemplate.vue' import { useCommandStore } from '@/stores/commandStore' +import { normalizeI18nKey } from '@/utils/formatUtil' +import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService' import { KeyComboImpl, KeybindingImpl, useKeybindingStore -} from '@/stores/keybindingStore' -import { normalizeI18nKey } from '@/utils/formatUtil' +} from '@/workbench/keybindings/stores/keybindingStore' -import PanelTemplate from './PanelTemplate.vue' -import KeyComboDisplay from './keybinding/KeyComboDisplay.vue' +import KeyComboDisplay from './KeyComboDisplay.vue' const filters = ref({ global: { value: '', matchMode: FilterMatchMode.CONTAINS } diff --git a/src/workbench/keybindings/components/shortcuts/EssentialsPanel.vue b/src/workbench/keybindings/components/shortcuts/EssentialsPanel.vue new file mode 100644 index 000000000..459d095ae --- /dev/null +++ b/src/workbench/keybindings/components/shortcuts/EssentialsPanel.vue @@ -0,0 +1,33 @@ + + + diff --git a/src/workbench/keybindings/components/shortcuts/ShortcutsList.vue b/src/workbench/keybindings/components/shortcuts/ShortcutsList.vue new file mode 100644 index 000000000..7bc8cbf25 --- /dev/null +++ b/src/workbench/keybindings/components/shortcuts/ShortcutsList.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/components/bottomPanel/tabs/shortcuts/ViewControlsPanel.vue b/src/workbench/keybindings/components/shortcuts/ViewControlsPanel.vue similarity index 100% rename from src/components/bottomPanel/tabs/shortcuts/ViewControlsPanel.vue rename to src/workbench/keybindings/components/shortcuts/ViewControlsPanel.vue diff --git a/src/composables/bottomPanelTabs/useShortcutsTab.ts b/src/workbench/keybindings/composables/useShortcutsTab.ts similarity index 81% rename from src/composables/bottomPanelTabs/useShortcutsTab.ts rename to src/workbench/keybindings/composables/useShortcutsTab.ts index e15f86fb4..2f2b94782 100644 --- a/src/composables/bottomPanelTabs/useShortcutsTab.ts +++ b/src/workbench/keybindings/composables/useShortcutsTab.ts @@ -1,9 +1,9 @@ import { markRaw } from 'vue' import { useI18n } from 'vue-i18n' -import EssentialsPanel from '@/components/bottomPanel/tabs/shortcuts/EssentialsPanel.vue' -import ViewControlsPanel from '@/components/bottomPanel/tabs/shortcuts/ViewControlsPanel.vue' import type { BottomPanelExtension } from '@/types/extensionTypes' +import EssentialsPanel from '@/workbench/keybindings/components/shortcuts/EssentialsPanel.vue' +import ViewControlsPanel from '@/workbench/keybindings/components/shortcuts/ViewControlsPanel.vue' export const useShortcutsTab = (): BottomPanelExtension[] => { const { t } = useI18n() diff --git a/src/services/keybindingService.ts b/src/workbench/keybindings/services/keybindingService.ts similarity index 97% rename from src/services/keybindingService.ts rename to src/workbench/keybindings/services/keybindingService.ts index ed5049246..e440f6433 100644 --- a/src/services/keybindingService.ts +++ b/src/workbench/keybindings/services/keybindingService.ts @@ -1,4 +1,4 @@ -import { CORE_KEYBINDINGS } from '@/constants/coreKeybindings' +import { CORE_KEYBINDINGS } from '@/platform/keybinding/constants/coreKeybindings' import { useSettingStore } from '@/platform/settings/settingStore' import { app } from '@/scripts/app' import { useCommandStore } from '@/stores/commandStore' @@ -7,7 +7,7 @@ import { KeyComboImpl, KeybindingImpl, useKeybindingStore -} from '@/stores/keybindingStore' +} from '@/workbench/keybindings/stores/keybindingStore' export const useKeybindingService = () => { const keybindingStore = useKeybindingStore() diff --git a/src/stores/keybindingStore.ts b/src/workbench/keybindings/stores/keybindingStore.ts similarity index 98% rename from src/stores/keybindingStore.ts rename to src/workbench/keybindings/stores/keybindingStore.ts index 76a21120c..9ed01a288 100644 --- a/src/stores/keybindingStore.ts +++ b/src/workbench/keybindings/stores/keybindingStore.ts @@ -3,8 +3,11 @@ import { defineStore } from 'pinia' import type { Ref } from 'vue' import { computed, ref, toRaw } from 'vue' -import { RESERVED_BY_TEXT_INPUT } from '@/constants/reservedKeyCombos' -import type { KeyCombo, Keybinding } from '@/schemas/keyBindingSchema' +import { RESERVED_BY_TEXT_INPUT } from '@/base/keybinding/reservedKeyCombos' +import type { + KeyCombo, + Keybinding +} from '@/platform/keybinding/types/keybinding' export class KeybindingImpl implements Keybinding { commandId: string diff --git a/tests-ui/tests/services/keybindingService.escape.test.ts b/tests-ui/tests/services/keybindingService.escape.test.ts index 20b608e8d..cfbe41dd2 100644 --- a/tests-ui/tests/services/keybindingService.escape.test.ts +++ b/tests-ui/tests/services/keybindingService.escape.test.ts @@ -1,15 +1,15 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it, vi } from 'vitest' -import { CORE_KEYBINDINGS } from '@/constants/coreKeybindings' -import { useKeybindingService } from '@/services/keybindingService' +import { CORE_KEYBINDINGS } from '@/platform/keybinding/constants/coreKeybindings' import { useCommandStore } from '@/stores/commandStore' import { useDialogStore } from '@/stores/dialogStore' +import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService' import { KeyComboImpl, KeybindingImpl, useKeybindingStore -} from '@/stores/keybindingStore' +} from '@/workbench/keybindings/stores/keybindingStore' // Mock stores vi.mock('@/platform/settings/settingStore', () => ({ diff --git a/tests-ui/tests/services/keybindingService.forwarding.test.ts b/tests-ui/tests/services/keybindingService.forwarding.test.ts index 1c62222dd..5fef5797a 100644 --- a/tests-ui/tests/services/keybindingService.forwarding.test.ts +++ b/tests-ui/tests/services/keybindingService.forwarding.test.ts @@ -2,9 +2,9 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it, vi } from 'vitest' import { app } from '@/scripts/app' -import { useKeybindingService } from '@/services/keybindingService' import { useCommandStore } from '@/stores/commandStore' import { useDialogStore } from '@/stores/dialogStore' +import { useKeybindingService } from '@/workbench/keybindings/services/keybindingService' // Mock the app and canvas using factory functions vi.mock('@/scripts/app', () => { diff --git a/tests-ui/tests/store/keybindingStore.test.ts b/tests-ui/tests/store/keybindingStore.test.ts index 120f8c174..3a339cd9a 100644 --- a/tests-ui/tests/store/keybindingStore.test.ts +++ b/tests-ui/tests/store/keybindingStore.test.ts @@ -1,7 +1,10 @@ import { createPinia, setActivePinia } from 'pinia' import { beforeEach, describe, expect, it } from 'vitest' -import { KeybindingImpl, useKeybindingStore } from '@/stores/keybindingStore' +import { + KeybindingImpl, + useKeybindingStore +} from '@/workbench/keybindings/stores/keybindingStore' describe('useKeybindingStore', () => { beforeEach(() => {