mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-31 13:29:55 +00:00
## Summary - drop the queue sidebar entry, its component, and the supporting composable so only the overlay-based queue UI remains - clean up the related tests and keybindings so nothing references the removed tab - prune the unused queue task card components to keep the repo tidy - remove unused queue sidebar translations and command strings across all locales ## Testing - pnpm typecheck - pnpm lint:fix ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6724-Remove-queue-sidebar-tab-2ae6d73d3650811db0d4c5ad4c5ffc8d) by [Unito](https://www.unito.io) --------- Co-authored-by: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Jin Yi <jin12cc@gmail.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Johnpaul Chiwetelu <49923152+Myestery@users.noreply.github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org> Co-authored-by: Comfy Org PR Bot <snomiao+comfy-pr@gmail.com> Co-authored-by: christian-byrne <72887196+christian-byrne@users.noreply.github.com>
151 lines
3.6 KiB
TypeScript
151 lines
3.6 KiB
TypeScript
import type { Locator, Page } from '@playwright/test'
|
|
|
|
class SidebarTab {
|
|
constructor(
|
|
public readonly page: Page,
|
|
public readonly tabId: string
|
|
) {}
|
|
|
|
get tabButton() {
|
|
return this.page.locator(`.${this.tabId}-tab-button`)
|
|
}
|
|
|
|
get selectedTabButton() {
|
|
return this.page.locator(
|
|
`.${this.tabId}-tab-button.side-bar-button-selected`
|
|
)
|
|
}
|
|
|
|
async open() {
|
|
if (await this.selectedTabButton.isVisible()) {
|
|
return
|
|
}
|
|
await this.tabButton.click()
|
|
}
|
|
async close() {
|
|
if (!this.tabButton.isVisible()) {
|
|
return
|
|
}
|
|
await this.tabButton.click()
|
|
}
|
|
}
|
|
|
|
export class NodeLibrarySidebarTab extends SidebarTab {
|
|
constructor(public readonly page: Page) {
|
|
super(page, 'node-library')
|
|
}
|
|
|
|
get nodeLibrarySearchBoxInput() {
|
|
return this.page.locator('.node-lib-search-box input[type="text"]')
|
|
}
|
|
|
|
get nodeLibraryTree() {
|
|
return this.page.locator('.node-lib-tree-explorer')
|
|
}
|
|
|
|
get nodePreview() {
|
|
return this.page.locator('.node-lib-node-preview')
|
|
}
|
|
|
|
get tabContainer() {
|
|
return this.page.locator('.sidebar-content-container')
|
|
}
|
|
|
|
get newFolderButton() {
|
|
return this.tabContainer.locator('.new-folder-button')
|
|
}
|
|
|
|
async open() {
|
|
await super.open()
|
|
await this.nodeLibraryTree.waitFor({ state: 'visible' })
|
|
}
|
|
|
|
async close() {
|
|
if (!this.tabButton.isVisible()) {
|
|
return
|
|
}
|
|
|
|
await this.tabButton.click()
|
|
await this.nodeLibraryTree.waitFor({ state: 'hidden' })
|
|
}
|
|
|
|
folderSelector(folderName: string) {
|
|
return `.p-tree-node-content:has(> .tree-explorer-node-label:has(.tree-folder .node-label:has-text("${folderName}")))`
|
|
}
|
|
|
|
getFolder(folderName: string) {
|
|
return this.page.locator(this.folderSelector(folderName))
|
|
}
|
|
|
|
nodeSelector(nodeName: string) {
|
|
return `.p-tree-node-content:has(> .tree-explorer-node-label:has(.tree-leaf .node-label:has-text("${nodeName}")))`
|
|
}
|
|
|
|
getNode(nodeName: string) {
|
|
return this.page.locator(this.nodeSelector(nodeName))
|
|
}
|
|
}
|
|
|
|
export class WorkflowsSidebarTab extends SidebarTab {
|
|
constructor(public readonly page: Page) {
|
|
super(page, 'workflows')
|
|
}
|
|
|
|
get root() {
|
|
return this.page.locator('.workflows-sidebar-tab')
|
|
}
|
|
|
|
async getOpenedWorkflowNames() {
|
|
return await this.root
|
|
.locator('.comfyui-workflows-open .node-label')
|
|
.allInnerTexts()
|
|
}
|
|
|
|
async getActiveWorkflowName() {
|
|
return await this.root
|
|
.locator('.comfyui-workflows-open .p-tree-node-selected .node-label')
|
|
.innerText()
|
|
}
|
|
|
|
async getTopLevelSavedWorkflowNames() {
|
|
return await this.root
|
|
.locator('.comfyui-workflows-browse .node-label')
|
|
.allInnerTexts()
|
|
}
|
|
|
|
async switchToWorkflow(workflowName: string) {
|
|
const workflowLocator = this.getOpenedItem(workflowName)
|
|
await workflowLocator.click()
|
|
await this.page.waitForTimeout(300)
|
|
}
|
|
|
|
getOpenedItem(name: string) {
|
|
return this.root.locator('.comfyui-workflows-open .node-label', {
|
|
hasText: name
|
|
})
|
|
}
|
|
|
|
getPersistedItem(name: string) {
|
|
return this.root.locator('.comfyui-workflows-browse .node-label', {
|
|
hasText: name
|
|
})
|
|
}
|
|
|
|
async renameWorkflow(locator: Locator, newName: string) {
|
|
await locator.click({ button: 'right' })
|
|
await this.page
|
|
.locator('.p-contextmenu-item-content', { hasText: 'Rename' })
|
|
.click()
|
|
await this.page.keyboard.type(newName)
|
|
await this.page.keyboard.press('Enter')
|
|
await this.page.waitForTimeout(300)
|
|
}
|
|
|
|
async insertWorkflow(locator: Locator) {
|
|
await locator.click({ button: 'right' })
|
|
await this.page
|
|
.locator('.p-contextmenu-item-content', { hasText: 'Insert' })
|
|
.click()
|
|
}
|
|
}
|