Skip to content

Commit f74c176

Browse files
DrJKLgithub-actions
andauthored
Cleanup: Properties Panel (#7137)
## Summary - Code cleanup - Copy, padding, color, alignment of components - Subgraph Edit mode changes - Partial fix for the Node Info location (need to do context menu still) - Editing node title ### Still to-do - Bi-directionality in values ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7137-WIP-Cleanup-Properties-Panel-2be6d73d3650813e9430f6bcb09dfb4d) by [Unito](https://www.unito.io) --------- Co-authored-by: github-actions <[email protected]>
1 parent cde49d5 commit f74c176

File tree

45 files changed

+417
-384
lines changed

Some content is hidden

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

45 files changed

+417
-384
lines changed

browser_tests/fixtures/ComfyPage.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,32 @@ dotenv.config()
2727

2828
type WorkspaceStore = ReturnType<typeof useWorkspaceStore>
2929

30+
class ComfyPropertiesPanel {
31+
readonly root: Locator
32+
readonly panelTitle: Locator
33+
readonly searchBox: Locator
34+
35+
constructor(readonly page: Page) {
36+
this.root = page.getByTestId('properties-panel')
37+
this.panelTitle = this.root.locator('h3')
38+
this.searchBox = this.root.getByPlaceholder('Search...')
39+
}
40+
}
41+
3042
class ComfyMenu {
3143
private _nodeLibraryTab: NodeLibrarySidebarTab | null = null
3244
private _workflowsTab: WorkflowsSidebarTab | null = null
3345
private _topbar: Topbar | null = null
3446

3547
public readonly sideToolbar: Locator
48+
public readonly propertiesPanel: ComfyPropertiesPanel
3649
public readonly themeToggleButton: Locator
3750
public readonly saveButton: Locator
3851

3952
constructor(public readonly page: Page) {
4053
this.sideToolbar = page.locator('.side-tool-bar-container')
4154
this.themeToggleButton = page.locator('.comfy-vue-theme-toggle')
55+
this.propertiesPanel = new ComfyPropertiesPanel(page)
4256
this.saveButton = page
4357
.locator('button[title="Save the current workflow"]')
4458
.nth(0)

browser_tests/helpers/actionbar.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ import type { AutoQueueMode } from '../../src/stores/queueStore'
55
export class ComfyActionbar {
66
public readonly root: Locator
77
public readonly queueButton: ComfyQueueButton
8+
public readonly propertiesButton: Locator
89

910
constructor(public readonly page: Page) {
10-
this.root = page.locator('.actionbar')
11+
this.root = page.locator('.actionbar-container')
1112
this.queueButton = new ComfyQueueButton(this)
13+
this.propertiesButton = this.root.getByLabel('Toggle properties panel')
1214
}
1315

1416
async isDocked() {
15-
const className = await this.root.getAttribute('class')
17+
const className = await this.root
18+
.locator('.actionbar')
19+
.getAttribute('class')
1620
return className?.includes('static') ?? false
1721
}
1822
}
3.76 KB
Loading

browser_tests/tests/nodeHelp.spec.ts

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ test.describe('Node Help', () => {
5252
await expect(helpButton).toBeVisible()
5353
await helpButton.click()
5454

55-
// Verify that the node library sidebar is opened
56-
await expect(
57-
comfyPage.menu.nodeLibraryTab.selectedTabButton
58-
).toBeVisible()
59-
6055
// Verify that the help page is shown for the correct node
61-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
56+
const helpPage = comfyPage.page.locator(
57+
'[data-testid="properties-panel"]'
58+
)
6259
await expect(helpPage).toContainText('KSampler')
6360
await expect(helpPage.locator('.node-help-content')).toBeVisible()
6461
})
@@ -170,7 +167,9 @@ test.describe('Node Help', () => {
170167
await helpButton.click()
171168

172169
// Verify loading spinner is shown
173-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
170+
const helpPage = comfyPage.page.locator(
171+
'[data-testid="properties-panel"]'
172+
)
174173
await expect(helpPage.locator('.p-progressspinner')).toBeVisible()
175174

176175
// Wait for content to load
@@ -200,7 +199,9 @@ test.describe('Node Help', () => {
200199
await helpButton.click()
201200

202201
// Verify fallback content is shown (description, inputs, outputs)
203-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
202+
const helpPage = comfyPage.page.locator(
203+
'[data-testid="properties-panel"]'
204+
)
204205
await expect(helpPage).toContainText('Description')
205206
await expect(helpPage).toContainText('Inputs')
206207
await expect(helpPage).toContainText('Outputs')
@@ -233,7 +234,9 @@ test.describe('Node Help', () => {
233234
)
234235
await helpButton.click()
235236

236-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
237+
const helpPage = comfyPage.page.locator(
238+
'[data-testid="properties-panel"]'
239+
)
237240
await expect(helpPage).toContainText('KSampler Documentation')
238241

239242
// Check that relative image paths are prefixed correctly
@@ -281,7 +284,9 @@ test.describe('Node Help', () => {
281284
)
282285
await helpButton.click()
283286

284-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
287+
const helpPage = comfyPage.page.locator(
288+
'[data-testid="properties-panel"]'
289+
)
285290

286291
// Check relative video paths are prefixed
287292
const relativeVideo = helpPage.locator('video[src*="demo.mp4"]')
@@ -354,7 +359,9 @@ This is documentation for a custom node.
354359
if (await helpButton.isVisible()) {
355360
await helpButton.click()
356361

357-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
362+
const helpPage = comfyPage.page.locator(
363+
'[data-testid="properties-panel"]'
364+
)
358365
await expect(helpPage).toContainText('Custom Node Documentation')
359366

360367
// Check image path for custom nodes
@@ -394,7 +401,9 @@ This is documentation for a custom node.
394401
)
395402
await helpButton.click()
396403

397-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
404+
const helpPage = comfyPage.page.locator(
405+
'[data-testid="properties-panel"]'
406+
)
398407

399408
// Dangerous elements should be removed
400409
await expect(helpPage.locator('script')).toHaveCount(0)
@@ -461,7 +470,9 @@ This is English documentation.
461470
)
462471
await helpButton.click()
463472

464-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
473+
const helpPage = comfyPage.page.locator(
474+
'[data-testid="properties-panel"]'
475+
)
465476
await expect(helpPage).toContainText('KSamplerノード')
466477
await expect(helpPage).toContainText('これは日本語のドキュメントです')
467478

@@ -484,7 +495,9 @@ This is English documentation.
484495
)
485496
await helpButton.click()
486497

487-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
498+
const helpPage = comfyPage.page.locator(
499+
'[data-testid="properties-panel"]'
500+
)
488501

489502
// Should show fallback content (node description)
490503
await expect(helpPage).toBeVisible()
@@ -528,7 +541,9 @@ This is English documentation.
528541
)
529542
await helpButton.click()
530543

531-
const helpPage = comfyPage.page.locator('.sidebar-content-container')
544+
const helpPage = comfyPage.page.locator(
545+
'[data-testid="properties-panel"]'
546+
)
532547
await expect(helpPage).toContainText('KSampler Help')
533548
await expect(helpPage).toContainText('This is KSampler documentation')
534549

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from '@playwright/test'
2+
3+
import { comfyPageFixture as test } from '../../fixtures/ComfyPage'
4+
5+
test.describe('Properties panel', () => {
6+
test('opens and updates title based on selection', async ({ comfyPage }) => {
7+
await comfyPage.actionbar.propertiesButton.click()
8+
9+
const { propertiesPanel } = comfyPage.menu
10+
11+
await expect(propertiesPanel.panelTitle).toContainText(
12+
'No node(s) selected'
13+
)
14+
15+
await comfyPage.selectNodes(['KSampler', 'CLIP Text Encode (Prompt)'])
16+
17+
await expect(propertiesPanel.panelTitle).toContainText('3 nodes selected')
18+
await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1)
19+
await expect(
20+
propertiesPanel.root.getByText('CLIP Text Encode (Prompt)')
21+
).toHaveCount(2)
22+
23+
await propertiesPanel.searchBox.fill('seed')
24+
await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1)
25+
await expect(
26+
propertiesPanel.root.getByText('CLIP Text Encode (Prompt)')
27+
).toHaveCount(0)
28+
29+
await propertiesPanel.searchBox.fill('')
30+
await expect(propertiesPanel.root.getByText('KSampler')).toHaveCount(1)
31+
await expect(
32+
propertiesPanel.root.getByText('CLIP Text Encode (Prompt)')
33+
).toHaveCount(2)
34+
})
35+
})
3.07 KB
Loading
88 Bytes
Loading
89 Bytes
Loading
73 Bytes
Loading
131 Bytes
Loading

0 commit comments

Comments
 (0)