diff --git a/ui/goose2/src/app/AppShell.tsx b/ui/goose2/src/app/AppShell.tsx index 89a75d9558..bf51f0585f 100644 --- a/ui/goose2/src/app/AppShell.tsx +++ b/ui/goose2/src/app/AppShell.tsx @@ -637,6 +637,7 @@ export function AppShell({ children }: { children?: React.ReactNode }) { style={{ width: sidebarCollapsed ? 0 : sidebarWidth + 12, paddingTop: 12, + paddingBottom: 12, paddingLeft: 12, transition: isResizing ? "none" : "width 200ms ease-out", }} @@ -659,7 +660,6 @@ export function AppShell({ children }: { children?: React.ReactNode }) { onMoveToProject={handleMoveToProject} onReorderProject={projectStore.reorderProjects} onSelectSession={handleSelectSession} - onSelectSearchResult={handleSelectSearchResult} activeView={activeView} activeSessionId={activeSessionId} projects={projectStore.projects} diff --git a/ui/goose2/src/features/chat/ui/ChatInput.tsx b/ui/goose2/src/features/chat/ui/ChatInput.tsx index 9df70f22ea..5ccb967aeb 100644 --- a/ui/goose2/src/features/chat/ui/ChatInput.tsx +++ b/ui/goose2/src/features/chat/ui/ChatInput.tsx @@ -362,14 +362,14 @@ export function ChatInput({ return ( -
+
{/* biome-ignore lint/a11y/noStaticElementInteractions: drop zone for file attachments */}
diff --git a/ui/goose2/src/features/sidebar/ui/Sidebar.tsx b/ui/goose2/src/features/sidebar/ui/Sidebar.tsx index 481286df31..0cd18f4d14 100644 --- a/ui/goose2/src/features/sidebar/ui/Sidebar.tsx +++ b/ui/goose2/src/features/sidebar/ui/Sidebar.tsx @@ -1,8 +1,6 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; -import { BookOpen, Bot, History, Home, Search } from "lucide-react"; -import { getDisplaySessionTitle } from "@/features/chat/lib/sessionTitle"; -import { GooseIcon } from "@/shared/ui/icons/GooseIcon"; +import { BookOpen, Bot, History, Home } from "lucide-react"; import { cn } from "@/shared/lib/cn"; import type { AppView } from "@/app/types"; import type { ProjectInfo } from "@/features/projects/api/projects"; @@ -12,11 +10,7 @@ import { useChatSessionStore, } from "@/features/chat/stores/chatSessionStore"; import { isSessionRunning } from "@/features/chat/lib/sessionActivity"; -import { useAgentStore } from "@/features/agents/stores/agentStore"; -import { useProjectStore } from "@/features/projects/stores/projectStore"; -import { useSessionSearch } from "@/features/sessions/hooks/useSessionSearch"; import { SidebarProjectsSection } from "./SidebarProjectsSection"; -import { SidebarSearchResults } from "./SidebarSearchResults"; import { useSidebarHighlight } from "./useSidebarHighlight"; interface SidebarProps { @@ -34,11 +28,6 @@ interface SidebarProps { onReorderProject?: (fromId: string, toId: string) => void; onNavigate?: (view: AppView) => void; onSelectSession?: (sessionId: string) => void; - onSelectSearchResult?: ( - sessionId: string, - messageId?: string, - query?: string, - ) => void; activeView?: AppView; activeSessionId?: string | null; className?: string; @@ -62,15 +51,13 @@ export function Sidebar({ onReorderProject, onNavigate, onSelectSession, - onSelectSearchResult, activeView, activeSessionId, className, projects, }: SidebarProps) { - const { t, i18n } = useTranslation(["sidebar", "common"]); + const { t } = useTranslation("sidebar"); const [expanded, setExpanded] = useState(!collapsed); - const searchInputRef = useRef(null); const prevCollapsed = useRef(collapsed); const [expandedProjects, setExpandedProjects] = useState< Record @@ -92,10 +79,6 @@ export function Sidebar({ sessions, chatStore.messagesBySession, ); - const activeSessions = visibleSessions.filter( - (session) => !session.archivedAt, - ); - useEffect(() => { if (collapsed) { setExpanded(false); @@ -110,7 +93,6 @@ export function Sidebar({ const labelTransition = "transition-[opacity,width] duration-300 ease-out"; const labelVisible = expanded && !collapsed; - const defaultTitle = t("common:session.defaultTitle"); const navItems: readonly { id: AppView; label: string; icon: typeof Bot }[] = [ { id: "agents", label: t("navigation.agents"), icon: Bot }, @@ -171,24 +153,6 @@ export function Sidebar({ return { byProject, standalone: limitedStandalone }; })(); - const agentStoreState = useAgentStore(); - const projectStoreState = useProjectStore(); - - const sidebarResolvers = { - getPersonaName: (personaId: string) => - agentStoreState.getPersonaById(personaId)?.displayName, - getProjectName: (projectId: string) => - projectStoreState.projects.find((p: { id: string }) => p.id === projectId) - ?.name, - }; - const sidebarSearch = useSessionSearch({ - sessions: activeSessions, - resolvers: sidebarResolvers, - locale: i18n.resolvedLanguage, - getDisplayTitle: (session) => - getDisplaySessionTitle(session.title, defaultTitle), - }); - useEffect(() => { if (!activeSessionId) return; const activeSession = visibleSessions.find((s) => s.id === activeSessionId); @@ -227,17 +191,6 @@ export function Sidebar({ }); }, [projects]); - useEffect(() => { - const handler = (e: KeyboardEvent) => { - if (e.key === "k" && e.metaKey) { - e.preventDefault(); - searchInputRef.current?.focus(); - } - }; - window.addEventListener("keydown", handler); - return () => window.removeEventListener("keydown", handler); - }, []); - const toggleProject = (projectId: string) => setExpandedProjects((prev) => ({ ...prev, [projectId]: !prev[projectId] })); @@ -298,13 +251,9 @@ export function Sidebar({ WebkitBackdropFilter: "blur(12px)", }} > -
- -
-
diff --git a/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx b/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx index fafe0763ab..6abb30e71a 100644 --- a/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx +++ b/ui/goose2/src/features/sidebar/ui/SidebarProjectsSection.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { IconChevronDown, IconChevronRight, + IconFolder, IconLibraryPlusFilled, IconMessage, IconPlus, @@ -154,15 +155,11 @@ function ProjectSection({ : PROJECT_ROW_TEXT_CLASS, )} > - - + {isExpanded ? ( - + ) : ( - + )} @@ -330,11 +327,11 @@ export function SidebarProjectsSection({ : "opacity-0 max-h-0 overflow-hidden", )} > -
+
onNavigate?.("projects")} className="rounded-lg text-muted-foreground hover:text-foreground hover:bg-accent/50" > - + ))}
@@ -468,11 +462,11 @@ export function SidebarProjectsSection({ onDragLeave={handleRecentsDragLeave} onDrop={handleRecentsDrop} > -
+
void; - getPersonaName: (personaId: string) => string | undefined; - getProjectName: (projectId: string) => string | undefined; -} - -export function SidebarSearchResults({ - results, - activeSessionId, - onSelectResult, - getPersonaName, - getProjectName, -}: SidebarSearchResultsProps) { - const { t } = useTranslation(["sidebar", "sessions", "common"]); - - if (results.length === 0) { - return ( -
-

- {t("sessions:history.emptyNoMatches")} -

-

{t("sessions:history.emptyNoMatchesHint")}

-
- ); - } - - return ( -
- {results.map((result) => { - const session = result.session; - const displayTitle = getDisplaySessionTitle( - session.title, - t("common:session.defaultTitle"), - ); - const personaName = session.personaId - ? getPersonaName(session.personaId) - : undefined; - const projectName = session.projectId - ? getProjectName(session.projectId) - : undefined; - - return ( - - ); - })} -
- ); -} diff --git a/ui/goose2/src/shared/i18n/locales/en/sidebar.json b/ui/goose2/src/shared/i18n/locales/en/sidebar.json index 114b0ce61a..69743c058f 100644 --- a/ui/goose2/src/shared/i18n/locales/en/sidebar.json +++ b/ui/goose2/src/shared/i18n/locales/en/sidebar.json @@ -16,11 +16,6 @@ "sessionHistory": "Session History", "skills": "Skills" }, - "search": { - "error": "Message search failed. Showing metadata matches only.", - "placeholder": "Search conversations", - "searching": "Searching chats..." - }, "sections": { "projects": "Projects", "recents": "Recents" diff --git a/ui/goose2/src/shared/i18n/locales/es/sidebar.json b/ui/goose2/src/shared/i18n/locales/es/sidebar.json index 9bd9008e6d..ef100e0031 100644 --- a/ui/goose2/src/shared/i18n/locales/es/sidebar.json +++ b/ui/goose2/src/shared/i18n/locales/es/sidebar.json @@ -16,11 +16,6 @@ "sessionHistory": "Historial de sesiones", "skills": "Habilidades" }, - "search": { - "error": "La búsqueda de mensajes falló. Mostrando solo coincidencias de metadatos.", - "placeholder": "Buscar conversaciones", - "searching": "Buscando chats..." - }, "sections": { "projects": "Proyectos", "recents": "Recientes"