feat: 改进设置页面UI和国际化支持 / Improve settings pages UI and i18n support

- 添加 rehype-raw 依赖以支持在 markdown 中渲染 HTML
  Add rehype-raw dependency to support HTML rendering in markdown

- 重构 memory-settings-page,提取 formatMemorySection 函数减少重复代码
  Refactor memory-settings-page by extracting formatMemorySection function to reduce code duplication

- 改进空状态显示,使用 HTML span 标签替代 markdown 斜体,提供更好的样式控制
  Improve empty state display by using HTML span tags instead of markdown italics for better style control

- 为 skill-settings-page 添加完整的国际化支持,替换硬编码的英文文本
  Add complete i18n support for skill-settings-page, replacing hardcoded English text

- 更新国际化文件,添加技能设置页面的空状态文本(中英文)
  Update i18n files with empty state text for skill settings page (both Chinese and English)

- 在 streamdown 插件配置中添加 rehypeRaw 以支持 HTML 渲染
  Add rehypeRaw to streamdown plugins configuration to support HTML rendering

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LofiSu
2026-02-10 12:15:37 +08:00
parent 6109216d54
commit f87d5678f3
8 changed files with 82 additions and 49 deletions

View File

@@ -243,7 +243,7 @@ export const enUS: Translations = {
longTermBackground: "Long-term background",
updatedAt: "Updated at",
facts: "Facts",
empty: "Empty",
empty: "empty",
table: {
category: "Category",
confidence: "Confidence",
@@ -282,6 +282,10 @@ export const enUS: Translations = {
description:
"Manage the configuration and enabled status of the agent skills.",
createSkill: "Create skill",
emptyTitle: "No agent skill yet",
emptyDescription:
"Put your agent skill folders under the `/skills/custom` folder under the root folder of DeerFlow.",
emptyButton: "Create Your First Skill",
},
notification: {
title: "Notification",

View File

@@ -225,6 +225,9 @@ export interface Translations {
title: string;
description: string;
createSkill: string;
emptyTitle: string;
emptyDescription: string;
emptyButton: string;
};
notification: {
title: string;

View File

@@ -238,7 +238,7 @@ export const zhCN: Translations = {
longTermBackground: "长期背景",
updatedAt: "更新于",
facts: "事实",
empty: "(空)",
empty: "",
table: {
category: "类别",
confidence: "置信度",
@@ -275,6 +275,10 @@ export const zhCN: Translations = {
title: "技能",
description: "管理 Agent Skill 配置和启用状态。",
createSkill: "新建技能",
emptyTitle: "还没有技能",
emptyDescription:
"将你的 Agent Skill 文件夹放在 DeerFlow 根目录下的 `/skills/custom` 文件夹中。",
emptyButton: "创建你的第一个技能",
},
notification: {
title: "通知",

View File

@@ -1,4 +1,5 @@
import rehypeKatex from "rehype-katex";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import type { StreamdownProps } from "streamdown";
@@ -11,6 +12,7 @@ export const streamdownPlugins = {
[remarkMath, { singleDollarTextMath: true }],
] as StreamdownProps["remarkPlugins"],
rehypePlugins: [
rehypeRaw,
[rehypeKatex, { output: "html" }],
] as StreamdownProps["rehypePlugins"],
};