diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/layout-shell.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/layout-shell.tsx index 96d77d131..22f68edab 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/layout-shell.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/layout-shell.tsx @@ -3,7 +3,6 @@ import { BookText, Bot, - Brain, CircleUser, Earth, ImageIcon, @@ -27,7 +26,6 @@ export type SearchSpaceSettingsTab = | "vision-models" | "team-roles" | "prompts" - | "team-memory" | "public-links"; const DEFAULT_TAB: SearchSpaceSettingsTab = "general"; @@ -89,11 +87,6 @@ export function SearchSpaceSettingsLayoutShell({ label: t("nav_system_instructions"), icon: , }, - { - value: "team-memory" as const, - label: "Team Memory", - icon: , - }, { value: "public-links" as const, label: t("nav_public_links"), diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx deleted file mode 100644 index 0652b012e..000000000 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { TeamMemoryManager } from "@/components/settings/team-memory-manager"; - -export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { - const { search_space_id } = await params; - return ; -} diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx deleted file mode 100644 index c7cb3d1d4..000000000 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx +++ /dev/null @@ -1,150 +0,0 @@ -"use client"; - -import { useAtomValue } from "jotai"; -import { ChevronDown, ClipboardCopy, Download, Info } from "lucide-react"; -import { toast } from "sonner"; -import { activeSearchSpaceIdAtom } from "@/atoms/search-spaces/search-space-query.atoms"; -import { PlateEditor } from "@/components/editor/plate-editor"; -import { Alert, AlertDescription } from "@/components/ui/alert"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { Spinner } from "@/components/ui/spinner"; -import { getMemoryLimitState, useUserMemory } from "@/hooks/use-memory"; - -export function MemoryContent() { - const activeSearchSpaceId = useAtomValue(activeSearchSpaceIdAtom); - const { memory, displayMemory, limits, loading, saving, reset } = useUserMemory( - Number(activeSearchSpaceId) - ); - - const handleClear = async () => { - try { - await reset(); - toast.success("Memory cleared"); - } catch { - toast.error("Failed to clear memory"); - } - }; - - const handleDownload = () => { - if (!memory) return; - try { - const blob = new Blob([memory], { type: "text/markdown;charset=utf-8" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = "personal-memory.md"; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); - } catch { - toast.error("Failed to download memory"); - } - }; - - const handleCopyMarkdown = async () => { - if (!memory) return; - try { - await navigator.clipboard.writeText(memory); - toast.success("Copied to clipboard"); - } catch { - toast.error("Failed to copy memory"); - } - }; - - const charCount = memory.length; - const limitState = getMemoryLimitState(charCount, limits); - - const getCounterColor = () => { - if (limitState.level === "error") return "text-red-500"; - if (limitState.level === "warning") return "text-orange-500"; - return "text-muted-foreground"; - }; - - if (loading) { - return ( -
- -
- ); - } - - if (!memory) { - return ( -
-

What does SurfSense remember?

-

- Nothing yet. SurfSense picks up on your preferences and context as you chat. -

-
- ); - } - - return ( -
- - - -

- SurfSense uses this personal memory to personalize your responses across all - conversations. -

-
-
- -
-
- -
-
- -
- {limitState.label} -
- - - - - - - - - Copy as Markdown - - - - Download as Markdown - - - -
-
-
- ); -} diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx index 820021622..037568db3 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx @@ -1,7 +1,6 @@ "use client"; import { - Brain, CircleUser, Keyboard, KeyRound, @@ -26,7 +25,6 @@ export type UserSettingsTab = | "api-key" | "prompts" | "community-prompts" - | "memory" | "agent-permissions" | "agent-status" | "purchases" @@ -75,11 +73,6 @@ export function UserSettingsLayoutShell({ searchSpaceId, children }: UserSetting label: "Community Prompts", icon: , }, - { - value: "memory" as const, - label: "Memory", - icon: , - }, { value: "agent-permissions" as const, label: "Agent Permissions", diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/memory/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/memory/page.tsx deleted file mode 100644 index b10c5bce5..000000000 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/memory/page.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { MemoryContent } from "../components/MemoryContent"; - -export default function Page() { - return ; -} diff --git a/surfsense_web/components/settings/team-memory-manager.tsx b/surfsense_web/components/settings/team-memory-manager.tsx deleted file mode 100644 index 4a730d45f..000000000 --- a/surfsense_web/components/settings/team-memory-manager.tsx +++ /dev/null @@ -1,151 +0,0 @@ -"use client"; - -import { ChevronDown, ClipboardCopy, Download, Info } from "lucide-react"; -import { toast } from "sonner"; -import { PlateEditor } from "@/components/editor/plate-editor"; -import { Alert, AlertDescription } from "@/components/ui/alert"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { Spinner } from "@/components/ui/spinner"; -import { getMemoryLimitState, useTeamMemory } from "@/hooks/use-memory"; - -interface TeamMemoryManagerProps { - searchSpaceId: number; -} - -export function TeamMemoryManager({ searchSpaceId }: TeamMemoryManagerProps) { - const { memory, displayMemory, limits, loading, saving, reset } = useTeamMemory(searchSpaceId); - - const handleClear = async () => { - try { - await reset(); - toast.success("Team memory cleared"); - } catch { - toast.error("Failed to clear team memory"); - } - }; - - const handleDownload = () => { - if (!memory) return; - try { - const blob = new Blob([memory], { type: "text/markdown;charset=utf-8" }); - const url = URL.createObjectURL(blob); - const a = document.createElement("a"); - a.href = url; - a.download = "team-memory.md"; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - URL.revokeObjectURL(url); - } catch { - toast.error("Failed to download team memory"); - } - }; - - const handleCopyMarkdown = async () => { - if (!memory) return; - try { - await navigator.clipboard.writeText(memory); - toast.success("Copied to clipboard"); - } catch { - toast.error("Failed to copy team memory"); - } - }; - - const charCount = memory.length; - const limitState = getMemoryLimitState(charCount, limits); - - const getCounterColor = () => { - if (limitState.level === "error") return "text-red-500"; - if (limitState.level === "warning") return "text-orange-500"; - return "text-muted-foreground"; - }; - - if (loading) { - return ( -
- -
- ); - } - - if (!memory) { - return ( -
-

- What does SurfSense remember about your team? -

-

- Nothing yet. SurfSense picks up on team decisions and conventions as your team chats. -

-
- ); - } - - return ( -
- - - -

- SurfSense uses this shared memory to provide team-wide context across all conversations - in this search space. -

-
-
- -
-
- -
-
- -
- {limitState.label} -
- - - - - - - - - Copy as Markdown - - - - Download as Markdown - - - -
-
-
- ); -}