Repository navigation
fix(dialog): keep modal size independent of the docked Agent panel #20002
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
10 commits
Select commit
Hold shift + click to select a range
709e1fe
fix(dialog): keep modal size independent of the docked Agent panel
d91e71f
test(dialog): pin the sm breakpoint and the reported viewport for the…
90d8854
fix(dialog): clamp overridden widths to viewport
christian-byrne 902eb43
test: share the agent panel minimum width
christian-byrne 79bb5fc
fix(dialog): isolate horizontal inset transform
christian-byrne 2a0cacb
fix(dialog): keep the inset offset on translate and cap the gutter
aab99d0
test(dialog): require entrance probe to observe dialog
christian-byrne ba2f360
test(dialog): assert literal positions for real dialogs only
DrJKL 74951c9
refactor(dialog): share the self-styled content class and drop redund…
DrJKL 1d3d36d
test(dialog): name the docked-panel bounds assertion for what it checks
DrJKL 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
There are no files selected for viewing
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,28 @@ | ||
| import type { Locator, Page } from '@playwright/test' | ||
|
|
||
| import { WORKSPACE_INSET_RIGHT } from '@/composables/useWorkspaceInset' | ||
| import { comfyExpect } from '@e2e/fixtures/utils/customMatchers' | ||
|
|
||
| export async function expectDialogBoundsWithDockedPanel( | ||
| page: Page, | ||
| dialog: Locator, | ||
| { panelWidth, x }: { panelWidth: number; x: number } | ||
| ): Promise<void> { | ||
| await comfyExpect | ||
| .poll(() => dialog.evaluate((element) => element.getAnimations().length)) | ||
| .toBe(0) | ||
| const withoutPanel = await dialog.boundingBox() | ||
| if (!withoutPanel) throw new Error('Dialog is not laid out') | ||
|
|
||
| await page.evaluate( | ||
| ({ property, panelWidth }) => { | ||
| document.documentElement.style.setProperty(property, `${panelWidth}px`) | ||
| }, | ||
| { property: WORKSPACE_INSET_RIGHT, panelWidth } | ||
| ) | ||
|
|
||
| await comfyExpect(dialog).toHaveBounds( | ||
| { ...withoutPanel, x }, | ||
| { numDigits: 1 } | ||
| ) | ||
| } |
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,54 @@ | ||
| import { | ||
| comfyExpect as expect, | ||
| comfyPageFixture as test | ||
| } from '@e2e/fixtures/ComfyPage' | ||
| import { expectDialogBoundsWithDockedPanel } from '@e2e/fixtures/utils/workspaceInset' | ||
|
|
||
| test.describe('Dialog layout with a docked Agent panel', () => { | ||
| for (const { viewportWidth, x, outcome } of [ | ||
| { viewportWidth: 1440, x: 8, outcome: 'covers the panel from the gutter' }, | ||
| { viewportWidth: 1920, x: 50, outcome: 'centres beside the panel' } | ||
| ]) { | ||
| test.describe(`at a ${viewportWidth}px viewport`, () => { | ||
| test.use({ viewport: { width: viewportWidth, height: 800 } }) | ||
|
|
||
| test(`Templates browser keeps its size and ${outcome}`, async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.command.executeCommand('Comfy.BrowseTemplates') | ||
| await expect(comfyPage.templates.content).toBeVisible() | ||
|
|
||
| await expectDialogBoundsWithDockedPanel( | ||
| comfyPage.page, | ||
| comfyPage.templatesDialog.root, | ||
| { panelWidth: 420, x } | ||
| ) | ||
| }) | ||
| }) | ||
| } | ||
|
|
||
| test.describe('at the sm breakpoint', () => { | ||
| test.use({ viewport: { width: 640, height: 800 } }) | ||
|
|
||
| test('a size-variant dialog keeps its width and stops at the gutter', async ({ | ||
| comfyPage | ||
| }) => { | ||
| await comfyPage.page.evaluate(() => { | ||
| window | ||
| .app!.extensionManager.dialog.confirm({ | ||
| title: 'Confirm', | ||
| type: 'default', | ||
| message: 'Does this dialog keep its width?' | ||
| }) | ||
| .catch(() => {}) | ||
| }) | ||
| await expect(comfyPage.confirmDialog.root).toBeVisible() | ||
|
|
||
| await expectDialogBoundsWithDockedPanel( | ||
| comfyPage.page, | ||
| comfyPage.confirmDialog.root, | ||
| { panelWidth: 420, x: 8 } | ||
| ) | ||
| }) | ||
| }) | ||
| }) | ||
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
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
Oops, something went wrong.
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.