diff --git a/frontend/TODO.md b/frontend/TODO.md new file mode 100644 index 0000000..d519b3a --- /dev/null +++ b/frontend/TODO.md @@ -0,0 +1,4 @@ +[ ] feat - Skills 页面根据 Category 分组展示 +[ ] fix - autoOpen +[ ] fix - local settings +[ ] feat - todo diff --git a/frontend/src/components/workspace/input-box.tsx b/frontend/src/components/workspace/input-box.tsx index 280698e..d0c2231 100644 --- a/frontend/src/components/workspace/input-box.tsx +++ b/frontend/src/components/workspace/input-box.tsx @@ -153,7 +153,7 @@ export function InputBox({ : "text-muted-foreground", )} > - Thinking + {t.inputBox.thinking} diff --git a/frontend/src/components/workspace/settings/skill-settings-page.tsx b/frontend/src/components/workspace/settings/skill-settings-page.tsx index 1317953..cbef473 100644 --- a/frontend/src/components/workspace/settings/skill-settings-page.tsx +++ b/frontend/src/components/workspace/settings/skill-settings-page.tsx @@ -1,8 +1,9 @@ "use client"; import { SparklesIcon } from "lucide-react"; +import { useMemo, useState } from "react"; -import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; import { Empty, EmptyDescription, @@ -44,7 +45,13 @@ export function SkillSettingsPage() { } function SkillSettingsList({ skills }: { skills: Skill[] }) { + const { t } = useI18n(); + const [filter, setFilter] = useState<"public" | "custom">("public"); const { mutate: enableSkill } = useEnableSkill(); + const filteredSkills = useMemo( + () => skills.filter((skill) => skill.category === filter), + [skills, filter], + ); if (skills.length === 0) { return ( @@ -63,29 +70,59 @@ function SkillSettingsList({ skills }: { skills: Skill[] }) { } return (
- {skills.map((skill) => ( - - - -
-
{skill.name}
- {skill.category} -
-
- - {skill.description} - -
- - - enableSkill({ skillName: skill.name, enabled: checked }) - } - /> - -
- ))} +
+ + +
+ {filteredSkills.length === 0 && ( + + + + + + No skill yet + + Put your skill folders under the `/skills/{filter}` folder under + the root folder of DeerFlow. + + + + )} + {filteredSkills.length > 0 && + filteredSkills.map((skill) => ( + + + +
{skill.name}
+
+ + {skill.description} + +
+ + + enableSkill({ skillName: skill.name, enabled: checked }) + } + /> + +
+ ))}
); } diff --git a/frontend/src/core/i18n/locales/en-US.ts b/frontend/src/core/i18n/locales/en-US.ts index 5e0ffe9..8d1b82f 100644 --- a/frontend/src/core/i18n/locales/en-US.ts +++ b/frontend/src/core/i18n/locales/en-US.ts @@ -18,6 +18,8 @@ export const enUS: Translations = { download: "Download", thinking: "Thinking", artifacts: "Artifacts", + public: "Public", + custom: "Custom", }, // Welcome @@ -37,6 +39,7 @@ export const enUS: Translations = { // Input Box inputBox: { placeholder: "How can I assist you today?", + thinking: "Thinking", thinkingEnabled: "Thinking is enabled", thinkingDisabled: "Thinking is disabled", clickToDisableThinking: "Click to disable thinking", diff --git a/frontend/src/core/i18n/locales/types.ts b/frontend/src/core/i18n/locales/types.ts index 6279c27..0c08144 100644 --- a/frontend/src/core/i18n/locales/types.ts +++ b/frontend/src/core/i18n/locales/types.ts @@ -16,6 +16,8 @@ export interface Translations { download: string; thinking: string; artifacts: string; + public: string; + custom: string; }; // Welcome @@ -34,6 +36,7 @@ export interface Translations { // Input Box inputBox: { placeholder: string; + thinking: string; thinkingEnabled: string; thinkingDisabled: string; clickToDisableThinking: string; diff --git a/frontend/src/core/i18n/locales/zh-CN.ts b/frontend/src/core/i18n/locales/zh-CN.ts index 12afc98..6cd644a 100644 --- a/frontend/src/core/i18n/locales/zh-CN.ts +++ b/frontend/src/core/i18n/locales/zh-CN.ts @@ -18,6 +18,8 @@ export const zhCN: Translations = { download: "下载", thinking: "思考", artifacts: "文件", + public: "公共", + custom: "自定义", }, // Welcome @@ -37,6 +39,7 @@ export const zhCN: Translations = { // Input Box inputBox: { placeholder: "今天我能为你做些什么?", + thinking: "思考", thinkingEnabled: "思考功能已启用", thinkingDisabled: "思考功能已禁用", clickToDisableThinking: "点击禁用思考功能",