From d71ede3d00a5d6f749abde7a6592910dce05a6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorem=20Ju=C3=A1rez?= Date: Mon, 15 Jun 2026 13:46:27 -0600 Subject: [PATCH] Edge-to-edge mobile layout with safe-area insets The public menu (and editor) left a non-matching rectangular gap around the iPhone notch / dynamic island. Make the glassmorphism background go edge-to-edge while keeping interactive content clear of the unsafe regions. - viewport-fit=cover so the layout uses the full screen incl. behind the island - Safe-area utility classes (globals.css) built on env(safe-area-inset-*); they resolve to 0 on devices without insets, preserving previous spacing - Public menu: header padding-top, sticky section tabs offset, and floating action buttons (Ask AI / +) respect top/bottom insets - Editor: header padding-top and bottom tab bar respect top/bottom insets Verified: build passes; all safe-area classes survive Tailwind purge; rendered meta tag emits viewport-fit=cover. --- src/app/globals.css | 27 +++++++++++++++++++++++++++ src/app/layout.tsx | 3 +++ src/components/editor/Editor.tsx | 4 ++-- src/components/public/PublicMenu.tsx | 6 +++--- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 349b7cb..9f63d24 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -92,3 +92,30 @@ body { -ms-overflow-style: none; scrollbar-width: none; } + +/* Safe-area helpers for edge-to-edge layout (viewport-fit=cover). + The background covers behind the notch / dynamic island and gesture bar, while + interactive content is padded so it isn't covered. On devices without insets + env() resolves to 0, so spacing matches the previous values. */ +@layer utilities { + /* public menu header */ + .safe-pt-header { + padding-top: calc(env(safe-area-inset-top, 0px) + 1.25rem); + } + /* editor header */ + .safe-pt-editor { + padding-top: calc(env(safe-area-inset-top, 0px) + 1rem); + } + /* sticky section tabs keep clear of the island when scrolled */ + .safe-top-sticky { + top: calc(env(safe-area-inset-top, 0px) + 0.5rem); + } + /* public floating action buttons clear the gesture bar */ + .safe-bottom-fab { + bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); + } + /* editor bottom tab bar clears the gesture bar */ + .safe-pb-tabbar { + padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem); + } +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 3ccd715..1d80308 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -25,6 +25,9 @@ export const viewport: Viewport = { initialScale: 1, maximumScale: 1, themeColor: '#f4f1ec', + // Use the full screen incl. the area behind the notch / dynamic island so the + // glassmorphism background goes edge-to-edge; content respects safe areas via CSS. + viewportFit: 'cover', }; export default async function RootLayout({ diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx index 83a8d51..facf47d 100644 --- a/src/components/editor/Editor.tsx +++ b/src/components/editor/Editor.tsx @@ -28,7 +28,7 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s ]; return ( -
+

{data.name}

@@ -67,7 +67,7 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s )} {/* Bottom tab bar */} -