diff --git a/src/components/chat/message-input.tsx b/src/components/chat/message-input.tsx index f704005..1100ed9 100644 --- a/src/components/chat/message-input.tsx +++ b/src/components/chat/message-input.tsx @@ -7,8 +7,9 @@ import { open } from "@tauri-apps/plugin-dialog" import Image from "next/image" import { useTranslations } from "next-intl" import { Button } from "@/components/ui/button" +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" import { Textarea } from "@/components/ui/textarea" -import { FileSearch, Plus, Send, Square, X } from "lucide-react" +import { Ellipsis, FileSearch, Plus, Send, Square, X } from "lucide-react" import { cn } from "@/lib/utils" import { readFileBase64 } from "@/lib/tauri" import { disposeTauriListener } from "@/lib/tauri-listener" @@ -327,6 +328,8 @@ export function MessageInput({ hasModes && Boolean(effectiveModeId) && !hasConfigOptions const showModeLoading = modeLoading && !hasConfigOptions && !showModeSelector const showConfigLoading = configOptionsLoading && !hasConfigOptions + const hasAnySelector = + showConfigLoading || hasConfigOptions || showModeLoading || showModeSelector const imageAttachments = useMemo( () => attachments.filter( @@ -996,6 +999,32 @@ export function MessageInput({ const bottomPaddingClass = "pb-10" const showDragActive = isDragActive && !disabled && !isPrompting + const selectorItems = ( + <> + {showConfigLoading && ( + + )} + {hasConfigOptions && + availableConfigOptions.map((option) => ( + + onConfigOptionChange?.(configId, valueId) + } + /> + ))} + {showModeLoading && } + {showModeSelector && ( + + )} + + ) + return (
)} -
-
+
+
- {showConfigLoading && ( - - )} - {hasConfigOptions && - availableConfigOptions.map((option) => ( - - onConfigOptionChange?.(configId, valueId) - } - /> - ))} - {showModeLoading && } - {showModeSelector && effectiveModeId && ( - + {/* 宽屏内联显示,窄屏(<300px)通过"更多"气泡显示 */} +
+ {selectorItems} +
+ {hasAnySelector && ( + + + + + + {selectorItems} + + )}
diff --git a/src/components/chat/mode-selector.tsx b/src/components/chat/mode-selector.tsx index 85f84b6..925d082 100644 --- a/src/components/chat/mode-selector.tsx +++ b/src/components/chat/mode-selector.tsx @@ -34,11 +34,11 @@ export function ModeSelector({ diff --git a/src/components/chat/session-config-selector.tsx b/src/components/chat/session-config-selector.tsx index 6742aeb..781088f 100644 --- a/src/components/chat/session-config-selector.tsx +++ b/src/components/chat/session-config-selector.tsx @@ -39,11 +39,11 @@ export function SessionConfigSelector({