mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-29 16:54:47 +08:00
feat: welcome, again
This commit is contained in:
@@ -21,6 +21,7 @@ import { InputBox } from "@/components/workspace/input-box";
|
|||||||
import { MessageList } from "@/components/workspace/messages";
|
import { MessageList } from "@/components/workspace/messages";
|
||||||
import { ThreadTitle } from "@/components/workspace/thread-title";
|
import { ThreadTitle } from "@/components/workspace/thread-title";
|
||||||
import { Tooltip } from "@/components/workspace/tooltip";
|
import { Tooltip } from "@/components/workspace/tooltip";
|
||||||
|
import { Welcome } from "@/components/workspace/welcome";
|
||||||
import { useLocalSettings } from "@/core/settings";
|
import { useLocalSettings } from "@/core/settings";
|
||||||
import { type AgentThread } from "@/core/threads";
|
import { type AgentThread } from "@/core/threads";
|
||||||
import { useSubmitThread, useThreadStream } from "@/core/threads/hooks";
|
import { useSubmitThread, useThreadStream } from "@/core/threads/hooks";
|
||||||
@@ -125,18 +126,33 @@ export default function ChatPage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute right-0 bottom-0 left-0 flex justify-center px-4">
|
<div className="absolute right-0 bottom-0 left-0 flex justify-center px-4">
|
||||||
<InputBox
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-full max-w-(--container-width-md) transition-transform duration-300 ease-in-out",
|
"relative w-full",
|
||||||
isNewThread && "-translate-y-[calc(50vh-120px)]",
|
isNewThread && "-translate-y-[calc(50vh-120px)]",
|
||||||
|
isNewThread
|
||||||
|
? "max-w-(--container-width-sm)"
|
||||||
|
: "max-w-(--container-width-md)",
|
||||||
)}
|
)}
|
||||||
autoFocus={isNewThread}
|
>
|
||||||
status={thread.isLoading ? "streaming" : "ready"}
|
<div
|
||||||
context={settings.context}
|
className={cn(
|
||||||
onContextChange={(context) => setSettings("context", context)}
|
"absolute right-0 bottom-[148px] left-0 flex",
|
||||||
onSubmit={handleSubmit}
|
isNewThread ? "" : "pointer-events-none opacity-0",
|
||||||
onStop={handleStop}
|
)}
|
||||||
/>
|
>
|
||||||
|
<Welcome />
|
||||||
|
</div>
|
||||||
|
<InputBox
|
||||||
|
className={cn("z-30 w-full")}
|
||||||
|
autoFocus={isNewThread}
|
||||||
|
status={thread.isLoading ? "streaming" : "ready"}
|
||||||
|
context={settings.context}
|
||||||
|
onContextChange={(context) => setSettings("context", context)}
|
||||||
|
onSubmit={handleSubmit}
|
||||||
|
onStop={handleStop}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
PromptInputBody,
|
PromptInputBody,
|
||||||
PromptInputButton,
|
PromptInputButton,
|
||||||
PromptInputFooter,
|
PromptInputFooter,
|
||||||
|
PromptInputHeader,
|
||||||
PromptInputSubmit,
|
PromptInputSubmit,
|
||||||
PromptInputTextarea,
|
PromptInputTextarea,
|
||||||
type PromptInputMessage,
|
type PromptInputMessage,
|
||||||
@@ -45,6 +46,7 @@ export function InputBox({
|
|||||||
autoFocus,
|
autoFocus,
|
||||||
status = "ready",
|
status = "ready",
|
||||||
context,
|
context,
|
||||||
|
showWelcome = false,
|
||||||
onContextChange,
|
onContextChange,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onStop,
|
onStop,
|
||||||
@@ -53,6 +55,7 @@ export function InputBox({
|
|||||||
assistantId?: string | null;
|
assistantId?: string | null;
|
||||||
status?: ChatStatus;
|
status?: ChatStatus;
|
||||||
context: Omit<AgentThreadContext, "thread_id">;
|
context: Omit<AgentThreadContext, "thread_id">;
|
||||||
|
showWelcome?: boolean;
|
||||||
onContextChange?: (context: Omit<AgentThreadContext, "thread_id">) => void;
|
onContextChange?: (context: Omit<AgentThreadContext, "thread_id">) => void;
|
||||||
onSubmit?: (message: PromptInputMessage) => void;
|
onSubmit?: (message: PromptInputMessage) => void;
|
||||||
onStop?: () => void;
|
onStop?: () => void;
|
||||||
@@ -94,7 +97,7 @@ export function InputBox({
|
|||||||
return (
|
return (
|
||||||
<PromptInput
|
<PromptInput
|
||||||
className={cn(
|
className={cn(
|
||||||
"bg-background/50 rounded-2xl drop-shadow-2xl backdrop-blur-sm transition-all duration-300 ease-out *:data-[slot='input-group']:rounded-2xl",
|
"bg-background/50 rounded-2xl backdrop-blur-sm transition-all duration-300 ease-out *:data-[slot='input-group']:rounded-2xl",
|
||||||
"focus-within:bg-background/85 h-48 translate-y-14 overflow-hidden",
|
"focus-within:bg-background/85 h-48 translate-y-14 overflow-hidden",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
|
|||||||
25
frontend/src/components/workspace/welcome.tsx
Normal file
25
frontend/src/components/workspace/welcome.tsx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
|
export function Welcome({ className }: { className?: string }) {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={cn(
|
||||||
|
"mx-auto flex w-full flex-col items-center justify-center gap-2 px-8 py-4 text-center",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<div className="text-2xl font-bold">👋 Hello, again!</div>
|
||||||
|
<div className="text-muted-foreground text-sm">
|
||||||
|
<p>
|
||||||
|
Welcome to 🦌 DeerFlow, an open source super agent. With built-in and
|
||||||
|
custom
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
skills, DeerFlow helps you search on the web, analyze data, and
|
||||||
|
generate
|
||||||
|
</p>{" "}
|
||||||
|
<p>artifacts like slides, web pages and do almost anything.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user