mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
refactor: restructure BaseModalLayout from flexbox to CSS Grid (#8211)
## 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 `<Transition>` 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 <amp@ampcode.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user