diff --git a/src/app/views/NavigationPanesView.tsx b/src/app/views/NavigationPanesView.tsx index a904a8b38..ab9531ba9 100644 --- a/src/app/views/NavigationPanesView.tsx +++ b/src/app/views/NavigationPanesView.tsx @@ -368,7 +368,7 @@ export function NavigationPanesView({ onSettingsSectionChange={onSettingsSectionChange} renderInlineSessionList={ !collapsed - ? (searchQuery) => ( + ? () => ( null, showTopDivider: true, diff --git a/src/app/views/__tests__/NavigationPanesView.test.tsx b/src/app/views/__tests__/NavigationPanesView.test.tsx index 215335956..dad869a89 100644 --- a/src/app/views/__tests__/NavigationPanesView.test.tsx +++ b/src/app/views/__tests__/NavigationPanesView.test.tsx @@ -630,59 +630,16 @@ describe("NavigationPanesView", () => { ).toBeInTheDocument(); }); - it("shows the sidebar search field by default", () => { + it("does not show a search field in the sidebar", () => { renderSidebar(); + expect(screen.queryByRole("searchbox")).not.toBeInTheDocument(); expect( - screen.getByRole("searchbox", { name: "Jump to a chat" }), - ).toHaveAttribute("spellcheck", "false"); - expect( - screen.getByRole("searchbox", { name: "Jump to a chat" }), - ).toHaveAttribute("autocorrect", "off"); - expect( - screen.getByRole("searchbox", { name: "Jump to a chat" }), - ).toHaveAttribute("autocapitalize", "none"); - expect( - screen.queryByRole("button", { name: "Clear" }), + screen.queryByRole("button", { name: "Jump to a chat" }), ).not.toBeInTheDocument(); expect(screen.getByTestId("nav-settings")).toHaveAccessibleName("Settings"); }); - it("clears the sidebar search query with the clear button", async () => { - const user = userEvent.setup(); - renderSidebar(); - - const search = screen.getByRole("searchbox", { name: "Jump to a chat" }); - await user.type(search, "profile"); - await user.click(screen.getByRole("button", { name: "Clear" })); - - expect(search).toHaveValue(""); - expect(search).toHaveFocus(); - expect( - screen.queryByRole("button", { name: "Clear" }), - ).not.toBeInTheDocument(); - expect(screen.getByTestId("nav-settings")).toBeInTheDocument(); - }); - - it("selects a filtered chat before search collapses on blur", async () => { - const user = userEvent.setup(); - const onSelectSession = vi.fn(); - seedSessions({ - id: "profile-chat", - title: "Profile polish", - updatedAt: "2026-04-09T12:00:00.000Z", - messageCount: 3, - }); - - renderSidebar({ onSelectSession }); - - const search = screen.getByRole("searchbox", { name: "Jump to a chat" }); - await user.type(search, "profile"); - await user.click(screen.getByRole("button", { name: "Profile polish" })); - - expect(onSelectSession).toHaveBeenCalledWith("profile-chat"); - }); - it("moves roving focus through main sidebar rows", () => { renderSidebar(); diff --git a/src/features/navigation/ui/PrimaryNavigationSurface.tsx b/src/features/navigation/ui/PrimaryNavigationSurface.tsx index 1d903cc64..7380ac4aa 100644 --- a/src/features/navigation/ui/PrimaryNavigationSurface.tsx +++ b/src/features/navigation/ui/PrimaryNavigationSurface.tsx @@ -5,17 +5,9 @@ import { type KeyboardEventHandler, type ReactNode, type Ref, - useEffect, - useRef, - useState, } from "react"; import { useTranslation } from "react-i18next"; -import { - IconArrowLeft, - IconSearch, - IconServer, - IconX, -} from "@tabler/icons-react"; +import { IconArrowLeft, IconServer } from "@tabler/icons-react"; import { ArrowUpCircle } from "lucide-react"; import type { AppView } from "@/app/AppShell"; import { PaneSurface } from "@/app/layout/panes/paneChrome"; @@ -25,9 +17,9 @@ import { type SectionId, } from "@/features/settings/ui/settingsSections"; import { cn } from "@/shared/lib/cn"; -import { Button } from "@/shared/ui/button"; import { SIDEBAR_PANEL_ELEVATED_SHADOW_CLASS, + SIDEBAR_PRIMARY_NAV_TOP_INSET_CLASS, SIDEBAR_SECTION_DIVIDER_INSET_CLASS, } from "@/shared/ui/sidebar-tokens"; import { SidebarNavItem } from "./SidebarNavItem"; @@ -62,7 +54,7 @@ interface PrimaryNavigationSurfaceProps { onSettingsBack?: () => void; onSettingsClick?: () => void; onSettingsSectionChange?: (section: SectionId) => void; - renderInlineSessionList?: (searchQuery: string) => ReactNode; + renderInlineSessionList?: () => ReactNode; secondaryNavRef: Ref; settingsSections: readonly (typeof SETTINGS_SECTIONS)[number][]; showBottomMask: boolean; @@ -107,30 +99,7 @@ export const PrimaryNavigationSurface = forwardRef< }, ref, ) { - const { t } = useTranslation(["sidebar", "common", "settings"]); - const searchInputRef = useRef(null); - const [searchExpanded, setSearchExpanded] = useState(!navCollapsed); - const [searchQuery, setSearchQuery] = useState(""); - const expandSearch = () => { - setSearchExpanded(true); - window.requestAnimationFrame(() => searchInputRef.current?.focus()); - }; - useEffect(() => { - if (navCollapsed) { - setSearchQuery(""); - return; - } - setSearchExpanded(true); - }, [navCollapsed]); - useEffect(() => { - const focusSearch = () => { - setSearchExpanded(true); - window.requestAnimationFrame(() => searchInputRef.current?.focus()); - }; - window.addEventListener("goose:focus-nav-search", focusSearch); - return () => - window.removeEventListener("goose:focus-nav-search", focusSearch); - }, []); + const { t } = useTranslation(["sidebar", "settings"]); const mainNavItems: readonly { id: AppView; label: string; @@ -169,7 +138,10 @@ export const PrimaryNavigationSurface = forwardRef< fullHeight width={width} > -