-
Notifications
You must be signed in to change notification settings - Fork 511
feat: position properties panel opposite to sidebar #7647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
683098e
feat: position properties panel opposite to sidebar
csongorczezar acb5229
fix: tests and i18n file
csongorczezar 0143b2b
fix: test
csongorczezar 22793fd
refactor: panel swapping based on sidebar location
csongorczezar 5a87e31
refactor: extracted style into computed property
csongorczezar aecf8d8
refactor: template string
csongorczezar 43d8619
fix: use useI18n composable instead of deprecated global t
csongorczezar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
browser_tests/tests/propertiesPanel/propertiesPanelPosition.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| import { expect } from '@playwright/test' | ||
|
|
||
| import { comfyPageFixture as test } from '../../fixtures/ComfyPage' | ||
|
|
||
| test.describe('Properties panel position', () => { | ||
| test.beforeEach(async ({ comfyPage }) => { | ||
| // Open a sidebar tab to ensure sidebar is visible | ||
| await comfyPage.menu.nodeLibraryTab.open() | ||
| await comfyPage.actionbar.propertiesButton.click() | ||
| }) | ||
|
|
||
| test('positions on the right when sidebar is on the left', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.setSetting('Comfy.Sidebar.Location', 'left') | ||
| await comfyPage.nextFrame() | ||
|
|
||
| const propertiesPanel = comfyPage.page.getByTestId('properties-panel') | ||
| const sidebar = comfyPage.page.locator('.side-bar-panel').first() | ||
|
|
||
| await expect(propertiesPanel).toBeVisible() | ||
| await expect(sidebar).toBeVisible() | ||
|
|
||
| const propsBoundingBox = await propertiesPanel.boundingBox() | ||
| const sidebarBoundingBox = await sidebar.boundingBox() | ||
|
|
||
| expect(propsBoundingBox).not.toBeNull() | ||
| expect(sidebarBoundingBox).not.toBeNull() | ||
|
|
||
| // Properties panel should be to the right of the sidebar | ||
| expect(propsBoundingBox!.x).toBeGreaterThan( | ||
| sidebarBoundingBox!.x + sidebarBoundingBox!.width | ||
| ) | ||
| }) | ||
|
|
||
| test('positions on the left when sidebar is on the right', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.setSetting('Comfy.Sidebar.Location', 'right') | ||
| await comfyPage.nextFrame() | ||
|
|
||
| const propertiesPanel = comfyPage.page.getByTestId('properties-panel') | ||
| const sidebar = comfyPage.page.locator('.side-bar-panel').first() | ||
|
|
||
| await expect(propertiesPanel).toBeVisible() | ||
| await expect(sidebar).toBeVisible() | ||
|
|
||
| const propsBoundingBox = await propertiesPanel.boundingBox() | ||
| const sidebarBoundingBox = await sidebar.boundingBox() | ||
|
|
||
| expect(propsBoundingBox).not.toBeNull() | ||
| expect(sidebarBoundingBox).not.toBeNull() | ||
|
|
||
| // Properties panel should be to the left of the sidebar | ||
| expect(propsBoundingBox!.x + propsBoundingBox!.width).toBeLessThan( | ||
| sidebarBoundingBox!.x | ||
| ) | ||
| }) | ||
|
|
||
| test('close button icon updates based on sidebar location', async ({ | ||
| comfyPage | ||
| }) => { | ||
| const propertiesPanel = comfyPage.page.getByTestId('properties-panel') | ||
|
|
||
| // When sidebar is on the left, panel is on the right | ||
| await comfyPage.setSetting('Comfy.Sidebar.Location', 'left') | ||
| await comfyPage.nextFrame() | ||
|
|
||
| await expect(propertiesPanel).toBeVisible() | ||
| const closeButtonLeft = propertiesPanel | ||
| .locator('button[aria-pressed]') | ||
| .locator('i') | ||
| await expect(closeButtonLeft).toBeVisible() | ||
| await expect(closeButtonLeft).toHaveClass(/lucide--panel-right/) | ||
|
|
||
| // When sidebar is on the right, panel is on the left | ||
| await comfyPage.setSetting('Comfy.Sidebar.Location', 'right') | ||
| await comfyPage.nextFrame() | ||
|
|
||
| const closeButtonRight = propertiesPanel | ||
| .locator('button[aria-pressed]') | ||
| .locator('i') | ||
| await expect(closeButtonRight).toBeVisible() | ||
| await expect(closeButtonRight).toHaveClass(/lucide--panel-left/) | ||
| }) | ||
csongorczezar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.