Repository navigation
[backport core/1.55] fix(dialog): keep modal size independent of the docked Agent panel #20125
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 } | ||
| ) | ||
| } |
| 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 } | ||
| ) | ||
| }) | ||
| }) | ||
| }) |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,16 +5,16 @@ export const dialogContentVariants = cva({ | |||||||||||||||||||||||||||||||||||||
| base: 'fixed z-1700 flex flex-col rounded-lg border border-border-subtle bg-base-background shadow-lg outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', | ||||||||||||||||||||||||||||||||||||||
| variants: { | ||||||||||||||||||||||||||||||||||||||
| size: { | ||||||||||||||||||||||||||||||||||||||
| sm: 'sm:max-w-[min(24rem,calc(100vw-var(--workspace-inset-right,0px)-1rem))]', | ||||||||||||||||||||||||||||||||||||||
| md: 'sm:max-w-[min(36rem,calc(100vw-var(--workspace-inset-right,0px)-1rem))]', | ||||||||||||||||||||||||||||||||||||||
| lg: 'sm:max-w-[min(48rem,calc(100vw-var(--workspace-inset-right,0px)-1rem))]', | ||||||||||||||||||||||||||||||||||||||
| xl: 'sm:max-w-[min(64rem,calc(100vw-var(--workspace-inset-right,0px)-1rem))]', | ||||||||||||||||||||||||||||||||||||||
| full: 'sm:max-w-[calc(100vw-var(--workspace-inset-right,0px)-1rem)]' | ||||||||||||||||||||||||||||||||||||||
| sm: 'sm:max-w-96', | ||||||||||||||||||||||||||||||||||||||
| md: 'sm:max-w-xl', | ||||||||||||||||||||||||||||||||||||||
| lg: 'sm:max-w-3xl', | ||||||||||||||||||||||||||||||||||||||
| xl: 'sm:max-w-5xl', | ||||||||||||||||||||||||||||||||||||||
| full: 'sm:max-w-[calc(100vw-1rem)]' | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| maximized: { | ||||||||||||||||||||||||||||||||||||||
| true: 'inset-2 top-2 left-2 size-auto max-h-none max-w-none sm:max-w-none', | ||||||||||||||||||||||||||||||||||||||
| false: | ||||||||||||||||||||||||||||||||||||||
| 'top-1/2 left-[calc(50%-var(--workspace-inset-right,0px)/2)] max-h-[85vh] w-[calc(100vw-1rem)] -translate-1/2' | ||||||||||||||||||||||||||||||||||||||
| 'top-1/2 left-1/2 max-h-[85vh] w-[calc(100vw-1rem)] translate-x-[max(calc(min(0.5rem,100vw-100%)-50vw),calc(-50%-var(--workspace-inset-right,0px)/2))] -translate-y-1/2' | ||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium — Moving the panel offset out of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed. These four
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Measured, and the diagnosis needs correcting: this is not a source-level issue in #20002. Those four #19729 (merged 2026-10-02, two days before #20002) deleted all four of them and routed every viewer entry point — HDR, Assets, Job History, Agent reply, the node, and viewer controls — through one shared
It clears the panel at every width. There is nothing dead and nothing to repair at source. The regression is real, but it is release-line-only, and it is caused by #19729 being absent there rather than by anything #20002 did.
So the "x=192 → x=8" figure is right, and the override is genuinely inert in row 2 — but row 1 was already overlapping the panel by 228px. The 192px position was never correct docked behaviour; #19729 is what made it correct, and #20002 reduced the overlap from 228px to 44px rather than introducing it. That makes this an already-merged bug-fix dependency of the carrier, so the unblock is to carry #19729 to the release lines, not to patch #20125 or change I have not touched the release branches — this comment is measurement only. Separately, the gap that let this reach review is now closed at source: #20136 pins the viewer's docked-panel geometry at 1280px and 1920px. The guard in
christian-byrne marked this conversation as resolved.
Resolved
christian-byrne marked this conversation as resolved.
Resolved
|
||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||
| defaultVariants: { | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -36,3 +36,8 @@ const sizes = [ | |||||||||||||||||||||||||||||||||||||
| ] as const satisfies Array<DialogContentSize> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export const FOR_STORIES = { sizes } as const | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export const HUG_CONTENT_CLASS = | ||||||||||||||||||||||||||||||||||||||
| 'w-fit max-w-[calc(100vw-1rem)] sm:max-w-[calc(100vw-1rem)]' | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| export const SELF_STYLED_PANEL_CONTENT_CLASS = `${HUG_CONTENT_CLASS} border-none bg-transparent shadow-none` | ||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.