Skip to content

Commit 4c8c4a1

Browse files
[refactor] Improve settings domain organization (#5550)
* refactor: move settingStore to platform/settings Move src/stores/settingStore.ts to src/platform/settings/settingStore.ts to separate platform infrastructure from domain logic following DDD principles. Updates all import references across ~70 files to maintain compatibility. * fix: update remaining settingStore imports after rebase * fix: complete remaining settingStore import updates * fix: update vi.mock paths for settingStore in tests Update all test files to mock the new settingStore location at @/platform/settings/settingStore instead of @/stores/settingStore * fix: resolve remaining settingStore imports and unused imports after rebase * fix: update settingStore mock path in SelectionToolbox test Fix vi.mock path from @/stores/settingStore to @/platform/settings/settingStore to resolve failing Load3D viewer button test. * refactor: complete comprehensive settings migration to platform layer This commit completes the migration of all settings-related code to the platform layer as part of the Domain-Driven Design (DDD) architecture refactoring. - constants/coreSettings.ts → platform/settings/constants/coreSettings.ts - types/settingTypes.ts → platform/settings/types.ts - stores/settingStore.ts → platform/settings/settingStore.ts (already moved) - composables/setting/useSettingUI.ts → platform/settings/composables/useSettingUI.ts - composables/setting/useSettingSearch.ts → platform/settings/composables/useSettingSearch.ts - composables/useLitegraphSettings.ts → platform/settings/composables/useLitegraphSettings.ts - components/dialog/content/SettingDialogContent.vue → platform/settings/components/SettingDialogContent.vue - components/dialog/content/setting/SettingItem.vue → platform/settings/components/SettingItem.vue - components/dialog/content/setting/SettingGroup.vue → platform/settings/components/SettingGroup.vue - components/dialog/content/setting/SettingsPanel.vue → platform/settings/components/SettingsPanel.vue - components/dialog/content/setting/ColorPaletteMessage.vue → platform/settings/components/ColorPaletteMessage.vue - components/dialog/content/setting/ExtensionPanel.vue → platform/settings/components/ExtensionPanel.vue - components/dialog/content/setting/ServerConfigPanel.vue → platform/settings/components/ServerConfigPanel.vue - ~100+ import statements updated across the codebase - Test file imports corrected - Component imports fixed in dialog service and command menubar - Composable imports updated in GraphCanvas.vue ``` src/platform/settings/ ├── components/ # All settings UI components ├── composables/ # Settings-related composables ├── constants/ # Core settings definitions ├── types.ts # Settings type definitions └── settingStore.ts # Central settings state management ``` ✅ TypeScript compilation successful ✅ All tests passing (settings store, search functionality, UI components) ✅ Production build successful ✅ Domain boundaries properly established This migration consolidates all settings functionality into a cohesive platform domain, improving maintainability and following DDD principles for better code organization. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * fix: format and lint after rebase conflict resolution * fix: update remaining import paths to platform settings - Fix browser test import: extensionAPI.spec.ts - Fix script import: collect-i18n-general.ts - Complete settings migration import path updates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent e3bb29c commit 4c8c4a1

File tree

118 files changed

+161
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+161
-157
lines changed

browser_tests/tests/extensionAPI.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from '@playwright/test'
22

3-
import { SettingParams } from '../../src/types/settingTypes'
3+
import { SettingParams } from '../../src/platform/settings/types'
44
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
55

66
test.describe('Topbar commands', () => {
@@ -247,7 +247,7 @@ test.describe('Topbar commands', () => {
247247
test.describe('Dialog', () => {
248248
test('Should allow showing a prompt dialog', async ({ comfyPage }) => {
249249
await comfyPage.page.evaluate(() => {
250-
window['app'].extensionManager.dialog
250+
void window['app'].extensionManager.dialog
251251
.prompt({
252252
title: 'Test Prompt',
253253
message: 'Test Prompt Message'
@@ -267,7 +267,7 @@ test.describe('Topbar commands', () => {
267267
comfyPage
268268
}) => {
269269
await comfyPage.page.evaluate(() => {
270-
window['app'].extensionManager.dialog
270+
void window['app'].extensionManager.dialog
271271
.confirm({
272272
title: 'Test Confirm',
273273
message: 'Test Confirm Message'
@@ -284,7 +284,7 @@ test.describe('Topbar commands', () => {
284284
test('Should allow dismissing a dialog', async ({ comfyPage }) => {
285285
await comfyPage.page.evaluate(() => {
286286
window['value'] = 'foo'
287-
window['app'].extensionManager.dialog
287+
void window['app'].extensionManager.dialog
288288
.confirm({
289289
title: 'Test Confirm',
290290
message: 'Test Confirm Message'

scripts/collect-i18n-general.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import * as fs from 'fs'
33
import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage'
44
import { CORE_MENU_COMMANDS } from '../src/constants/coreMenuCommands'
55
import { SERVER_CONFIG_ITEMS } from '../src/constants/serverConfig'
6+
import type { FormItem, SettingParams } from '../src/platform/settings/types'
67
import type { ComfyCommandImpl } from '../src/stores/commandStore'
7-
import type { FormItem, SettingParams } from '../src/types/settingTypes'
88
import { formatCamelCase, normalizeI18nKey } from '../src/utils/formatUtil'
99

1010
const localePath = './src/locales/en/main.json'

src/components/LiteGraphCanvasSplitterOverlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import Splitter from 'primevue/splitter'
5050
import SplitterPanel from 'primevue/splitterpanel'
5151
import { computed } from 'vue'
5252
53-
import { useSettingStore } from '@/stores/settingStore'
53+
import { useSettingStore } from '@/platform/settings/settingStore'
5454
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
5555
import { useSidebarTabStore } from '@/stores/workspace/sidebarTabStore'
5656

src/components/MenuHamburger.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import Button from 'primevue/button'
2424
import { CSSProperties, computed, watchEffect } from 'vue'
2525
26+
import { useSettingStore } from '@/platform/settings/settingStore'
2627
import { app } from '@/scripts/app'
27-
import { useSettingStore } from '@/stores/settingStore'
2828
import { useWorkspaceStore } from '@/stores/workspaceStore'
2929
import { showNativeSystemMenu } from '@/utils/envUtil'
3030

src/components/actionbar/BatchCountEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import { storeToRefs } from 'pinia'
3737
import InputNumber from 'primevue/inputnumber'
3838
import { computed } from 'vue'
3939
40+
import { useSettingStore } from '@/platform/settings/settingStore'
4041
import { useQueueSettingsStore } from '@/stores/queueStore'
41-
import { useSettingStore } from '@/stores/settingStore'
4242
4343
const queueSettingsStore = useQueueSettingsStore()
4444
const { batchCount } = storeToRefs(queueSettingsStore)

src/components/actionbar/ComfyActionbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { clamp } from 'es-toolkit/compat'
2424
import Panel from 'primevue/panel'
2525
import { Ref, computed, inject, nextTick, onMounted, ref, watch } from 'vue'
2626
27-
import { useSettingStore } from '@/stores/settingStore'
27+
import { useSettingStore } from '@/platform/settings/settingStore'
2828
2929
import ComfyQueueButton from './ComfyQueueButton.vue'
3030

src/components/common/FormItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import FormRadioGroup from '@/components/common/FormRadioGroup.vue'
4444
import InputKnob from '@/components/common/InputKnob.vue'
4545
import InputSlider from '@/components/common/InputSlider.vue'
4646
import UrlInput from '@/components/common/UrlInput.vue'
47-
import { FormItem } from '@/types/settingTypes'
47+
import { FormItem } from '@/platform/settings/types'
4848
4949
const formValue = defineModel<any>('formValue')
5050
const props = defineProps<{

src/components/common/FormRadioGroup.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import RadioButton from 'primevue/radiobutton'
44
import { beforeAll, describe, expect, it } from 'vitest'
55
import { createApp } from 'vue'
66

7-
import type { SettingOption } from '@/types/settingTypes'
7+
import type { SettingOption } from '@/platform/settings/types'
88

99
import FormRadioGroup from './FormRadioGroup.vue'
1010

src/components/common/FormRadioGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import RadioButton from 'primevue/radiobutton'
2525
import { computed } from 'vue'
2626
27-
import type { SettingOption } from '@/types/settingTypes'
27+
import type { SettingOption } from '@/platform/settings/types'
2828
2929
const props = defineProps<{
3030
modelValue: any

src/components/dialog/UnloadWindowConfirmDialog.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<script setup lang="ts">
1313
import { onBeforeUnmount, onMounted } from 'vue'
1414
15+
import { useSettingStore } from '@/platform/settings/settingStore'
1516
import { useWorkflowStore } from '@/platform/workflow/management/stores/workflowStore'
16-
import { useSettingStore } from '@/stores/settingStore'
1717
1818
const settingStore = useSettingStore()
1919
const workflowStore = useWorkflowStore()

0 commit comments

Comments
 (0)