From 2026bc80bf041786717116c40b2bf0b145d495da Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Sat, 3 Oct 2026 00:19:33 +0000 Subject: [PATCH 1/5] fix(settings): keep the Settings dialog inside the workspace inset The Settings dialog passed a raw `sm:max-w-[1280px]` contentClass, which tailwind-merge resolved over the inset-aware cap on the `size: 'full'` dialog variant. The variant's centering (`left: calc(50% - inset/2)`) survived, so the dialog was sized against the full viewport but centred on the workspace the docked Agent panel leaves behind, overflowing equally off the left edge and into the panel. Cap both max-width utilities with the workspace inset, matching the pattern applied to the 3D viewers in #19729. --- .../composables/useSettingsDialog.test.ts | 21 +++++++++++++++---- .../settings/composables/useSettingsDialog.ts | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/platform/settings/composables/useSettingsDialog.test.ts b/src/platform/settings/composables/useSettingsDialog.test.ts index 4e0636cf0e3..d0bc5786f50 100644 --- a/src/platform/settings/composables/useSettingsDialog.test.ts +++ b/src/platform/settings/composables/useSettingsDialog.test.ts @@ -52,13 +52,26 @@ describe('useSettingsDialog', () => { expect(args.key).toBe('global-settings') expect(args.dialogComponentProps.renderer).toBe('reka') expect(args.dialogComponentProps.size).toBe('full') - expect(args.dialogComponentProps.contentClass).toContain('max-w-[1280px]') - expect(args.dialogComponentProps.contentClass).not.toContain( - 'max-w-[960px]' - ) + expect(args.dialogComponentProps.contentClass).toContain('1280px') + expect(args.dialogComponentProps.contentClass).not.toContain('960px') expect(args.dialogComponentProps.contentClass).toContain('h-[80vh]') }) + it('show() reserves the docked Agent panel width in every max-width cap', () => { + useSettingsDialog().show() + const [args] = showDialog.mock.calls[0] + const maxWidthCaps = String(args.dialogComponentProps.contentClass) + .split(' ') + .filter((utility) => /(^|:)max-w-\[/.test(utility)) + + expect(maxWidthCaps).not.toHaveLength(0) + expect( + maxWidthCaps.filter( + (cap) => !cap.includes('var(--workspace-inset-right,0px)') + ) + ).toEqual([]) + }) + it('show() uses non-modal Reka so nested PrimeVue dialogs keep focus and pointer events', () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] diff --git a/src/platform/settings/composables/useSettingsDialog.ts b/src/platform/settings/composables/useSettingsDialog.ts index c39d7b58b89..d8ab45bb6a5 100644 --- a/src/platform/settings/composables/useSettingsDialog.ts +++ b/src/platform/settings/composables/useSettingsDialog.ts @@ -9,7 +9,7 @@ const DIALOG_KEY = 'global-settings' // The redesigned Settings dialog is 1280px wide (DES 3253-16079). const SETTINGS_CONTENT_CLASS = - 'w-[90vw] max-w-[1280px] sm:max-w-[1280px] h-[80vh] max-h-none rounded-2xl overflow-hidden' + 'w-[90vw] max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] sm:max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] h-[80vh] max-h-none rounded-2xl overflow-hidden' export function useSettingsDialog() { const dialogService = useDialogService() From 2335fd9ba7e46e8609325df746f1694274f63e53 Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Sat, 3 Oct 2026 00:35:37 +0000 Subject: [PATCH 2/5] test(settings): lock the sm: max-width cap against tailwind-merge The sm: copy of the capped max-width reads as redundant, but removing it lets the `size: 'full'` variant's own uncapped `sm:max-w` win the merge, silently dropping the 1280px design cap above 640px. Assert the resolved class keeps both the design cap and the workspace inset, and say so above the constant. --- .../composables/useSettingsDialog.test.ts | 39 ++++++++++++++++--- .../settings/composables/useSettingsDialog.ts | 4 +- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/platform/settings/composables/useSettingsDialog.test.ts b/src/platform/settings/composables/useSettingsDialog.test.ts index d0bc5786f50..bfb6f571f4e 100644 --- a/src/platform/settings/composables/useSettingsDialog.test.ts +++ b/src/platform/settings/composables/useSettingsDialog.test.ts @@ -1,4 +1,6 @@ import { computed } from 'vue' +import { cn } from '@comfyorg/tailwind-utils' +import { dialogContentVariants } from '@/components/ui/dialog/dialog.variants' import { useBillingContext } from '@/composables/billing/useBillingContext' import { useDialogStore } from '@/stores/dialogStore' /** @@ -46,28 +48,53 @@ describe('useSettingsDialog', () => { isCloudRef.value = false }) + const maxWidthCapsFromLastShow = (): string[] => + String(showDialog.mock.calls[0][0].dialogComponentProps.contentClass) + .split(' ') + .filter((utility) => /(^|:)max-w-\[/.test(utility)) + it("show() opens the Reka renderer with size 'full' and 1280px content sizing", () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] expect(args.key).toBe('global-settings') expect(args.dialogComponentProps.renderer).toBe('reka') expect(args.dialogComponentProps.size).toBe('full') - expect(args.dialogComponentProps.contentClass).toContain('1280px') - expect(args.dialogComponentProps.contentClass).not.toContain('960px') expect(args.dialogComponentProps.contentClass).toContain('h-[80vh]') + + const caps = maxWidthCapsFromLastShow() + expect(caps).not.toHaveLength(0) + expect(caps.filter((cap) => !cap.includes('1280px'))).toEqual([]) + expect(caps.filter((cap) => cap.includes('960px'))).toEqual([]) }) it('show() reserves the docked Agent panel width in every max-width cap', () => { useSettingsDialog().show() + + const caps = maxWidthCapsFromLastShow() + expect(caps).not.toHaveLength(0) + expect( + caps.filter((cap) => !cap.includes('var(--workspace-inset-right,0px)')) + ).toEqual([]) + }) + + it("show() keeps both caps after cn() resolves them against the 'full' variant", () => { + useSettingsDialog().show() const [args] = showDialog.mock.calls[0] - const maxWidthCaps = String(args.dialogComponentProps.contentClass) + + const resolved = cn( + dialogContentVariants({ size: 'full', maximized: false }), + args.dialogComponentProps.contentClass + ) + const survivingCaps = resolved .split(' ') .filter((utility) => /(^|:)max-w-\[/.test(utility)) - expect(maxWidthCaps).not.toHaveLength(0) + expect(survivingCaps.some((cap) => cap.startsWith('sm:'))).toBe(true) expect( - maxWidthCaps.filter( - (cap) => !cap.includes('var(--workspace-inset-right,0px)') + survivingCaps.filter( + (cap) => + !cap.includes('1280px') || + !cap.includes('var(--workspace-inset-right,0px)') ) ).toEqual([]) }) diff --git a/src/platform/settings/composables/useSettingsDialog.ts b/src/platform/settings/composables/useSettingsDialog.ts index d8ab45bb6a5..795a91d5f80 100644 --- a/src/platform/settings/composables/useSettingsDialog.ts +++ b/src/platform/settings/composables/useSettingsDialog.ts @@ -7,7 +7,9 @@ import type { SettingPanelType } from '@/platform/settings/types' const DIALOG_KEY = 'global-settings' -// The redesigned Settings dialog is 1280px wide (DES 3253-16079). +// The redesigned Settings dialog is 1280px wide (DES 3253-16079), capped to the +// workspace a docked Agent panel leaves. The `sm:` copy is required: without it +// the `size: 'full'` variant's uncapped `sm:max-w` wins tailwind-merge above 640px. const SETTINGS_CONTENT_CLASS = 'w-[90vw] max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] sm:max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] h-[80vh] max-h-none rounded-2xl overflow-hidden' From fc46385e83b05a3196d0d8a21519a25066983278 Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Sat, 3 Oct 2026 00:54:34 +0000 Subject: [PATCH 3/5] fix(settings): correct the sm: cap note and pin the base cap in tests The variant's sm:max-w is workspace-capped, not uncapped - it only lacks the 1280px bound. Also assert an unprefixed cap survives the merge, so dropping the base max-width fails instead of passing on the sm: copy alone, and read the dialog args from lastCall as the helper name says. --- src/platform/settings/composables/useSettingsDialog.test.ts | 3 ++- src/platform/settings/composables/useSettingsDialog.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/platform/settings/composables/useSettingsDialog.test.ts b/src/platform/settings/composables/useSettingsDialog.test.ts index bfb6f571f4e..01925b5d391 100644 --- a/src/platform/settings/composables/useSettingsDialog.test.ts +++ b/src/platform/settings/composables/useSettingsDialog.test.ts @@ -49,7 +49,7 @@ describe('useSettingsDialog', () => { }) const maxWidthCapsFromLastShow = (): string[] => - String(showDialog.mock.calls[0][0].dialogComponentProps.contentClass) + String(showDialog.mock.lastCall?.[0].dialogComponentProps.contentClass) .split(' ') .filter((utility) => /(^|:)max-w-\[/.test(utility)) @@ -90,6 +90,7 @@ describe('useSettingsDialog', () => { .filter((utility) => /(^|:)max-w-\[/.test(utility)) expect(survivingCaps.some((cap) => cap.startsWith('sm:'))).toBe(true) + expect(survivingCaps.some((cap) => !cap.startsWith('sm:'))).toBe(true) expect( survivingCaps.filter( (cap) => diff --git a/src/platform/settings/composables/useSettingsDialog.ts b/src/platform/settings/composables/useSettingsDialog.ts index 795a91d5f80..35c0feb08a1 100644 --- a/src/platform/settings/composables/useSettingsDialog.ts +++ b/src/platform/settings/composables/useSettingsDialog.ts @@ -9,7 +9,7 @@ const DIALOG_KEY = 'global-settings' // The redesigned Settings dialog is 1280px wide (DES 3253-16079), capped to the // workspace a docked Agent panel leaves. The `sm:` copy is required: without it -// the `size: 'full'` variant's uncapped `sm:max-w` wins tailwind-merge above 640px. +// the `size: 'full'` variant's workspace-only `sm:max-w` drops the 1280px bound. const SETTINGS_CONTENT_CLASS = 'w-[90vw] max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] sm:max-w-[min(1280px,calc(100vw-var(--workspace-inset-right,0px)-1rem))] h-[80vh] max-h-none rounded-2xl overflow-hidden' From 7e52e65542e2a8b8f7d40e67609360bffdd304f6 Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Sat, 3 Oct 2026 01:14:09 +0000 Subject: [PATCH 4/5] test(settings): pin the workspace-aware centering the cap depends on Nothing asserted dialog.variants.ts's inset-aware `left`, so dropping it would silently restore the overflow with every test green. Resolve the real variant for the size the dialog actually requests, tolerate Tailwind's underscore spelling of the var, and correct the stale 960px docblock. --- .../composables/useSettingsDialog.test.ts | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/src/platform/settings/composables/useSettingsDialog.test.ts b/src/platform/settings/composables/useSettingsDialog.test.ts index 01925b5d391..cd885aa1b5d 100644 --- a/src/platform/settings/composables/useSettingsDialog.test.ts +++ b/src/platform/settings/composables/useSettingsDialog.test.ts @@ -1,13 +1,14 @@ import { computed } from 'vue' import { cn } from '@comfyorg/tailwind-utils' +import type { DialogContentSize } from '@/components/ui/dialog/dialog.variants' import { dialogContentVariants } from '@/components/ui/dialog/dialog.variants' import { useBillingContext } from '@/composables/billing/useBillingContext' import { useDialogStore } from '@/stores/dialogStore' /** - * Settings dialog migration regression net: `useSettingsDialog().show()` must - * open the Reka-renderer path with sizing that matches the previous - * `BaseModalLayout size="sm"` (960px × 80vh). Catches accidental reverts of - * the Phase 3 renderer flip. + * Settings dialog regression net: `useSettingsDialog().show()` must open the + * Reka-renderer path at the 1280px design width, capped to the workspace a + * docked Agent panel leaves. Catches accidental reverts of the Phase 3 + * renderer flip and of the workspace-inset cap. */ import { beforeEach, describe, expect, it, vi } from 'vitest' @@ -48,6 +49,19 @@ describe('useSettingsDialog', () => { isCloudRef.value = false }) + const RESERVES_INSET = /var\(--workspace-inset-right,_?0px\)/ + + const resolveAgainstVariant = (args: { + dialogComponentProps: { size: DialogContentSize; contentClass: string } + }): string => + cn( + dialogContentVariants({ + size: args.dialogComponentProps.size, + maximized: false + }), + args.dialogComponentProps.contentClass + ) + const maxWidthCapsFromLastShow = (): string[] => String(showDialog.mock.lastCall?.[0].dialogComponentProps.contentClass) .split(' ') @@ -72,19 +86,14 @@ describe('useSettingsDialog', () => { const caps = maxWidthCapsFromLastShow() expect(caps).not.toHaveLength(0) - expect( - caps.filter((cap) => !cap.includes('var(--workspace-inset-right,0px)')) - ).toEqual([]) + expect(caps.filter((cap) => !RESERVES_INSET.test(cap))).toEqual([]) }) it("show() keeps both caps after cn() resolves them against the 'full' variant", () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] - const resolved = cn( - dialogContentVariants({ size: 'full', maximized: false }), - args.dialogComponentProps.contentClass - ) + const resolved = resolveAgainstVariant(args) const survivingCaps = resolved .split(' ') .filter((utility) => /(^|:)max-w-\[/.test(utility)) @@ -93,13 +102,25 @@ describe('useSettingsDialog', () => { expect(survivingCaps.some((cap) => !cap.startsWith('sm:'))).toBe(true) expect( survivingCaps.filter( - (cap) => - !cap.includes('1280px') || - !cap.includes('var(--workspace-inset-right,0px)') + (cap) => !cap.includes('1280px') || !RESERVES_INSET.test(cap) ) ).toEqual([]) }) + it('show() keeps the workspace-aware centering that the cap is sized for', () => { + useSettingsDialog().show() + const [args] = showDialog.mock.calls[0] + + const horizontalPlacement = resolveAgainstVariant(args) + .split(' ') + .filter((utility) => /(^|:)left-/.test(utility)) + + expect(horizontalPlacement).not.toHaveLength(0) + expect( + horizontalPlacement.filter((utility) => !RESERVES_INSET.test(utility)) + ).toEqual([]) + }) + it('show() uses non-modal Reka so nested PrimeVue dialogs keep focus and pointer events', () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] From 7ebcb86ada06da8a19f17592c81720abdee633bd Mon Sep 17 00:00:00 2001 From: Glary-Bot Date: Sat, 3 Oct 2026 01:53:31 +0000 Subject: [PATCH 5/5] test(settings): fold the raw-class cap checks into the resolved assertion The raw contentClass width and inset checks restated what the resolved-cap assertion already covers, since the call site's caps always survive the merge. Keep one assertion over the resolved classes and leave the first test to the dialog props. Placement coverage is unchanged. Mutation-checked: reverting to plain 1280px caps, dropping either cap, reverting the design width to 960px, or dropping dialog.variants.ts's inset-aware left each still fails exactly one test. --- .../composables/useSettingsDialog.test.ts | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/platform/settings/composables/useSettingsDialog.test.ts b/src/platform/settings/composables/useSettingsDialog.test.ts index cd885aa1b5d..236516fdfc4 100644 --- a/src/platform/settings/composables/useSettingsDialog.test.ts +++ b/src/platform/settings/composables/useSettingsDialog.test.ts @@ -62,39 +62,20 @@ describe('useSettingsDialog', () => { args.dialogComponentProps.contentClass ) - const maxWidthCapsFromLastShow = (): string[] => - String(showDialog.mock.lastCall?.[0].dialogComponentProps.contentClass) - .split(' ') - .filter((utility) => /(^|:)max-w-\[/.test(utility)) - - it("show() opens the Reka renderer with size 'full' and 1280px content sizing", () => { + it("show() opens the Reka renderer with size 'full'", () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] expect(args.key).toBe('global-settings') expect(args.dialogComponentProps.renderer).toBe('reka') expect(args.dialogComponentProps.size).toBe('full') expect(args.dialogComponentProps.contentClass).toContain('h-[80vh]') - - const caps = maxWidthCapsFromLastShow() - expect(caps).not.toHaveLength(0) - expect(caps.filter((cap) => !cap.includes('1280px'))).toEqual([]) - expect(caps.filter((cap) => cap.includes('960px'))).toEqual([]) - }) - - it('show() reserves the docked Agent panel width in every max-width cap', () => { - useSettingsDialog().show() - - const caps = maxWidthCapsFromLastShow() - expect(caps).not.toHaveLength(0) - expect(caps.filter((cap) => !RESERVES_INSET.test(cap))).toEqual([]) }) - it("show() keeps both caps after cn() resolves them against the 'full' variant", () => { + it('show() caps both breakpoints at 1280px within the docked Agent panel inset', () => { useSettingsDialog().show() const [args] = showDialog.mock.calls[0] - const resolved = resolveAgainstVariant(args) - const survivingCaps = resolved + const survivingCaps = resolveAgainstVariant(args) .split(' ') .filter((utility) => /(^|:)max-w-\[/.test(utility))