Skip to content

Commit 984ebef

Browse files
pythongosssssactions-usergithub-actions
authored
Floating Menus - UI rework (#5980)
## Summary Enhancing and further modernizing the UI, giving users more usable area whilst keeping farmiliar positioning and feel of elements. ## Changes - **What**: Significant restructure of the UI elements, changing elements from large blocks to floating elements, updating: - Side toolbar menu (floating style, supports small/normal mode, combines to scroll on height overflow) - Bottom tabs panel (floating style, tabs redesigned) - Action bar (support for docking/undocking menu) - Added login/user menu button to top right - Restyled breadcrumbs (still collapse when overflows) - Add litegraph support for fps info position (so it isn't covered by the sidebar) - **Breaking**: - Removed various elements and added new ones, I have tested custom sidebars, custom actions, etc but if scripts are inserting elements into "other" elements they may have been (re)moved. - Remove support for bottom menu - Remove support for 2nd-row tabs ## Screenshots <img width="1116" height="907" alt="ui" src="https://github.com/user-attachments/assets/b040a215-67d3-4c88-8c4d-f402a16a34f6" /> https://github.com/user-attachments/assets/571dbda5-01ec-47e8-b235-ee1b88c93dd0 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5980-Floating-Menus-UI-rework-2866d73d3650810aac60cc1afe979b60) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <[email protected]> Co-authored-by: github-actions <[email protected]>
1 parent 8cc5b52 commit 984ebef

File tree

59 files changed

+792
-532
lines changed

Some content is hidden

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

59 files changed

+792
-532
lines changed

browser_tests/fixtures/ComfyPage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class ComfyMenu {
4646
.nth(0)
4747
}
4848

49+
get buttons() {
50+
return this.sideToolbar.locator('.side-bar-button')
51+
}
52+
4953
get nodeLibraryTab() {
5054
this._nodeLibraryTab ??= new NodeLibrarySidebarTab(this.page)
5155
return this._nodeLibraryTab

browser_tests/fixtures/components/Topbar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class Topbar {
77

88
constructor(public readonly page: Page) {
99
this.menuLocator = page.locator('.comfy-command-menu')
10-
this.menuTrigger = page.locator('.comfyui-logo-wrapper')
10+
this.menuTrigger = page.locator('.comfy-menu-button-wrapper')
1111
}
1212

1313
async getTabNames(): Promise<string[]> {
@@ -105,7 +105,7 @@ export class Topbar {
105105
* Close the topbar menu by clicking outside
106106
*/
107107
async closeTopbarMenu() {
108-
await this.page.locator('body').click({ position: { x: 10, y: 10 } })
108+
await this.page.locator('body').click({ position: { x: 300, y: 10 } })
109109
await expect(this.menuLocator).not.toBeVisible()
110110
}
111111

browser_tests/tests/actionbar.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@ test.describe('Actionbar', () => {
116116
test('Can dock actionbar into top menu', async ({ comfyPage }) => {
117117
await comfyPage.page.dragAndDrop(
118118
'.actionbar .drag-handle',
119-
'.comfyui-menu',
119+
'.actionbar-container',
120120
{
121-
targetPosition: { x: 0, y: 0 }
121+
targetPosition: { x: 50, y: 20 },
122+
force: true
122123
}
123124
)
124125
expect(await comfyPage.actionbar.isDocked()).toBe(true)
-6.09 KB
Loading
-57 Bytes
Loading
-58 Bytes
Loading

browser_tests/tests/groupNode.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test.describe('Group Node', () => {
233233
}
234234

235235
const isRegisteredNodeDefStore = async (comfyPage: ComfyPage) => {
236+
await comfyPage.menu.nodeLibraryTab.open()
236237
const groupNodesFolderCt = await comfyPage.menu.nodeLibraryTab
237238
.getFolder(GROUP_NODE_CATEGORY)
238239
.count()
@@ -253,8 +254,6 @@ test.describe('Group Node', () => {
253254
test.beforeEach(async ({ comfyPage }) => {
254255
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
255256
await comfyPage.loadWorkflow(WORKFLOW_NAME)
256-
await comfyPage.menu.nodeLibraryTab.open()
257-
258257
groupNode = await comfyPage.getFirstNodeRef()
259258
if (!groupNode)
260259
throw new Error(`Group node not found in workflow ${WORKFLOW_NAME}`)

browser_tests/tests/interaction.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,10 +792,19 @@ test.describe('Viewport settings', () => {
792792

793793
await comfyPage.menu.topbar.saveWorkflow('Workflow A')
794794
await comfyPage.nextFrame()
795-
const screenshotA = (await comfyPage.canvas.screenshot()).toString('base64')
796795

797796
// Save workflow as a new file, then zoom out before screen shot
798797
await comfyPage.menu.topbar.saveWorkflowAs('Workflow B')
798+
799+
await comfyPage.nextFrame()
800+
const tabA = comfyPage.menu.topbar.getWorkflowTab('Workflow A')
801+
await changeTab(tabA)
802+
803+
const screenshotA = (await comfyPage.canvas.screenshot()).toString('base64')
804+
805+
const tabB = comfyPage.menu.topbar.getWorkflowTab('Workflow B')
806+
await changeTab(tabB)
807+
799808
await comfyMouse.move(comfyPage.emptySpace)
800809
for (let i = 0; i < 4; i++) {
801810
await comfyMouse.wheel(0, 60)
@@ -807,9 +816,6 @@ test.describe('Viewport settings', () => {
807816
// Ensure that the screenshots are different due to zoom level
808817
expect(screenshotB).not.toBe(screenshotA)
809818

810-
const tabA = comfyPage.menu.topbar.getWorkflowTab('Workflow A')
811-
const tabB = comfyPage.menu.topbar.getWorkflowTab('Workflow B')
812-
813819
// Go back to Workflow A
814820
await changeTab(tabA)
815821
expect((await comfyPage.canvas.screenshot()).toString('base64')).toBe(

browser_tests/tests/menu.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ test.describe('Menu', () => {
88
})
99

1010
test('Can register sidebar tab', async ({ comfyPage }) => {
11-
const initialChildrenCount = await comfyPage.menu.sideToolbar.evaluate(
12-
(el) => el.children.length
13-
)
11+
const initialChildrenCount = await comfyPage.menu.buttons.count()
1412

1513
await comfyPage.page.evaluate(async () => {
1614
window['app'].extensionManager.registerSidebarTab({
@@ -26,9 +24,7 @@ test.describe('Menu', () => {
2624
})
2725
await comfyPage.nextFrame()
2826

29-
const newChildrenCount = await comfyPage.menu.sideToolbar.evaluate(
30-
(el) => el.children.length
31-
)
27+
const newChildrenCount = await comfyPage.menu.buttons.count()
3228
expect(newChildrenCount).toBe(initialChildrenCount + 1)
3329
})
3430

-5.11 KB
Loading

0 commit comments

Comments
 (0)