From 02caf98c7bd038bd03dd7984cdfe51ec2652491e Mon Sep 17 00:00:00 2001 From: johnnyjoygh Date: Thu, 3 Sep 2026 09:23:01 +0800 Subject: [PATCH] chore: separate the header brand from the navigator The space switcher and the navigator pills shared one grammar (rounded pill, same padding, 16-20px glyph, labels on the same rail), so the header read as two rows of a list. Make the brand a title (24px mark, 15px semibold, small chevron), keep only the bordered compose control in the header, move search to the trailing end of the navigator, and size the nav pills as 28px squares to match compose. --- web/src/components/AppSidebar/AppSidebar.tsx | 53 +++++++++++-------- .../components/AppSidebar/SpaceSwitcher.tsx | 14 +++-- .../components/AppSidebar/sidebar-layout.ts | 11 ++-- web/src/components/MemosLogo.tsx | 2 +- web/src/components/SpaceMark.tsx | 2 + 5 files changed, 49 insertions(+), 33 deletions(-) diff --git a/web/src/components/AppSidebar/AppSidebar.tsx b/web/src/components/AppSidebar/AppSidebar.tsx index 39eca063..b21e4281 100644 --- a/web/src/components/AppSidebar/AppSidebar.tsx +++ b/web/src/components/AppSidebar/AppSidebar.tsx @@ -63,8 +63,6 @@ import { import TagsSection from "./TagsSection"; import ViewsSection from "./ViewsSection"; -const SIDEBAR_HEADER_ACTION_CLASSES = - "size-7 shrink-0 rounded-md text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50"; const SIDEBAR_HEADER_PRIMARY_ACTION_CLASSES = "size-7 shrink-0 text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/50"; @@ -324,8 +322,9 @@ interface GlobalNavItem { } /** - * The compact navigator is intentionally horizontal. Its 16px glyph plus 8px padding - * on each side makes the collapsed control an exact 32px square. Expanding the + * The compact navigator is intentionally horizontal. Its 16px glyph plus 6px padding + * on each side makes the collapsed control an exact 28px square, the same box as the + * header's compose control. Expanding the * label only opens the text track, so the artwork and surface never jump. */ const navPillClasses = (active: boolean) => @@ -336,7 +335,7 @@ const NavPillLabel = ({ expanded, label, children }: { expanded: boolean; label: aria-hidden={!expanded || undefined} className={cn( "grid min-w-0 transition-[grid-template-columns,padding] duration-200 ease-out motion-reduce:transition-none", - expanded ? "grid-cols-[1fr] ps-2" : "grid-cols-[0fr] ps-0", + expanded ? "grid-cols-[1fr] ps-2.5" : "grid-cols-[0fr] ps-0", )} > @@ -353,7 +352,7 @@ const GlobalNavigation = () => { const location = useLocation(); const navigate = useNavigate(); const currentUser = useCurrentUser(); - const { memoDetail, memoScope, setMemoScope, setMobileOpen } = useAppSidebar(); + const { memoDetail, memoScope, setMemoScope, setMobileOpen, setQuickFindOpen } = useAppSidebar(); const { filters } = useMemoFilterContext(); const routeKind = getSidebarRouteKind(location.pathname); const resolvedScope = resolveMemoScope(location.pathname, { @@ -442,7 +441,7 @@ const GlobalNavigation = () => { return ( -