From 2db246f494b42bb65bd034571c2388b8d6c7e11f Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Wed, 21 Jan 2026 13:20:39 -0800 Subject: [PATCH] refactor: restructure BaseModalLayout from flexbox to CSS Grid (#8211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Refactors `BaseModalLayout` from a flexbox-based layout to CSS Grid, enabling smoother panel transitions and improved layout control. ## Changes ### Layout Restructure - **Flexbox → CSS Grid**: Replaced nested flexbox with a 3-column CSS Grid (`nav | main | aside`) - **Smooth panel transitions**: Panel show/hide now animates via `grid-template-columns` instead of Vue `` with `translateX` - **Removed transition CSS**: Deleted `.slide-panel-*` and `.fade-*` transition styles (no longer needed with grid approach) ### Right Panel Improvements - **Dedicated header**: Added header with close button, right panel toggle, and customizable title slot (`rightPanelHeaderTitle`, `rightPanelHeaderActions`) - **New prop**: Added `rightPanelTitle` prop for simple text title in right panel header ### UX & Accessibility - **ESC key handling**: Pressing Escape closes the right panel (if open) before closing the dialog - **Accessibility**: Added `aria-label` attributes to all panel toggle and close buttons - **i18n**: Added translation keys: `showLeftPanel`, `hideLeftPanel`, `showRightPanel`, `hideRightPanel`, `closeDialog` --------- Co-authored-by: Amp --- browser_tests/tests/templates.spec.ts | 7 +- .../widget/layout/BaseModalLayout.vue | 279 ++++++++++-------- src/locales/en/main.json | 5 + 3 files changed, 161 insertions(+), 130 deletions(-) diff --git a/browser_tests/tests/templates.spec.ts b/browser_tests/tests/templates.spec.ts index 977f3f6df..ae7e3747d 100644 --- a/browser_tests/tests/templates.spec.ts +++ b/browser_tests/tests/templates.spec.ts @@ -189,9 +189,7 @@ test.describe('Templates', () => { const templateGrid = comfyPage.page.locator( '[data-testid="template-workflows-content"]' ) - const nav = comfyPage.page - .locator('header') - .filter({ hasText: 'Templates' }) + const nav = comfyPage.page.locator('header', { hasText: 'Templates' }) await comfyPage.templates.waitForMinimumCardCount(1) await expect(templateGrid).toBeVisible() @@ -201,7 +199,8 @@ test.describe('Templates', () => { await comfyPage.page.setViewportSize(mobileSize) await comfyPage.templates.waitForMinimumCardCount(1) await expect(templateGrid).toBeVisible() - await expect(nav).not.toBeVisible() // Nav should collapse at mobile size + // Nav header is clipped by overflow-hidden parent at mobile size + await expect(nav).not.toBeInViewport() const tabletSize = { width: 1024, height: 800 } await comfyPage.page.setViewportSize(tabletSize) diff --git a/src/components/widget/layout/BaseModalLayout.vue b/src/components/widget/layout/BaseModalLayout.vue index 0da7755af..148ea3ccd 100644 --- a/src/components/widget/layout/BaseModalLayout.vue +++ b/src/components/widget/layout/BaseModalLayout.vue @@ -1,100 +1,128 @@ @@ -102,27 +130,29 @@ diff --git a/src/locales/en/main.json b/src/locales/en/main.json index ef7b858b4..749273d20 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -100,6 +100,11 @@ "no": "No", "cancel": "Cancel", "close": "Close", + "closeDialog": "Close dialog", + "showLeftPanel": "Show left panel", + "hideLeftPanel": "Hide left panel", + "showRightPanel": "Show right panel", + "hideRightPanel": "Hide right panel", "or": "or", "pressKeysForNewBinding": "Press keys for new binding", "defaultBanner": "default banner",