From b94ef0a46c81ab3559ecef9bcaa46ff3d3fdf49f Mon Sep 17 00:00:00 2001 From: Lemon Date: Fri, 20 Mar 2026 23:33:42 -0700 Subject: [PATCH] Cleanup: scope drawer clip-path ID with useId(), fix indentation, add layout comments --- src/components/Feed.tsx | 3 ++ src/components/MainLayout.tsx | 6 +++ src/components/MobileDrawer.tsx | 19 ++++----- src/pages/AIChatPage.tsx | 72 ++++++++++++++++----------------- 4 files changed, 55 insertions(+), 45 deletions(-) diff --git a/src/components/Feed.tsx b/src/components/Feed.tsx index af821c85..8fff7596 100644 --- a/src/components/Feed.tsx +++ b/src/components/Feed.tsx @@ -280,6 +280,9 @@ export function Feed({ kinds, tagFilters, header, hideCompose, emptyMessage, fee /> )} + {/* Compose box and header render *after* the tab bar so that tabs stay + at the top as the primary navigation element on every feed page. + This is intentional — see commits 3e7edf65, 82fe6f2f. */} {!hideCompose && } {header} diff --git a/src/components/MainLayout.tsx b/src/components/MainLayout.tsx index 73957085..26ec016f 100644 --- a/src/components/MainLayout.tsx +++ b/src/components/MainLayout.tsx @@ -88,6 +88,12 @@ function MainLayoutInner() { {/* Main content + right sidebar: inside Suspense so the left sidebar persists while lazy pages load */} }> + {/* -mt-mobile-bar pulls content up behind the mobile top bar so the + transparent SVG header arc and page content overlap seamlessly. + The corresponding padding-top (set in CSS) prevents content from + being hidden. This depends on MobileTopBar having a transparent / + semi-transparent background — a solid top bar would obscure the + content underneath. Only active below the sidebar breakpoint. */}
{showFAB && ( diff --git a/src/components/MobileDrawer.tsx b/src/components/MobileDrawer.tsx index 842f5165..d167439e 100644 --- a/src/components/MobileDrawer.tsx +++ b/src/components/MobileDrawer.tsx @@ -1,4 +1,4 @@ -import { useState, useMemo } from 'react'; +import { useState, useId, useMemo } from 'react'; import { useNavigate, useLocation } from 'react-router-dom'; import { ChevronDown, ChevronUp, LogOut, UserPlus, Loader2 } from 'lucide-react'; import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'; @@ -32,11 +32,10 @@ import { resolveTheme, resolveThemeConfig } from '@/themes'; /** Total width of the drawer background layer: 300px drawer + 36px arc overhang. */ const DRAWER_BG_WIDTH = 336; -/** Shared clip-path style for the drawer arc background layers. */ -const drawerClipStyle: React.CSSProperties = { - width: DRAWER_BG_WIDTH, - clipPath: 'url(#drawer-arc-clip)', -}; +/** Build the shared clip-path style for the drawer arc background layers. */ +function drawerClipStyle(clipId: string): React.CSSProperties { + return { width: DRAWER_BG_WIDTH, clipPath: `url(#${clipId})` }; +} interface MobileDrawerProps { open: boolean; @@ -44,6 +43,8 @@ interface MobileDrawerProps { } export function MobileDrawer({ open, onOpenChange }: MobileDrawerProps) { + const clipId = `${useId()}-drawer-arc-clip`; + const clipStyle = drawerClipStyle(clipId); const location = useLocation(); const navigate = useNavigate(); const { user, metadata, event: currentUserEvent } = useCurrentUser(); @@ -115,7 +116,7 @@ export function MobileDrawer({ open, onOpenChange }: MobileDrawerProps) { drawer while the extra 36px overflows for the curved bulge. */}
{hasBgImage && (
)} Navigation menu diff --git a/src/pages/AIChatPage.tsx b/src/pages/AIChatPage.tsx index 5fc4f6b3..620ae414 100644 --- a/src/pages/AIChatPage.tsx +++ b/src/pages/AIChatPage.tsx @@ -419,43 +419,43 @@ export function AIChatPage() {
} className="px-0 mt-0 mb-0" /> -
- {/* Model selector */} - +
+ {/* Model selector */} + - -
+ +
{/* Messages Area */}