mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-22 13:44:46 +08:00
feat: add openResearch and closeResearch
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from "~/components/ui/card";
|
||||
import type { Message, Option } from "~/core/messages";
|
||||
import {
|
||||
closeResearch,
|
||||
openResearch,
|
||||
useMessage,
|
||||
useResearchTitle,
|
||||
@@ -209,7 +210,7 @@ function MessageListItem({
|
||||
className={cn(
|
||||
`flex w-fit max-w-[85%] flex-col rounded-2xl px-4 py-3 shadow`,
|
||||
message.role === "user" &&
|
||||
"text-primary-foreground bg-brand rounded-ee-none",
|
||||
"text-primary-foreground bg-brand rounded-ee-none",
|
||||
message.role === "assistant" && "bg-card rounded-es-none",
|
||||
className,
|
||||
)}
|
||||
@@ -245,7 +246,7 @@ function MessageListItem({
|
||||
const title = useResearchTitle(researchId);
|
||||
const handleOpen = useCallback(() => {
|
||||
if (openResearchId === researchId) {
|
||||
openResearch(null);
|
||||
closeResearch();
|
||||
} else {
|
||||
openResearch(researchId);
|
||||
}
|
||||
@@ -318,11 +319,10 @@ function PlanCard({
|
||||
<CardHeader>
|
||||
<CardTitle>
|
||||
<Markdown animate>
|
||||
{`### ${
|
||||
plan.title !== undefined && plan.title !== ""
|
||||
? plan.title
|
||||
: "Deep Research"
|
||||
}`}
|
||||
{`### ${plan.title !== undefined && plan.title !== ""
|
||||
? plan.title
|
||||
: "Deep Research"
|
||||
}`}
|
||||
</Markdown>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Button } from "~/components/ui/button";
|
||||
import { Card } from "~/components/ui/card";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "~/components/ui/tabs";
|
||||
import { useReplay } from "~/core/replay";
|
||||
import { listenToPodcast, openResearch, useStore } from "~/core/store";
|
||||
import { closeResearch, listenToPodcast, useStore } from "~/core/store";
|
||||
import { cn } from "~/lib/utils";
|
||||
|
||||
import { ResearchActivitiesBlock } from "./research-activities-block";
|
||||
@@ -102,9 +102,7 @@ export function ResearchBlock({
|
||||
className="text-gray-400"
|
||||
size="sm"
|
||||
variant="ghost"
|
||||
onClick={() => {
|
||||
openResearch(null);
|
||||
}}
|
||||
onClick={() => { closeResearch(); }}
|
||||
>
|
||||
<X />
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user