diff --git a/apps/web/src/components/os/AppShell.tsx b/apps/web/src/components/os/AppShell.tsx index 877f5db..895147c 100644 --- a/apps/web/src/components/os/AppShell.tsx +++ b/apps/web/src/components/os/AppShell.tsx @@ -22,6 +22,7 @@ import BootScreen from './BootScreen'; import StatusBar from './StatusBar'; import RouteTransition from './RouteTransition'; import Sidebar, { type SidebarNavItem } from './Sidebar'; +import MobileNav from './MobileNav'; import AppErrorBoundary from './ErrorBoundary'; import { adapter } from '@/lib/adapter'; import { pickUserName } from '@/lib/user-name'; @@ -473,7 +474,9 @@ const ShellLayout = () => { unreadNotifications={unreadCount} onSearchClick={() => ov.setShowGlobalSearch(true)} onNotificationClick={ov.toggleNotifications} /> -
+ {/* Below sm the bottom bar (MobileNav, 56px plus the safe-area inset) + replaces the rail, so the canvas stops above it. */} +
{/* Warm-Hive calm spine (ia.html) — five places + workspace pill + ⌘K tile + user row; all remaining depth lives in ⌘K. */} {
+ ov.setShowGlobalSearch(true)} /> {/* Overlays — Desktop.tsx:569-663 relocated; handlers retarget to navigate() per §1.2 / §2.2. */} diff --git a/apps/web/src/components/os/MobileNav.tsx b/apps/web/src/components/os/MobileNav.tsx new file mode 100644 index 0000000..6330e52 --- /dev/null +++ b/apps/web/src/components/os/MobileNav.tsx @@ -0,0 +1,72 @@ +import { useLocation, useNavigate } from "react-router-dom"; +import { Search } from "lucide-react"; +import { isNavItemActive } from "@/lib/nav-items"; +import type { SidebarNavItem } from "./Sidebar"; + +interface MobileNavProps { + spine: SidebarNavItem[]; + onOpenCommand: () => void; +} + +/** + * Phone-width navigation (below sm). The sidebar rail would take a fifth of a + * 375px screen, so the five everyday places sit in a bottom bar instead and + * "More" opens ⌘K, which reaches everything else: workspaces, settings, a new + * agent. AppShell reserves the bar's height so it never covers content. + */ +const MobileNav = ({ spine, onOpenCommand }: MobileNavProps) => { + const navigate = useNavigate(); + const { pathname } = useLocation(); + const itemClass = + "relative flex min-h-[56px] min-w-0 flex-col items-center justify-center gap-1 px-1 text-[10.5px] transition-colors"; + + return ( + + ); +}; + +export default MobileNav; diff --git a/apps/web/src/components/os/Sidebar.tsx b/apps/web/src/components/os/Sidebar.tsx index 91e8333..0e3db83 100644 --- a/apps/web/src/components/os/Sidebar.tsx +++ b/apps/web/src/components/os/Sidebar.tsx @@ -3,6 +3,7 @@ import { useLocation, useNavigate } from "react-router-dom"; import { ChevronDown, Palette, Plus, Search } from "lucide-react"; import { cmdKLabel } from "@/lib/platform"; import { useDesignMode } from "@/lib/design-mode"; +import { isNavItemActive } from "@/lib/nav-items"; import { HintTooltip } from "@/components/ui/hint-tooltip"; import { TooltipProvider } from "@/components/ui/tooltip"; @@ -74,10 +75,7 @@ const Sidebar = ({ const [design, setDesign] = useDesignMode(); const calm = design === "calm"; - const isActive = (item: SidebarNavItem): boolean => - item.activeWhen - ? item.activeWhen(pathname) - : item.match.some((p) => pathname === p || pathname.startsWith(`${p}/`)); + const isActive = (item: SidebarNavItem): boolean => isNavItemActive(item, pathname); const renderNavItem = (item: SidebarNavItem) => { const active = isActive(item); @@ -131,7 +129,9 @@ const Sidebar = ({