diff --git a/components/Layout.js b/components/Layout.js index 47df0e8..d07f8e9 100644 --- a/components/Layout.js +++ b/components/Layout.js @@ -87,12 +87,10 @@ function UserProfileDropdown({ user, onMobileMenuClose }) { {/* Menu — Liquid Glass popover, high-tint w/ ember-subtle rim. */}
@@ -693,14 +691,12 @@ export default function Layout({ children, user = null, showSearch = false }) { {/* Mobile Menu Drawer - Slides in from left when "More" is tapped */}
diff --git a/components/ui/TopSearchBar.js b/components/ui/TopSearchBar.js index ce2ca06..1e3b409 100644 --- a/components/ui/TopSearchBar.js +++ b/components/ui/TopSearchBar.js @@ -211,11 +211,8 @@ function UserMenu({ user }) {
{ expect(container.textContent).not.toContain('Guest'); }); }); + +describe('Layout — floating popovers use .glass-panel-strong (regression: Brief 3 of unify-glass-panel-surfaces)', () => { + afterEach(() => cleanup()); + + // The sidebar UserProfileDropdown and the mobile drawer are floating + // glass surfaces. Brief 3 migrated them from inline + // `background: var(--glass-surface-*)` + `backdropFilter` to the + // canonical `.glass-panel-strong` className. If a future PR reverts + // either to the inline pattern, the bespoke-glass-surface CI gate + // (Brief 7) will catch the regression — these unit tests catch the + // SAME regression at the component-render level, before the gate + // would fire. + + it('mobile drawer panel carries .glass-panel-strong when isMobileMenuOpen', () => { + const { container } = render( + page body + ); + // The drawer is rendered (translated off-screen via `-translate-x-full`) + // even when closed, so we can assert on it from a default mount. + const drawer = container.querySelector( + '.glass-panel-strong.md\\:hidden.fixed.inset-y-0.left-0' + ); + expect(drawer).not.toBeNull(); + expect(drawer.className).toContain('glass-panel-strong'); + expect(drawer.className).toContain('w-64'); + }); + + it('mobile drawer panel does NOT carry an inline `background: var(--glass-surface-*)` style after Brief 3', () => { + // Regression lock against reverting Brief 3 to handrolled inline + // glass styles on the mobile drawer specifically. The drawer is + // always in the DOM (translated off-screen when closed), so we can + // query it from a default mount. + const { container } = render( + page body + ); + const drawer = container.querySelector( + '.glass-panel-strong.md\\:hidden.fixed.inset-y-0.left-0' + ); + expect(drawer).not.toBeNull(); + const inlineStyle = drawer.getAttribute('style') ?? ''; + expect(inlineStyle).not.toMatch(/var\(--glass-surface-/); + expect(inlineStyle).not.toMatch(/backdrop-filter/i); + expect(inlineStyle).toContain('box-shadow'); + expect(inlineStyle).toContain('--elevation-pronounced'); + }); +});