+
diff --git a/apps/web/app/onboarding-old/page.tsx b/apps/web/app/onboarding-old/page.tsx
deleted file mode 100644
index dcf64ad0..00000000
--- a/apps/web/app/onboarding-old/page.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { getSession } from "@lib/auth"
-import { OnboardingForm } from "./onboarding-form"
-import { OnboardingProvider } from "./onboarding-context"
-import { OnboardingProgressBar } from "./progress-bar"
-import { redirect } from "next/navigation"
-import { OnboardingBackground } from "./onboarding-background"
-import type { Metadata } from "next"
-export const metadata: Metadata = {
- title: "Welcome to Supermemory",
- description: "We're excited to have you on board.",
-}
-
-export default function OnboardingPage() {
- const session = getSession()
-
- if (!session) redirect("/login")
-
- return (
-
-
-
-
-
-
- )
-}
diff --git a/apps/web/app/onboarding-old/animated-text.tsx b/apps/web/app/onboarding/animated-text.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/animated-text.tsx
rename to apps/web/app/onboarding/animated-text.tsx
diff --git a/apps/web/app/onboarding-old/bio-form.tsx b/apps/web/app/onboarding/bio-form.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/bio-form.tsx
rename to apps/web/app/onboarding/bio-form.tsx
diff --git a/apps/web/app/onboarding-old/extension-form.tsx b/apps/web/app/onboarding/extension-form.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/extension-form.tsx
rename to apps/web/app/onboarding/extension-form.tsx
diff --git a/apps/web/app/onboarding-old/floating-orbs.tsx b/apps/web/app/onboarding/floating-orbs.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/floating-orbs.tsx
rename to apps/web/app/onboarding/floating-orbs.tsx
diff --git a/apps/web/app/onboarding-old/intro.tsx b/apps/web/app/onboarding/intro.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/intro.tsx
rename to apps/web/app/onboarding/intro.tsx
diff --git a/apps/web/app/onboarding-old/mcp-form.tsx b/apps/web/app/onboarding/mcp-form.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/mcp-form.tsx
rename to apps/web/app/onboarding/mcp-form.tsx
diff --git a/apps/web/app/onboarding-old/name-form.tsx b/apps/web/app/onboarding/name-form.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/name-form.tsx
rename to apps/web/app/onboarding/name-form.tsx
diff --git a/apps/web/app/onboarding-old/nav-menu.tsx b/apps/web/app/onboarding/nav-menu.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/nav-menu.tsx
rename to apps/web/app/onboarding/nav-menu.tsx
diff --git a/apps/web/app/onboarding-old/onboarding-background.tsx b/apps/web/app/onboarding/onboarding-background.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/onboarding-background.tsx
rename to apps/web/app/onboarding/onboarding-background.tsx
diff --git a/apps/web/app/onboarding-old/onboarding-context.tsx b/apps/web/app/onboarding/onboarding-context.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/onboarding-context.tsx
rename to apps/web/app/onboarding/onboarding-context.tsx
diff --git a/apps/web/app/onboarding-old/onboarding-form.tsx b/apps/web/app/onboarding/onboarding-form.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/onboarding-form.tsx
rename to apps/web/app/onboarding/onboarding-form.tsx
diff --git a/apps/web/app/onboarding/page.tsx b/apps/web/app/onboarding/page.tsx
index f3d8a769..dcf64ad0 100644
--- a/apps/web/app/onboarding/page.tsx
+++ b/apps/web/app/onboarding/page.tsx
@@ -1,267 +1,26 @@
-"use client"
-
-import { useSearchParams } from "next/navigation"
-import { motion, AnimatePresence } from "motion/react"
-import { useState, useEffect } from "react"
-import { useAuth } from "@lib/auth-context"
-import { cn } from "@lib/utils"
-
-import { InputStep } from "./welcome/input-step"
-import { GreetingStep } from "./welcome/greeting-step"
-import { WelcomeStep } from "./welcome/welcome-step"
-import { ContinueStep } from "./welcome/continue-step"
-import { FeaturesStep } from "./welcome/features-step"
-import { MemoriesStep } from "./welcome/memories-step"
-import { RelatableQuestion } from "./setup/relatable-question"
-import { IntegrationsStep } from "./setup/integrations-step"
-
-import { InitialHeader } from "@/components/initial-header"
-import { SetupHeader } from "./setup/header"
-import { ChatSidebar } from "./setup/chat-sidebar"
-import { Logo } from "@ui/assets/Logo"
-import NovaOrb from "@/components/nova/nova-orb"
-import { AnimatedGradientBackground } from "@/components/new/animated-gradient-background"
-
-function UserSupermemory({ name }: { name: string }) {
- return (
-
-
-
-
- {name.split(" ")[0]}'s
-
-
- supermemory
-
-
-
- )
+import { getSession } from "@lib/auth"
+import { OnboardingForm } from "./onboarding-form"
+import { OnboardingProvider } from "./onboarding-context"
+import { OnboardingProgressBar } from "./progress-bar"
+import { redirect } from "next/navigation"
+import { OnboardingBackground } from "./onboarding-background"
+import type { Metadata } from "next"
+export const metadata: Metadata = {
+ title: "Welcome to Supermemory",
+ description: "We're excited to have you on board.",
}
export default function OnboardingPage() {
- const searchParams = useSearchParams()
- const { user } = useAuth()
+ const session = getSession()
- const flow = searchParams.get("flow") as "welcome" | "setup" | null
- const step = searchParams.get("step") as string | null
-
- const [name, setName] = useState(user?.name ?? "")
- const [isSubmitting, setIsSubmitting] = useState(false)
- const [memoryFormData, setMemoryFormData] = useState<{
- twitter: string
- linkedin: string
- description: string
- otherLinks: string[]
- } | null>(null)
- const [showWelcomeContent, setShowWelcomeContent] = useState(false)
-
- const currentFlow = flow || "welcome"
- const currentStep = step || "input"
-
- useEffect(() => {
- if (user?.name) {
- setName(user.name)
- localStorage.setItem("username", user.name)
- }
- }, [user?.name])
-
- useEffect(() => {
- if (currentFlow === "welcome" && currentStep === "input") {
- setShowWelcomeContent(false)
- const timer = setTimeout(() => {
- setShowWelcomeContent(true)
- }, 1250)
- return () => clearTimeout(timer)
- }
- }, [currentFlow, currentStep])
-
- useEffect(() => {
- if (currentFlow !== "welcome") return
-
- const timers: NodeJS.Timeout[] = []
-
- switch (currentStep) {
- case "greeting":
- timers.push(
- setTimeout(() => {
- // Auto-advance to welcome step
- window.history.replaceState(
- null,
- "",
- "/onboarding?flow=welcome&step=welcome",
- )
- }, 2000),
- )
- break
- case "welcome":
- timers.push(
- setTimeout(() => {
- // Auto-advance to username step
- window.history.replaceState(
- null,
- "",
- "/onboarding?flow=welcome&step=username",
- )
- }, 2000),
- )
- break
- }
-
- return () => {
- timers.forEach(clearTimeout)
- }
- }, [currentStep, currentFlow])
-
- const handleSubmit = () => {
- localStorage.setItem("username", name)
- if (name.trim()) {
- setIsSubmitting(true)
- window.history.replaceState(
- null,
- "",
- "/onboarding?flow=welcome&step=greeting",
- )
- setIsSubmitting(false)
- }
- }
-
- const renderWelcomeStep = () => {
- switch (currentStep) {
- case "input":
- return (
-
- )
- case "greeting":
- return
- case "welcome":
- return
- case "username":
- return
- case "features":
- return
- case "memories":
- return
- default:
- return null
- }
- }
-
- const renderSetupStep = () => {
- switch (currentStep) {
- case "relatable":
- return
- case "integrations":
- return
- default:
- return null
- }
- }
-
- const isWelcomeFlow = currentFlow === "welcome"
- const isSetupFlow = currentFlow === "setup"
-
- const minimizeNovaOrb =
- isWelcomeFlow && ["features", "memories"].includes(currentStep)
- const novaSize = currentStep === "memories" ? 150 : 300
-
- const showUserSupermemory = isWelcomeFlow && currentStep === "username"
+ if (!session) redirect("/login")
return (
-
- {isWelcomeFlow && (
-
- )}
- {isSetupFlow &&
}
-
- {isSetupFlow &&
}
-
- {isWelcomeFlow && currentStep === "input" && (
-
- )}
-
- {isWelcomeFlow && showWelcomeContent && (
-
-
-
-
-
- {showUserSupermemory && }
-
-
- {renderWelcomeStep()}
-
-
- )}
-
- {isSetupFlow && (
-
-
-
-
-
- {renderSetupStep()}
-
-
-
-
-
-
-
-
-
- )}
-
+
+
+
+
+
+
)
}
diff --git a/apps/web/app/onboarding-old/progress-bar.tsx b/apps/web/app/onboarding/progress-bar.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/progress-bar.tsx
rename to apps/web/app/onboarding/progress-bar.tsx
diff --git a/apps/web/app/onboarding-old/welcome.tsx b/apps/web/app/onboarding/welcome.tsx
similarity index 100%
rename from apps/web/app/onboarding-old/welcome.tsx
rename to apps/web/app/onboarding/welcome.tsx
diff --git a/apps/web/components/mcp-detail-view.tsx b/apps/web/components/mcp-detail-view.tsx
deleted file mode 100644
index adaddf6f..00000000
--- a/apps/web/components/mcp-detail-view.tsx
+++ /dev/null
@@ -1,621 +0,0 @@
-"use client"
-
-import { useState, useEffect } from "react"
-import { Button } from "@ui/components/button"
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@ui/components/select"
-import { CircleCheckIcon, CopyIcon, Check } from "lucide-react"
-import Image from "next/image"
-import { toast } from "sonner"
-import { analytics } from "@/lib/analytics"
-import { cn } from "@lib/utils"
-import { dmMonoClassName, dmSansClassName } from "@/utils/fonts"
-import { SyncLogoIcon } from "@ui/assets/icons"
-
-const clients = {
- cursor: "Cursor",
- claude: "Claude Desktop",
- vscode: "VSCode",
- cline: "Cline",
- "gemini-cli": "Gemini CLI",
- "claude-code": "Claude Code",
- "mcp-url": "MCP URL",
- "roo-cline": "Roo Cline",
- witsy: "Witsy",
- enconvo: "Enconvo",
-} as const
-
-interface MCPDetailViewProps {
- onBack: () => void
-}
-
-export function MCPDetailView({ onBack }: MCPDetailViewProps) {
- const [selectedClient, setSelectedClient] = useState<
- keyof typeof clients | null
- >(null)
- const [selectedProject] = useState
("sm_project_default")
- const [mcpUrlTab, setMcpUrlTab] = useState<"oneClick" | "manual">("oneClick")
- const [isCopied, setIsCopied] = useState(false)
- const [activeStep, setActiveStep] = useState<1 | 2 | 3>(1)
-
- useEffect(() => {
- analytics.mcpViewOpened()
- }, [])
-
- function generateInstallCommand() {
- if (!selectedClient) return ""
-
- let command = `npx -y install-mcp@latest https://api.supermemory.ai/mcp --client ${selectedClient} --oauth=yes`
-
- const projectIdForCommand = selectedProject.replace(/^sm_project_/, "")
- command += ` --project ${projectIdForCommand}`
-
- return command
- }
-
- const copyToClipboard = () => {
- const command = generateInstallCommand()
- navigator.clipboard.writeText(command)
- analytics.mcpInstallCmdCopied()
- setIsCopied(true)
- setActiveStep(3)
- setTimeout(() => setIsCopied(false), 2000)
- }
-
- return (
-
-
-
-
-
-
-
- Connect your AI to supermemory MCP
-
-
-
-
-
-
- MCP connects your AI apps to create and use memories directly
-
-
-
-
-
- Auto-fetch the right context from anything you've saved
-
-
-
-
-
- One-time setup,
seamless integration across your workflow
-
-
-
-
-
-
-
-
-
-
-
- {selectedClient && (
-
- )}
-
-
- {Object.entries(clients)
- .slice(0, 7)
- .map(([key, clientName]) => (
-
- ))}
-
- {!selectedClient && (
-
- *You can connect to all of these, setup is different for each
- one
-
- )}
-
-
-
-
-
-
- 2
-
-
-
-
- Copy the installation command
-
- {selectedClient && (
-
- {selectedClient === "mcp-url" ? (
-
-
-
-
-
-
-
-
- {mcpUrlTab === "oneClick" ? (
-
-
- Use this URL to quickly configure supermemory in
- your AI assistant
-
-
-
-
-
-
- ) : (
-
-
- Add this configuration to your MCP settings file
- with authentication
-
-
-
-
- {`{
- "supermemory-mcp": {
- "command": "npx",
- "args": ["-y", "mcp-remote", "https://api.supermemory.ai/mcp"],
- "env": {},
- "headers": {
- "Authorization": "Bearer your-api-key-here"
- }
- }
-}`}
-
-
-
-
-
- The API key is included as a Bearer token in the
- Authorization header
-
-
- )}
-
- ) : (
-
-
-
-
-
-
- )}
-
- )}
-
-
-
-
-
-
- 3
-
-
-
-
- Run command in your terminal
-
- {activeStep === 3 && (
-
-
- Waiting for installation
-
- )}
-
-
-
-
-
- )
-}
diff --git a/apps/web/components/new/chat/index.tsx b/apps/web/components/new/chat/index.tsx
index f0777be7..3460c456 100644
--- a/apps/web/components/new/chat/index.tsx
+++ b/apps/web/components/new/chat/index.tsx
@@ -7,6 +7,7 @@ import { DefaultChatTransport } from "ai"
import NovaOrb from "@/components/nova/nova-orb"
import { Button } from "@ui/components/button"
import {
+ ChevronDownIcon,
HistoryIcon,
PanelRightCloseIcon,
SearchIcon,
@@ -24,7 +25,11 @@ import { UserMessage } from "./message/user-message"
import { AgentMessage } from "./message/agent-message"
import { ChainOfThought } from "./input/chain-of-thought"
-function ChatEmptyStatePlaceholder() {
+function ChatEmptyStatePlaceholder({
+ onSuggestionClick,
+}: {
+ onSuggestionClick: (suggestion: string) => void
+}) {
const suggestions = [
"Show me all content related to Supermemory.",
"Summarize the key ideas from My Gita.",
@@ -33,7 +38,10 @@ function ChatEmptyStatePlaceholder() {
]
return (
-
+
@@ -50,7 +58,8 @@ function ChatEmptyStatePlaceholder() {
+ {!isScrolledToBottom && messages.length > 0 && (
+
+ )}
+
setInput(e.target.value)}
diff --git a/apps/web/components/new/document-modal/content/notion-doc.tsx b/apps/web/components/new/document-modal/content/notion-doc.tsx
new file mode 100644
index 00000000..45a7dab8
--- /dev/null
+++ b/apps/web/components/new/document-modal/content/notion-doc.tsx
@@ -0,0 +1,9 @@
+import { Streamdown } from "streamdown"
+
+export function NotionDoc({ content }: { content: string }) {
+ return (
+
+ {content}
+
+ )
+}
\ No newline at end of file
diff --git a/apps/web/components/new/document-modal/document-icon.tsx b/apps/web/components/new/document-modal/document-icon.tsx
index ec174094..f86228eb 100644
--- a/apps/web/components/new/document-modal/document-icon.tsx
+++ b/apps/web/components/new/document-modal/document-icon.tsx
@@ -82,7 +82,7 @@ const PDFIcon = ({ className }: { className: string }) => {
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB"
>
-
+
{
filterUnits="userSpaceOnUse"
color-interpolation-filters="sRGB"
>
-
+
- Graph
+
+ Graph
+
- List
+
+ List
+
-
+
{memoryEntries.map((memory, idx) => {
const isClickable =
memory.url &&
diff --git a/apps/web/components/new/document-modal/index.tsx b/apps/web/components/new/document-modal/index.tsx
index 9c0add83..74d4e178 100644
--- a/apps/web/components/new/document-modal/index.tsx
+++ b/apps/web/components/new/document-modal/index.tsx
@@ -14,6 +14,7 @@ import { GraphListMemories, type MemoryEntry } from "./graph-list-memories"
import { YoutubeVideo } from "./content/yt-video"
import { TweetContent } from "./content/tweet"
import { isTwitterUrl } from "@/utils/url-helpers"
+import { NotionDoc } from "./content/notion-doc"
// Dynamically importing to prevent DOMMatrix error
const PdfViewer = dynamic(
@@ -102,13 +103,15 @@ export function DocumentModal({
}
/>
)}
- {_document?.type === "text" &&
- !(_document?.url && isTwitterUrl(_document.url)) && (
-
- {_document.content}
-
- )}
+ {_document?.type === "text" && (
+
+ {_document.content}
+
+ )}
{_document?.type === "pdf" &&
}
+ {_document?.type === "notion_doc" && (
+
+ )}
{_document?.url?.includes("youtube.com") && (
)}
diff --git a/apps/web/components/new/header.tsx b/apps/web/components/new/header.tsx
index 572cba9b..4ef344a3 100644
--- a/apps/web/components/new/header.tsx
+++ b/apps/web/components/new/header.tsx
@@ -10,6 +10,8 @@ import {
Plus,
SearchIcon,
FolderIcon,
+ LogOut,
+ Settings,
} from "lucide-react"
import { Button } from "@ui/components/button"
import { cn } from "@lib/utils"
@@ -24,6 +26,7 @@ import {
} from "@ui/components/dropdown-menu"
import { useQuery } from "@tanstack/react-query"
import { $fetch } from "@repo/lib/api"
+import { authClient } from "@lib/auth"
import { DEFAULT_PROJECT_ID } from "@repo/lib/constants"
import { useProjectMutations } from "@/hooks/use-project-mutations"
import { useProject } from "@/stores"
@@ -197,13 +200,24 @@ export function Header({ onAddMemory, onOpenMCP }: HeaderProps) {
{user && (
-
router.push("/new/settings")}
- >
-
- {user?.name?.charAt(0)}
-
+
+
+
+
+ {user?.name?.charAt(0)}
+
+
+
+ router.push("/new/settings")}>
+
+ Settings
+
+ authClient.signOut()}>
+
+ Logout
+
+
+
)}
diff --git a/apps/web/components/new/mcp-modal/index.tsx b/apps/web/components/new/mcp-modal/index.tsx
index ff008bbd..d555ae62 100644
--- a/apps/web/components/new/mcp-modal/index.tsx
+++ b/apps/web/components/new/mcp-modal/index.tsx
@@ -4,6 +4,7 @@ import { cn } from "@lib/utils"
import * as DialogPrimitive from "@radix-ui/react-dialog"
import { ChevronsUpDownIcon, XIcon } from "lucide-react"
import { Button } from "@ui/components/button"
+import { MCPSteps } from "./mcp-detail-view"
export function MCPModal({
isOpen,
@@ -16,7 +17,7 @@ export function MCPModal({
-
- MCP steps
+
+
@@ -59,7 +60,9 @@ export function MCPModal({
Migrate from MCP v1
-
+
diff --git a/apps/web/components/new/mcp-modal/mcp-detail-view.tsx b/apps/web/components/new/mcp-modal/mcp-detail-view.tsx
new file mode 100644
index 00000000..f1254bcb
--- /dev/null
+++ b/apps/web/components/new/mcp-modal/mcp-detail-view.tsx
@@ -0,0 +1,629 @@
+"use client"
+
+import { useState, useEffect } from "react"
+import { Button } from "@ui/components/button"
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@ui/components/select"
+import { CircleCheckIcon, CopyIcon, Check } from "lucide-react"
+import Image from "next/image"
+import { toast } from "sonner"
+import { analytics } from "@/lib/analytics"
+import { cn } from "@lib/utils"
+import { dmMonoClassName, dmSansClassName } from "@/utils/fonts"
+import { SyncLogoIcon } from "@ui/assets/icons"
+
+const clients = {
+ cursor: "Cursor",
+ claude: "Claude Desktop",
+ vscode: "VSCode",
+ cline: "Cline",
+ "gemini-cli": "Gemini CLI",
+ "claude-code": "Claude Code",
+ "mcp-url": "MCP URL",
+ "roo-cline": "Roo Cline",
+ witsy: "Witsy",
+ enconvo: "Enconvo",
+} as const
+
+interface MCPStepsProps {
+ variant?: "full" | "embedded"
+}
+
+export function MCPSteps({ variant = "full" }: MCPStepsProps) {
+ const [selectedClient, setSelectedClient] = useState<
+ keyof typeof clients | null
+ >(null)
+ const [selectedProject] = useState
("sm_project_default")
+ const [mcpUrlTab, setMcpUrlTab] = useState<"oneClick" | "manual">("oneClick")
+ const [isCopied, setIsCopied] = useState(false)
+ const [activeStep, setActiveStep] = useState<1 | 2 | 3>(1)
+
+ useEffect(() => {
+ analytics.mcpViewOpened()
+ }, [])
+
+ function generateInstallCommand() {
+ if (!selectedClient) return ""
+
+ let command = `npx -y install-mcp@latest https://api.supermemory.ai/mcp --client ${selectedClient} --oauth=yes`
+
+ const projectIdForCommand = selectedProject.replace(/^sm_project_/, "")
+ command += ` --project ${projectIdForCommand}`
+
+ return command
+ }
+
+ const copyToClipboard = () => {
+ const command = generateInstallCommand()
+ navigator.clipboard.writeText(command)
+ analytics.mcpInstallCmdCopied()
+ setIsCopied(true)
+ setActiveStep(3)
+ setTimeout(() => setIsCopied(false), 2000)
+ }
+
+ const isEmbedded = variant === "embedded"
+
+ return (
+
+
+
+
+
+
+
+ {selectedClient && (
+
+ )}
+
+
+ {Object.entries(clients)
+ .slice(0, 7)
+ .map(([key, clientName]) => (
+
+ ))}
+
+ {!selectedClient && (
+
+ *You can connect to all of these, setup is different for each one
+
+ )}
+
+
+
+
+
+
+ 2
+
+
+
+
+ Copy the installation command
+
+ {selectedClient && (
+
+ {selectedClient === "mcp-url" ? (
+
+
+
+
+
+
+
+
+ {mcpUrlTab === "oneClick" ? (
+
+
+ Use this URL to quickly configure supermemory in your AI
+ assistant
+
+
+
+
+
+
+ ) : (
+
+
+ Add this configuration to your MCP settings file with
+ authentication
+
+
+
+
+ {`{
+ "supermemory-mcp": {
+ "command": "npx",
+ "args": ["-y", "mcp-remote", "https://api.supermemory.ai/mcp"],
+ "env": {},
+ "headers": {
+ "Authorization": "Bearer your-api-key-here"
+ }
+ }
+}`}
+
+
+
+
+
+ The API key is included as a Bearer token in the
+ Authorization header
+
+
+ )}
+
+ ) : (
+
+
+
+
+
+
+ )}
+
+ )}
+
+
+
+
+
+
+ 3
+
+
+
+
+ Run command in your terminal
+
+ {activeStep === 3 && (
+
+
+ Waiting for installation
+
+ )}
+
+
+
+ )
+}
+
+interface MCPDetailViewProps {
+ onBack: () => void
+}
+
+export function MCPDetailView({ onBack }: MCPDetailViewProps) {
+ return (
+
+
+
+
+
+
+
+ Connect your AI to supermemory MCP
+
+
+
+
+
+
+ MCP connects your AI apps to create and use memories directly
+
+
+
+
+
+ Auto-fetch the right context from anything you've saved
+
+
+
+
+
+ One-time setup,
seamless integration across your workflow
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/web/components/new/memories-grid.tsx b/apps/web/components/new/memories-grid.tsx
index 9fa32459..e5972d51 100644
--- a/apps/web/components/new/memories-grid.tsx
+++ b/apps/web/components/new/memories-grid.tsx
@@ -6,7 +6,10 @@ import type { DocumentsWithMemoriesResponseSchema } from "@repo/validation/api"
import { useInfiniteQuery } from "@tanstack/react-query"
import { useCallback, memo, useMemo, useState, useRef } from "react"
import type { z } from "zod"
-import { Masonry, useInfiniteLoader } from "masonic"
+import {
+ Masonry,
+ useInfiniteLoader,
+} from "masonic"
import { dmSansClassName } from "@/utils/fonts"
import { SuperLoader } from "@/components/superloader"
import { cn } from "@lib/utils"
@@ -32,7 +35,7 @@ const IS_DEV = process.env.NODE_ENV === "development"
const PAGE_SIZE = IS_DEV ? 100 : 100
const MAX_TOTAL = 1000
-export function MemoriesGrid() {
+export function MemoriesGrid({ isChatOpen }: { isChatOpen: boolean }) {
const { user } = useAuth()
const { selectedProject } = useProject()
const isMobile = useIsMobile()
@@ -91,9 +94,6 @@ export function MemoriesGrid() {
)
}, [data])
- const hasMore = hasNextPage
- const isLoadingMore = isFetchingNextPage
-
const loadMoreDocuments = useCallback(async (): Promise => {
if (hasNextPage && !isFetchingNextPage) {
await fetchNextPage()
@@ -104,7 +104,7 @@ export function MemoriesGrid() {
const maybeLoadMore = useInfiniteLoader(
async (_startIndex, _stopIndex, _currentItems) => {
- if (hasMore && !isLoadingMore) {
+ if (hasNextPage && !isFetchingNextPage) {
await loadMoreDocuments()
}
},
@@ -151,7 +151,9 @@ export function MemoriesGrid() {
}
return (
-
+