mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 22:59:14 +00:00
* [feat] Add formatKeySequence function to format keybindings for commands * [feat] Add lock and unlock canvas commands with keybindings and update localization * feat: Implement canvas scale synchronization and zoom level adjustment * feat: Enhance GraphCanvasMenu with zoom controls and improved button functionality * feat: Refactor MiniMap component layout and remove unused bottomPanelStore * feat: Update zoom control shortcuts to use formatted key sequences * feat: Add tests for ZoomControlsModal and enhance GraphCanvasMenu tests * Update locales [skip ci] * Fix browser tests * ui: align minimap properly * Update locales [skip ci] * feat: focus zoom input when zoom modal loads * style: improve styling of zoom controls and add focus effect * fix styling and tests * styling: add divider to graph canvas menu * styling: position minimap properly * styling: add close button for minimap * styling: add horizontal divider to minimap * styling: update minimap toggle button text and remove old styles * Update locales [skip ci] * Update locales [skip ci] * feat: disable canvas menu in viewport settings after zoom adjustments * Update test expectations [skip ci] * fix: update canvas read-only property access to use state object * Update locales [skip ci] * fix: adjust button group and minimap positioning * feat: enhance zoom controls and adjust minimap positioning per PR comments * feat: implement zoom controls composable * feat: add timeout delays for headless tests * fix: update zoom input validation range in applyZoom function * [refactor] Update positioning and styles for GraphCanvasMenu, MiniMap, and ZoomControlsModal components * [refactor] Adjust z-index and positioning for GraphCanvasMenu, MiniMap, and ZoomControlsModal components * [style] Adjust margin for minimap button styles in GraphCanvasMenu component * [refactor] minimap should show on focus mode * [refactor] Update LiteGraphCanvasSplitterOverlay to conditionally render side and bottom panels based on focus mode * [style] Adjust right positioning for MiniMap and ZoomControlsModal components * [style] Adjust right positioning for MiniMap and ZoomControlsModal components --------- Co-authored-by: github-actions <github-actions@github.com> Co-authored-by: Christian Byrne <cbyrne@comfy.org>
94 lines
3.1 KiB
TypeScript
94 lines
3.1 KiB
TypeScript
import { expect } from '@playwright/test'
|
|
|
|
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
|
|
|
|
test.describe('Minimap', () => {
|
|
test.beforeEach(async ({ comfyPage }) => {
|
|
await comfyPage.setSetting('Comfy.UseNewMenu', 'Top')
|
|
await comfyPage.setSetting('Comfy.Minimap.Visible', true)
|
|
await comfyPage.setSetting('Comfy.Graph.CanvasMenu', true)
|
|
await comfyPage.loadWorkflow('default')
|
|
await comfyPage.page.waitForFunction(
|
|
() => window['app'] && window['app'].canvas
|
|
)
|
|
})
|
|
|
|
test('Validate minimap is visible by default', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
const minimapCanvas = minimapContainer.locator('.minimap-canvas')
|
|
await expect(minimapCanvas).toBeVisible()
|
|
|
|
const minimapViewport = minimapContainer.locator('.minimap-viewport')
|
|
await expect(minimapViewport).toBeVisible()
|
|
|
|
await expect(minimapContainer).toHaveCSS('position', 'relative')
|
|
|
|
// position and z-index validation moved to the parent container of the minimap
|
|
const minimapMainContainer = comfyPage.page.locator(
|
|
'.minimap-main-container'
|
|
)
|
|
await expect(minimapMainContainer).toHaveCSS('position', 'absolute')
|
|
await expect(minimapMainContainer).toHaveCSS('z-index', '1000')
|
|
})
|
|
|
|
test('Validate minimap toggle button state', async ({ comfyPage }) => {
|
|
// Open zoom controls dropdown first
|
|
const zoomControlsButton = comfyPage.page.getByTestId(
|
|
'zoom-controls-button'
|
|
)
|
|
await zoomControlsButton.click()
|
|
|
|
const toggleButton = comfyPage.page.getByTestId('toggle-minimap-button')
|
|
|
|
await expect(toggleButton).toBeVisible()
|
|
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
await expect(minimapContainer).toBeVisible()
|
|
})
|
|
|
|
test('Validate minimap can be toggled off and on', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
|
|
// Open zoom controls dropdown first
|
|
const zoomControlsButton = comfyPage.page.getByTestId(
|
|
'zoom-controls-button'
|
|
)
|
|
await zoomControlsButton.click()
|
|
|
|
const toggleButton = comfyPage.page.getByTestId('toggle-minimap-button')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
await toggleButton.click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).not.toBeVisible()
|
|
await expect(toggleButton).toContainText('Show Minimap')
|
|
|
|
await toggleButton.click()
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
await expect(toggleButton).toContainText('Hide Minimap')
|
|
})
|
|
|
|
test('Validate minimap keyboard shortcut Alt+M', async ({ comfyPage }) => {
|
|
const minimapContainer = comfyPage.page.locator('.litegraph-minimap')
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
|
|
await comfyPage.page.keyboard.press('Alt+KeyM')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).not.toBeVisible()
|
|
|
|
await comfyPage.page.keyboard.press('Alt+KeyM')
|
|
await comfyPage.nextFrame()
|
|
|
|
await expect(minimapContainer).toBeVisible()
|
|
})
|
|
})
|