From 3ae3cc81fcb1756d0f07f6a67530fe509c53a79b Mon Sep 17 00:00:00 2001 From: "shumeiko.it" Date: Tue, 27 Oct 2026 14:36:35 +0100 Subject: [PATCH] fix(web): give phones a bottom navigation bar instead of the rail (UF-057) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At 375px the 64px icon rail took a fifth of the screen and Home's heading wrapped over five lines. Below sm the rail hides, a bottom bar carries the five places plus More (⌘K), and Home tightens its padding and heading. --- apps/web/src/components/os/AppShell.tsx | 6 +- apps/web/src/components/os/MobileNav.tsx | 72 +++++++++++++++++++ apps/web/src/components/os/Sidebar.tsx | 10 +-- .../src/components/os/apps/HomeCockpit.tsx | 12 ++-- apps/web/src/lib/nav-items.ts | 8 +++ apps/web/src/test/mobile-nav.test.tsx | 63 ++++++++++++++++ docs/oss/upstream-fixes.md | 10 +++ 7 files changed, 169 insertions(+), 12 deletions(-) create mode 100644 apps/web/src/components/os/MobileNav.tsx create mode 100644 apps/web/src/lib/nav-items.ts create mode 100644 apps/web/src/test/mobile-nav.test.tsx 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 = ({