diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 0cf3ea2f6..78e017286 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -240,6 +240,7 @@ function formatMessageDateLabel(timestamp: number): string { } const CANVAS_IMAGE_ANALYSIS_TITLE = "图片分析"; +const CANVAS_IMAGE_DONE_SUMMARY = "已完成本次生成,如需微调可继续告诉我。"; const CANVAS_AGENT_SECTION_TITLES = new Set([ "需求理解", CANVAS_IMAGE_ANALYSIS_TITLE, @@ -5106,30 +5107,37 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF ) : null} {imageUrls.length > 0 && ( -
- {imageUrls.map((url, idx) => ( -
- setFullscreenPreview({ url })} - onDoubleClick={(e) => { - e.preventDefault(); - e.stopPropagation(); - setFullscreenPreview({ url }); - }} - /> -
- ))} +
+
+ {imageUrls.map((url, idx) => ( +
+ setFullscreenPreview({ url })} + onDoubleClick={(e) => { + e.preventDefault(); + e.stopPropagation(); + setFullscreenPreview({ url }); + }} + /> +
+ ))} +
+ {!isDetailGenerationMode ? ( +

+ {CANVAS_IMAGE_DONE_SUMMARY} +

+ ) : null}
)} {videoUrls.length > 0 && ( diff --git a/components/home/lovart-home.tsx b/components/home/lovart-home.tsx index 44f5730e1..d0708983d 100644 --- a/components/home/lovart-home.tsx +++ b/components/home/lovart-home.tsx @@ -1,6 +1,6 @@ "use client"; -import { Fragment, useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import { useRouter } from "next/navigation"; import { signIn, signOut } from "next-auth/react"; import useSWR from "swr"; @@ -455,17 +455,6 @@ export function LovartHome({ const membershipPlans = membershipConfig?.plans || []; const currentPlan = membershipData?.currentPlan; - const groupedModelRows = useMemo(() => { - const rows = membershipConfig?.modelRows || []; - return rows.reduce>((acc, row) => { - if (!acc[row.category]) { - acc[row.category] = []; - } - acc[row.category].push(row); - return acc; - }, {}); - }, [membershipConfig?.modelRows]); - const imageModels = useMemo( () => (modelsData?.models || []).filter((model) => model.supportsImageGen), [modelsData?.models] @@ -2422,53 +2411,6 @@ export function LovartHome({
-
-

- 模型积分消耗 & 每月生成数量 -

-

- 以下表格基于系统设置中的会员配置,可直接在后台调整。 -

-
- - - - - {membershipPlans.map((plan) => ( - - ))} - - - - {Object.entries(groupedModelRows).map(([category, rows]) => ( - - - - - {rows.map((row) => ( - - - {membershipPlans.map((plan) => ( - - ))} - - ))} - - ))} - -
模型 - {plan.name} -
- {category} -
{row.model} - {row.values[plan.id] ?? "-"} - {row.values[plan.id] && row.values[plan.id] !== "-" ? row.unit : ""} -
-
-
diff --git a/components/message.tsx b/components/message.tsx index 35f01ae57..99e884923 100644 --- a/components/message.tsx +++ b/components/message.tsx @@ -5,6 +5,7 @@ import { memo, useState } from "react"; import type { Vote } from "@/lib/db/schema"; import type { ChatMessage } from "@/lib/types"; import { cn, sanitizeText } from "@/lib/utils"; +import { extractImageUrlsFromText } from "@/lib/image-url"; import { useDataStream } from "./data-stream-provider"; import { DocumentToolResult } from "./document"; import { DocumentPreview } from "./document-preview"; @@ -172,6 +173,17 @@ function filterAgentRoutingNoise(text: string): string { return filtered; } +const IMAGE_DONE_SUMMARY = "已完成本次生成,如需微调可继续告诉我。"; + +function appendImageDoneSummary(text: string): string { + if (!text) return text; + const normalized = String(text || "").trim(); + if (!normalized) return normalized; + if (extractImageUrlsFromText(normalized).length === 0) return normalized; + if (normalized.includes(IMAGE_DONE_SUMMARY)) return normalized; + return `${normalized}\n\n${IMAGE_DONE_SUMMARY}`; +} + const PurePreviewMessage = ({ chatId, message, @@ -315,7 +327,7 @@ const PurePreviewMessage = ({ // 应用视频内容过滤 const filteredText = message.role === "assistant" - ? filterAgentRoutingNoise(filterVideoContent(part.text)) + ? appendImageDoneSummary(filterAgentRoutingNoise(filterVideoContent(part.text))) : part.text; const textParts = parseAnnotations(filteredText); @@ -567,7 +579,7 @@ export const ThinkingMessage = () => {
{/* 简洁明了的文本 + 动态点 */}
- AI 正在思考中 + AI 正在分析中