}
onContextChange={(context) =>
setSettings("context", context)
}
diff --git a/frontend/src/components/ai-elements/prompt-input.tsx b/frontend/src/components/ai-elements/prompt-input.tsx
index 254ce11..efa1663 100644
--- a/frontend/src/components/ai-elements/prompt-input.tsx
+++ b/frontend/src/components/ai-elements/prompt-input.tsx
@@ -44,6 +44,7 @@ import {
PaperclipIcon,
PlusIcon,
SquareIcon,
+ UploadIcon,
XIcon,
} from "lucide-react";
import { nanoid } from "nanoid";
@@ -422,7 +423,7 @@ export const PromptInputActionAddAttachments = ({
attachments.openFileDialog();
}}
>
-
{label}
+
{label}
);
};
diff --git a/frontend/src/components/workspace/input-box.tsx b/frontend/src/components/workspace/input-box.tsx
index 373005c..29e00d2 100644
--- a/frontend/src/components/workspace/input-box.tsx
+++ b/frontend/src/components/workspace/input-box.tsx
@@ -1,18 +1,36 @@
"use client";
import type { ChatStatus } from "ai";
-import { CheckIcon, LightbulbIcon, ListTodoIcon } from "lucide-react";
+import {
+ CheckIcon,
+ GraduationCapIcon,
+ LightbulbIcon,
+ ZapIcon,
+} from "lucide-react";
import { useCallback, useMemo, useState, type ComponentProps } from "react";
import {
PromptInput,
+ PromptInputActionAddAttachments,
+ PromptInputActionMenu,
+ PromptInputActionMenuContent,
+ PromptInputActionMenuItem,
+ PromptInputActionMenuTrigger,
+ PromptInputAttachment,
+ PromptInputAttachments,
PromptInputBody,
PromptInputButton,
PromptInputFooter,
PromptInputSubmit,
PromptInputTextarea,
+ PromptInputTools,
type PromptInputMessage,
} from "@/components/ai-elements/prompt-input";
+import {
+ DropdownMenuGroup,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+} from "@/components/ui/dropdown-menu";
import { useI18n } from "@/core/i18n/hooks";
import { useModels } from "@/core/models/hooks";
import type { AgentThreadContext } from "@/core/threads";
@@ -28,13 +46,12 @@ import {
ModelSelectorTrigger,
} from "../ai-elements/model-selector";
-import { Tooltip } from "./tooltip";
-
export function InputBox({
className,
autoFocus,
status = "ready",
context,
+ extraHeader,
onContextChange,
onSubmit,
onStop,
@@ -55,6 +72,19 @@ export function InputBox({
() => models.find((m) => m.name === context.model_name),
[context.model_name, models],
);
+ const supportThinking = useMemo(
+ () => selectedModel?.supports_thinking ?? false,
+ [selectedModel],
+ );
+ const mode = useMemo(() => {
+ if (context.is_plan_mode) {
+ return "pro";
+ }
+ if (context.thinking_enabled) {
+ return "thinking";
+ }
+ return "flash";
+ }, [context.thinking_enabled, context.is_plan_mode]);
const handleModelSelect = useCallback(
(model_name: string) => {
const supports_thinking = selectedModel?.supports_thinking ?? false;
@@ -67,18 +97,30 @@ export function InputBox({
},
[selectedModel?.supports_thinking, onContextChange, context],
);
- const handleThinkingToggle = useCallback(() => {
- onContextChange?.({
- ...context,
- thinking_enabled: !context.thinking_enabled,
- });
- }, [onContextChange, context]);
- const handlePlanModeToggle = useCallback(() => {
- onContextChange?.({
- ...context,
- is_plan_mode: !context.is_plan_mode,
- });
- }, [onContextChange, context]);
+ const handleModeSelect = useCallback(
+ (mode: "flash" | "thinking" | "pro") => {
+ if (mode === "flash") {
+ onContextChange?.({
+ ...context,
+ thinking_enabled: false,
+ is_plan_mode: false,
+ });
+ } else if (mode === "thinking") {
+ onContextChange?.({
+ ...context,
+ thinking_enabled: true,
+ is_plan_mode: false,
+ });
+ } else if (mode === "pro") {
+ onContextChange?.({
+ ...context,
+ thinking_enabled: true,
+ is_plan_mode: true,
+ });
+ }
+ },
+ [onContextChange, context],
+ );
const handleSubmit = useCallback(
async (message: PromptInputMessage) => {
if (status === "streaming") {
@@ -103,6 +145,16 @@ export function InputBox({
onSubmit={handleSubmit}
{...props}
>
+ {extraHeader && (
+
+ )}
+
+ {(attachment) => }
+
-
-
- {t.inputBox.thinkingEnabled}
-
- {t.inputBox.clickToDisableThinking}
-
-
- ) : (
-
-
{t.inputBox.thinkingDisabled}
-
- {t.inputBox.clickToEnableThinking}
-
-
- )
- }
- >
- {selectedModel?.supports_thinking && (
-
- <>
- {context.thinking_enabled ? (
-
- ) : (
-
- )}
-
+
+
+
+
+
+
+
+ {t.inputBox.mode}
+
+
+ handleModeSelect("flash")}
>
- {t.inputBox.thinking}
-
- >
-
- )}
-
-
- {t.inputBox.planMode}
-
- {t.inputBox.clickToDisablePlanMode}
-
-
- )
- }
- >
- {selectedModel?.supports_thinking && (
-