From 187ad46bc9a95e653808a83112067bc34c74a901 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Thu, 9 Apr 2026 15:06:35 +0530 Subject: [PATCH] refactor: integrate PlateEditor for memory input in MemoryContent and TeamMemoryManager components, enhancing user experience with alerts and improved layout --- .../components/MemoryContent.tsx | 59 +++++++++-------- .../components/editor/plate-editor.tsx | 2 +- .../settings/team-memory-manager.tsx | 63 ++++++++++--------- 3 files changed, 66 insertions(+), 58 deletions(-) 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 index cee450788..a7534b2a1 100644 --- 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 @@ -1,12 +1,13 @@ "use client"; +import { Info } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; import { toast } from "sonner"; import { z } from "zod"; +import { Alert, AlertDescription } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; -import { Label } from "@/components/ui/label"; +import { PlateEditor } from "@/components/editor/plate-editor"; import { Spinner } from "@/components/ui/spinner"; -import { Textarea } from "@/components/ui/textarea"; import { baseApiService } from "@/lib/apis/base-api.service"; const MEMORY_HARD_LIMIT = 25_000; @@ -69,6 +70,11 @@ export function MemoryContent() { } }; + const handleMarkdownChange = useCallback((md: string) => { + const trimmed = md.trim(); + setMemory(trimmed); + }, []); + const hasChanges = memory !== savedMemory; const charCount = memory.length; const isOverLimit = charCount > MEMORY_HARD_LIMIT; @@ -90,33 +96,32 @@ export function MemoryContent() { return (
-
-
-
- -

- This is your personal memory document. The AI assistant reads it at the start of - every conversation and uses it to personalize responses. You can edit it directly - or let the assistant update it during conversations. -

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