diff --git a/browser_tests/fixtures/components/SettingDialog.ts b/browser_tests/fixtures/components/SettingDialog.ts
index e9040a3a9..db98e0373 100644
--- a/browser_tests/fixtures/components/SettingDialog.ts
+++ b/browser_tests/fixtures/components/SettingDialog.ts
@@ -9,12 +9,12 @@ export class SettingDialog {
) {}
get root() {
- return this.page.locator('div.settings-container')
+ return this.page.locator('[data-testid="settings-dialog"]')
}
async open() {
await this.comfyPage.executeCommand('Comfy.ShowSettingsDialog')
- await this.page.waitForSelector('div.settings-container')
+ await this.page.waitForSelector('[data-testid="settings-dialog"]')
}
/**
@@ -23,9 +23,7 @@ export class SettingDialog {
* @param value - The value to set
*/
async setStringSetting(id: string, value: string) {
- const settingInputDiv = this.page.locator(
- `div.settings-container div[id="${id}"]`
- )
+ const settingInputDiv = this.root.locator(`div[id="${id}"]`)
await settingInputDiv.locator('input').fill(value)
}
@@ -34,15 +32,15 @@ export class SettingDialog {
* @param id - The id of the setting
*/
async toggleBooleanSetting(id: string) {
- const settingInputDiv = this.page.locator(
- `div.settings-container div[id="${id}"]`
- )
+ const settingInputDiv = this.root.locator(`div[id="${id}"]`)
await settingInputDiv.locator('input').click()
}
async goToAboutPanel() {
- const aboutButton = this.page.locator('li[aria-label="About"]')
+ const aboutButton = this.root.locator('nav [role="button"]', {
+ hasText: 'About'
+ })
await aboutButton.click()
- await this.page.waitForSelector('div.about-container')
+ await this.page.waitForSelector('.about-container')
}
}
diff --git a/browser_tests/tests/dialog.spec.ts b/browser_tests/tests/dialog.spec.ts
index 081f47275..aeb959bf9 100644
--- a/browser_tests/tests/dialog.spec.ts
+++ b/browser_tests/tests/dialog.spec.ts
@@ -232,9 +232,13 @@ test.describe('Missing models warning', () => {
test.describe('Settings', () => {
test('@mobile Should be visible on mobile', async ({ comfyPage }) => {
await comfyPage.page.keyboard.press('Control+,')
- const settingsContent = comfyPage.page.locator('.settings-content')
- await expect(settingsContent).toBeVisible()
- const isUsableHeight = await settingsContent.evaluate(
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
+ await expect(settingsDialog).toBeVisible()
+ const contentArea = settingsDialog.locator('main')
+ await expect(contentArea).toBeVisible()
+ const isUsableHeight = await contentArea.evaluate(
(el) => el.clientHeight > 30
)
expect(isUsableHeight).toBeTruthy()
@@ -244,7 +248,9 @@ test.describe('Settings', () => {
await comfyPage.page.keyboard.down('ControlOrMeta')
await comfyPage.page.keyboard.press(',')
await comfyPage.page.keyboard.up('ControlOrMeta')
- const settingsLocator = comfyPage.page.locator('.settings-container')
+ const settingsLocator = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsLocator).toBeVisible()
await comfyPage.page.keyboard.press('Escape')
await expect(settingsLocator).not.toBeVisible()
@@ -261,10 +267,15 @@ test.describe('Settings', () => {
test('Should persist keybinding setting', async ({ comfyPage }) => {
// Open the settings dialog
await comfyPage.page.keyboard.press('Control+,')
- await comfyPage.page.waitForSelector('.settings-container')
+ await comfyPage.page.waitForSelector('[data-testid="settings-dialog"]')
// Open the keybinding tab
- await comfyPage.page.getByLabel('Keybinding').click()
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
+ await settingsDialog
+ .locator('nav [role="button"]', { hasText: 'Keybinding' })
+ .click()
await comfyPage.page.waitForSelector(
'[placeholder="Search Keybindings..."]'
)
diff --git a/browser_tests/tests/subgraph.spec.ts b/browser_tests/tests/subgraph.spec.ts
index 635915621..9e9b96795 100644
--- a/browser_tests/tests/subgraph.spec.ts
+++ b/browser_tests/tests/subgraph.spec.ts
@@ -794,7 +794,7 @@ test.describe('Subgraph Operations', () => {
// Open settings dialog using hotkey
await comfyPage.page.keyboard.press('Control+,')
- await comfyPage.page.waitForSelector('.settings-container', {
+ await comfyPage.page.waitForSelector('[data-testid="settings-dialog"]', {
state: 'visible'
})
@@ -804,7 +804,7 @@ test.describe('Subgraph Operations', () => {
// Dialog should be closed
await expect(
- comfyPage.page.locator('.settings-container')
+ comfyPage.page.locator('[data-testid="settings-dialog"]')
).not.toBeVisible()
// Should still be in subgraph
diff --git a/browser_tests/tests/useSettingSearch.spec.ts b/browser_tests/tests/useSettingSearch.spec.ts
index f022bb4bd..2eafa9fdf 100644
--- a/browser_tests/tests/useSettingSearch.spec.ts
+++ b/browser_tests/tests/useSettingSearch.spec.ts
@@ -41,16 +41,15 @@ test.describe('Settings Search functionality', () => {
})
test('can open settings dialog and use search box', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Find the search box
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await expect(searchBox).toBeVisible()
- // Verify search box has the correct placeholder
await expect(searchBox).toHaveAttribute(
'placeholder',
expect.stringContaining('Search')
@@ -58,226 +57,198 @@ test.describe('Settings Search functionality', () => {
})
test('search box is functional and accepts input', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Find and interact with the search box
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('Comfy')
- // Verify the input was accepted
await expect(searchBox).toHaveValue('Comfy')
})
test('search box clears properly', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Find and interact with the search box
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('test')
await expect(searchBox).toHaveValue('test')
- // Clear the search box
await searchBox.clear()
await expect(searchBox).toHaveValue('')
})
test('settings categories are visible in sidebar', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Check that the sidebar has categories
- const categories = comfyPage.page.locator(
- '.settings-sidebar .p-listbox-option'
- )
+ const categories = settingsDialog.locator('nav [role="button"]')
expect(await categories.count()).toBeGreaterThan(0)
- // Check that at least one category is visible
await expect(categories.first()).toBeVisible()
})
test('can select different categories in sidebar', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Get categories and click on different ones
- const categories = comfyPage.page.locator(
- '.settings-sidebar .p-listbox-option'
- )
+ const categories = settingsDialog.locator('nav [role="button"]')
const categoryCount = await categories.count()
if (categoryCount > 1) {
- // Click on the second category
await categories.nth(1).click()
- // Verify the category is selected
- await expect(categories.nth(1)).toHaveClass(/p-listbox-option-selected/)
+ await expect(categories.nth(1)).toHaveClass(
+ /bg-interface-menu-component-surface-selected/
+ )
}
})
test('settings content area is visible', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Check that the content area is visible
- const contentArea = comfyPage.page.locator('.settings-content')
+ const contentArea = settingsDialog.locator('main')
await expect(contentArea).toBeVisible()
-
- // Check that tab panels are visible
- const tabPanels = comfyPage.page.locator('.settings-tab-panels')
- await expect(tabPanels).toBeVisible()
})
test('search functionality affects UI state', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Find the search box
- const searchBox = comfyPage.page.locator('.settings-search-box input')
-
- // Type in search box
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('graph')
- // Verify that the search input is handled
await expect(searchBox).toHaveValue('graph')
})
test('settings dialog can be closed', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Close with escape key
await comfyPage.page.keyboard.press('Escape')
- // Verify dialog is closed
await expect(settingsDialog).not.toBeVisible()
})
test('search box has proper debouncing behavior', async ({ comfyPage }) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Type rapidly in search box
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('a')
await searchBox.fill('ab')
await searchBox.fill('abc')
await searchBox.fill('abcd')
- // Verify final value
await expect(searchBox).toHaveValue('abcd')
})
test('search excludes hidden settings from results', async ({
comfyPage
}) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Search for our test settings
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('Test')
- // Get all settings content
- const settingsContent = comfyPage.page.locator('.settings-tab-panels')
+ const contentArea = settingsDialog.locator('main')
- // Should show visible setting but not hidden setting
- await expect(settingsContent).toContainText('Test Visible Setting')
- await expect(settingsContent).not.toContainText('Test Hidden Setting')
+ await expect(contentArea).toContainText('Test Visible Setting')
+ await expect(contentArea).not.toContainText('Test Hidden Setting')
})
test('search excludes deprecated settings from results', async ({
comfyPage
}) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Search for our test settings
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('Test')
- // Get all settings content
- const settingsContent = comfyPage.page.locator('.settings-tab-panels')
+ const contentArea = settingsDialog.locator('main')
- // Should show visible setting but not deprecated setting
- await expect(settingsContent).toContainText('Test Visible Setting')
- await expect(settingsContent).not.toContainText('Test Deprecated Setting')
+ await expect(contentArea).toContainText('Test Visible Setting')
+ await expect(contentArea).not.toContainText('Test Deprecated Setting')
})
test('search shows visible settings but excludes hidden and deprecated', async ({
comfyPage
}) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- // Search for our test settings
- const searchBox = comfyPage.page.locator('.settings-search-box input')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
await searchBox.fill('Test')
- // Get all settings content
- const settingsContent = comfyPage.page.locator('.settings-tab-panels')
+ const contentArea = settingsDialog.locator('main')
- // Should only show the visible setting
- await expect(settingsContent).toContainText('Test Visible Setting')
+ await expect(contentArea).toContainText('Test Visible Setting')
- // Should not show hidden or deprecated settings
- await expect(settingsContent).not.toContainText('Test Hidden Setting')
- await expect(settingsContent).not.toContainText('Test Deprecated Setting')
+ await expect(contentArea).not.toContainText('Test Hidden Setting')
+ await expect(contentArea).not.toContainText('Test Deprecated Setting')
})
test('search by setting name excludes hidden and deprecated', async ({
comfyPage
}) => {
- // Open settings dialog
await comfyPage.page.keyboard.press('Control+,')
- const settingsDialog = comfyPage.page.locator('.settings-container')
+ const settingsDialog = comfyPage.page.locator(
+ '[data-testid="settings-dialog"]'
+ )
await expect(settingsDialog).toBeVisible()
- const searchBox = comfyPage.page.locator('.settings-search-box input')
- const settingsContent = comfyPage.page.locator('.settings-tab-panels')
+ const searchBox = settingsDialog.locator('input[placeholder*="Search"]')
+ const contentArea = settingsDialog.locator('main')
- // Search specifically for hidden setting by name
await searchBox.clear()
await searchBox.fill('Hidden')
- // Should not show the hidden setting even when searching by name
- await expect(settingsContent).not.toContainText('Test Hidden Setting')
+ await expect(contentArea).not.toContainText('Test Hidden Setting')
- // Search specifically for deprecated setting by name
await searchBox.clear()
await searchBox.fill('Deprecated')
- // Should not show the deprecated setting even when searching by name
- await expect(settingsContent).not.toContainText('Test Deprecated Setting')
+ await expect(contentArea).not.toContainText('Test Deprecated Setting')
- // Search for visible setting by name - should work
await searchBox.clear()
await searchBox.fill('Visible')
- // Should show the visible setting
- await expect(settingsContent).toContainText('Test Visible Setting')
+ await expect(contentArea).toContainText('Test Visible Setting')
})
})
diff --git a/src/components/bottomPanel/BottomPanel.vue b/src/components/bottomPanel/BottomPanel.vue
index aa6800677..08f23c509 100644
--- a/src/components/bottomPanel/BottomPanel.vue
+++ b/src/components/bottomPanel/BottomPanel.vue
@@ -89,12 +89,12 @@ import { useI18n } from 'vue-i18n'
import ExtensionSlot from '@/components/common/ExtensionSlot.vue'
import Button from '@/components/ui/button/Button.vue'
-import { useDialogService } from '@/services/dialogService'
+import { useSettingsDialog } from '@/platform/settings/composables/useSettingsDialog'
import { useBottomPanelStore } from '@/stores/workspace/bottomPanelStore'
import type { BottomPanelExtension } from '@/types/extensionTypes'
const bottomPanelStore = useBottomPanelStore()
-const dialogService = useDialogService()
+const settingsDialog = useSettingsDialog()
const { t } = useI18n()
const isShortcutsTabActive = computed(() => {
@@ -115,7 +115,7 @@ const getTabDisplayTitle = (tab: BottomPanelExtension): string => {
}
const openKeybindingSettings = async () => {
- dialogService.showSettingsDialog('keybinding')
+ settingsDialog.show('keybinding')
}
const closeBottomPanel = () => {
diff --git a/src/components/dialog/GlobalDialog.vue b/src/components/dialog/GlobalDialog.vue
index 2a1f0ef3d..2074132b5 100644
--- a/src/components/dialog/GlobalDialog.vue
+++ b/src/components/dialog/GlobalDialog.vue
@@ -4,12 +4,7 @@
v-for="item in dialogStore.dialogStack"
:key="item.key"
v-model:visible="item.visible"
- :class="[
- 'global-dialog',
- item.key === 'global-settings' && teamWorkspacesEnabled
- ? 'settings-dialog-workspace'
- : ''
- ]"
+ class="global-dialog"
v-bind="item.dialogComponentProps"
:pt="item.dialogComponentProps.pt"
:aria-labelledby="item.key"
@@ -43,15 +38,7 @@
@@ -69,16 +56,6 @@ const dialogStore = useDialogStore()
@apply pt-0;
}
-/* Workspace mode: wider settings dialog */
-.settings-dialog-workspace {
- width: 100%;
- max-width: 1440px;
-}
-
-.settings-dialog-workspace .p-dialog-content {
- width: 100%;
-}
-
.manager-dialog {
height: 80vh;
max-width: 1724px;
diff --git a/src/components/dialog/content/TopUpCreditsDialogContent.vue b/src/components/dialog/content/TopUpCreditsDialogContent.vue
index 51c29aaf5..110c3012d 100644
--- a/src/components/dialog/content/TopUpCreditsDialogContent.vue
+++ b/src/components/dialog/content/TopUpCreditsDialogContent.vue
@@ -161,7 +161,7 @@ import { useExternalLink } from '@/composables/useExternalLink'
import { useSubscription } from '@/platform/cloud/subscription/composables/useSubscription'
import { useTelemetry } from '@/platform/telemetry'
import { clearTopupTracking } from '@/platform/telemetry/topupTracker'
-import { useDialogService } from '@/services/dialogService'
+import { useSettingsDialog } from '@/platform/settings/composables/useSettingsDialog'
import { useDialogStore } from '@/stores/dialogStore'
import { cn } from '@/utils/tailwindUtil'
@@ -172,7 +172,7 @@ const { isInsufficientCredits = false } = defineProps<{
const { t } = useI18n()
const authActions = useFirebaseAuthActions()
const dialogStore = useDialogStore()
-const dialogService = useDialogService()
+const settingsDialog = useSettingsDialog()
const telemetry = useTelemetry()
const toast = useToast()
const { buildDocsUrl, docsPaths } = useExternalLink()
@@ -256,9 +256,7 @@ async function handleBuy() {
// Close top-up dialog (keep tracking) and open credits panel to show updated balance
handleClose(false)
- dialogService.showSettingsDialog(
- isSubscriptionEnabled() ? 'subscription' : 'credits'
- )
+ settingsDialog.show(isSubscriptionEnabled() ? 'subscription' : 'credits')
} catch (error) {
console.error('Purchase failed:', error)
diff --git a/src/components/dialog/content/setting/AboutPanel.vue b/src/components/dialog/content/setting/AboutPanel.vue
index 33ada1ce3..0fdddad17 100644
--- a/src/components/dialog/content/setting/AboutPanel.vue
+++ b/src/components/dialog/content/setting/AboutPanel.vue
@@ -1,5 +1,5 @@
-
{{ $t('g.about') }}
@@ -28,7 +28,7 @@
v-if="systemStatsStore.systemStats"
:stats="systemStatsStore.systemStats"
/>
-
+ {{ $t('userSettings.title') }}