fix: hide image advanced settings icon and keep deep-thinking toggle
This commit is contained in:
parent
c2c46aab41
commit
365174ffc5
@ -5,7 +5,7 @@ import { DefaultChatTransport } from "ai";
|
||||
import { useEffect, useRef, useState, useCallback, useMemo } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import useSWR, { useSWRConfig } from "swr";
|
||||
import { Send, Loader2, ImagePlus, Paperclip, X, Plus, History, LayoutGrid, Maximize2, RefreshCw, Globe, Box, ArrowUp, Video, Sparkles, Check, ChevronDown, ChevronUp, AlertCircle, CheckCircle2, ThumbsUp, ThumbsDown, Eye, Trash2 } from "lucide-react";
|
||||
import { Send, Loader2, ImagePlus, Paperclip, X, Plus, History, LayoutGrid, Maximize2, RefreshCw, Globe, Box, ArrowUp, Video, Sparkles, Check, ChevronDown, ChevronUp, AlertCircle, CheckCircle2, Brain, ThumbsUp, ThumbsDown, Eye, Trash2 } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import {
|
||||
@ -1328,7 +1328,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
||||
const [videoSlotUploading, setVideoSlotUploading] = useState<number | null>(null);
|
||||
const [lastImageModelId, setLastImageModelId] = useState<string | null>(null);
|
||||
const [lastVideoModelId, setLastVideoModelId] = useState<string | null>(null);
|
||||
const [deepThinkingEnabled] = useState(false);
|
||||
const [deepThinkingEnabled, setDeepThinkingEnabled] = useState(false);
|
||||
const [analysisCollapseState, setAnalysisCollapseState] = useState<Record<string, boolean>>({});
|
||||
const [typedAssistantSections, setTypedAssistantSections] = useState<Record<string, boolean>>({});
|
||||
const [activeTypingSections, setActiveTypingSections] = useState<Record<string, boolean>>({});
|
||||
@ -7328,6 +7328,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
||||
inline={true}
|
||||
providerType={currentModel?.providerType}
|
||||
imageGenConfig={currentModel?.imageGenConfig || undefined}
|
||||
hideAdvancedOptions={activeComposerMode === "image"}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@ -7352,6 +7353,24 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{activeComposerMode === "image" ? (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
title={`深度思考:${deepThinkingEnabled ? "开" : "关"}`}
|
||||
className={cn(
|
||||
"h-8 w-8 rounded-full border transition-colors",
|
||||
deepThinkingEnabled
|
||||
? "border-[#8ab0ff] bg-[#eef4ff] text-[#3b5bcc] hover:bg-[#e5efff]"
|
||||
: "border-[#d8dce3] bg-white text-[#6b7280] hover:bg-[#f4f6f8]"
|
||||
)}
|
||||
onClick={() => setDeepThinkingEnabled((prev) => !prev)}
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
<Brain className="h-4 w-4" />
|
||||
</Button>
|
||||
) : null}
|
||||
|
||||
{activeComposerMode !== "agent" ? (
|
||||
<Select
|
||||
value={modelSelectValue}
|
||||
|
||||
@ -39,6 +39,7 @@ interface ImageParamsBarProps {
|
||||
inline?: boolean; // 内联模式:只显示参数按钮,不显示外层容器
|
||||
providerType?: string; // 模型类型:gemini, volcano-vision, alibaba-image, ruxa-image 等
|
||||
hideImageCount?: boolean; // 隐藏图片数量按钮(仅个别页面需要)
|
||||
hideAdvancedOptions?: boolean; // 隐藏高级设置按钮
|
||||
// 🆕 图片生成模型特性配置(从模型配置中读取)
|
||||
imageGenConfig?: {
|
||||
maxImages?: number;
|
||||
@ -85,6 +86,7 @@ export function ImageParamsBar({
|
||||
inline = false,
|
||||
providerType = "gemini", // 默认 gemini
|
||||
hideImageCount = false,
|
||||
hideAdvancedOptions = false,
|
||||
imageGenConfig,
|
||||
}: ImageParamsBarProps) {
|
||||
const getImageCountOptions = () => {
|
||||
@ -365,7 +367,7 @@ export function ImageParamsBar({
|
||||
)}
|
||||
|
||||
{/* 🆕 阿里生图专用:提示词优化 & 反向提示词 */}
|
||||
{(showPromptExtend || showNegativePrompt) && (
|
||||
{!hideAdvancedOptions && (showPromptExtend || showNegativePrompt) && (
|
||||
<Popover>
|
||||
<PopoverTrigger asChild>
|
||||
<Button
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user