fix(memory-echo): fix fusion route config and single close button on comparison modal
- Fix fusion route using same broken prisma.systemConfig.findFirst() instead of getSystemConfig() — this caused all fusion requests to fail - Replace duplicate close buttons (Radix auto + custom) with single styled close button in comparison modal header Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { NextRequest, NextResponse } from 'next/server'
|
import { NextRequest, NextResponse } from 'next/server'
|
||||||
import { auth } from '@/auth'
|
import { auth } from '@/auth'
|
||||||
import { getAIProvider } from '@/lib/ai/factory'
|
import { getChatProvider } from '@/lib/ai/factory'
|
||||||
|
import { getSystemConfig } from '@/lib/config'
|
||||||
import prisma from '@/lib/prisma'
|
import prisma from '@/lib/prisma'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,8 +51,8 @@ export async function POST(req: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get AI provider
|
// Get AI provider
|
||||||
const config = await prisma.systemConfig.findFirst()
|
const config = await getSystemConfig()
|
||||||
const provider = getAIProvider(config || undefined)
|
const provider = getChatProvider(config)
|
||||||
|
|
||||||
// Build fusion prompt
|
// Build fusion prompt
|
||||||
const notesDescriptions = notes.map((note, index) => {
|
const notesDescriptions = notes.map((note, index) => {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Dialog, DialogContent } from '@/components/ui/dialog'
|
import { Dialog, DialogContent } from '@/components/ui/dialog'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Sparkles, ThumbsUp, ThumbsDown, GitMerge } from 'lucide-react'
|
import { Sparkles, ThumbsUp, ThumbsDown, GitMerge, X } from 'lucide-react'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { Note } from '@/lib/types'
|
import { Note } from '@/lib/types'
|
||||||
import { useLanguage } from '@/lib/i18n/LanguageProvider'
|
import { useLanguage } from '@/lib/i18n/LanguageProvider'
|
||||||
@@ -70,10 +70,13 @@ export function ComparisonModal({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={isOpen} onOpenChange={onClose}>
|
<Dialog open={isOpen} onOpenChange={onClose}>
|
||||||
<DialogContent className={cn(
|
<DialogContent
|
||||||
"max-h-[90vh] overflow-hidden flex flex-col p-0",
|
showCloseButton={false}
|
||||||
maxModalWidth
|
className={cn(
|
||||||
)}>
|
"max-h-[90vh] overflow-hidden flex flex-col p-0",
|
||||||
|
maxModalWidth
|
||||||
|
)}
|
||||||
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center justify-between p-6 border-b dark:border-zinc-700">
|
<div className="flex items-center justify-between p-6 border-b dark:border-zinc-700">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
@@ -89,6 +92,12 @@ export function ComparisonModal({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
className="p-1 rounded-md text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-zinc-800 transition-colors"
|
||||||
|
>
|
||||||
|
<X className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* AI Insight Section */}
|
{/* AI Insight Section */}
|
||||||
|
|||||||
Reference in New Issue
Block a user