From 09c6a74ea33a78f33336cba3bdf72d54f2ed400f Mon Sep 17 00:00:00 2001 From: MT-Fire <798521692@qq.com> Date: Sat, 28 Mar 2026 22:26:27 +0800 Subject: [PATCH] =?UTF-8?q?revert(frontend):=20=E5=9B=9E=E6=BB=9A=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=20frontend=20=E5=90=8C=E6=AD=A5=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.gitignore | 2 + frontend/.vscode/settings.json | 66 +- frontend/AGENTS.md | 6 - frontend/Dockerfile | 53 +- frontend/Dockerfile.prod | 18 + frontend/README.md | 12 +- frontend/package.json | 11 +- frontend/pnpm-lock.yaml | 940 +++++++++++------- frontend/pnpm-workspace.yaml | 1 - frontend/src/app/layout.tsx | 13 +- frontend/src/app/mock/api/models/route.ts | 4 - .../src/app/mock/api/threads/search/route.ts | 77 +- .../[agent_name]/chats/[thread_id]/layout.tsx | 19 - .../[agent_name]/chats/[thread_id]/page.tsx | 191 ---- .../src/app/workspace/agents/new/page.tsx | 252 ----- frontend/src/app/workspace/agents/page.tsx | 5 - .../app/workspace/chats/[thread_id]/page.tsx | 608 +++++++++-- frontend/src/app/workspace/layout.tsx | 42 +- .../src/components/ai-elements/artifact.tsx | 19 +- .../ai-elements/chain-of-thought.tsx | 8 +- .../src/components/ai-elements/checkpoint.tsx | 5 +- .../src/components/ai-elements/code-block.tsx | 13 +- .../src/components/ai-elements/context.tsx | 10 +- .../src/components/ai-elements/controls.tsx | 6 +- .../components/ai-elements/conversation.tsx | 4 +- frontend/src/components/ai-elements/edge.tsx | 10 +- frontend/src/components/ai-elements/image.tsx | 2 +- .../src/components/ai-elements/loader.tsx | 2 +- .../src/components/ai-elements/message.tsx | 15 +- frontend/src/components/ai-elements/node.tsx | 6 +- frontend/src/components/ai-elements/panel.tsx | 4 +- .../components/ai-elements/prompt-input.tsx | 244 +++-- frontend/src/components/ai-elements/queue.tsx | 32 +- .../src/components/ai-elements/reasoning.tsx | 27 +- .../src/components/ai-elements/shimmer.tsx | 8 +- .../src/components/ai-elements/sources.tsx | 6 +- .../src/components/ai-elements/suggestion.tsx | 8 +- frontend/src/components/ai-elements/task.tsx | 12 +- .../src/components/ai-elements/toolbar.tsx | 4 +- .../components/ai-elements/web-preview.tsx | 16 +- .../landing/sections/case-study-section.tsx | 2 +- frontend/src/components/ui/alert.tsx | 22 +- frontend/src/components/ui/aurora-text.tsx | 26 +- frontend/src/components/ui/avatar.tsx | 20 +- frontend/src/components/ui/badge.tsx | 18 +- frontend/src/components/ui/breadcrumb.tsx | 30 +- frontend/src/components/ui/button-group.tsx | 28 +- frontend/src/components/ui/button.tsx | 2 +- frontend/src/components/ui/card.tsx | 30 +- frontend/src/components/ui/carousel.tsx | 136 +-- frontend/src/components/ui/command.tsx | 52 +- frontend/src/components/ui/dev-dialog.tsx | 148 +++ frontend/src/components/ui/dialog.tsx | 40 +- frontend/src/components/ui/dropdown-menu.tsx | 74 +- .../src/components/ui/dropdown-selector.tsx | 106 ++ frontend/src/components/ui/empty.tsx | 30 +- frontend/src/components/ui/galaxy.jsx | 25 +- frontend/src/components/ui/hover-card.tsx | 18 +- frontend/src/components/ui/input-group.tsx | 10 +- frontend/src/components/ui/item.tsx | 52 +- frontend/src/components/ui/magic-bento.css | 4 +- frontend/src/components/ui/progress.tsx | 14 +- frontend/src/components/ui/resizable.tsx | 2 +- frontend/src/components/ui/scroll-area.tsx | 16 +- frontend/src/components/ui/separator.tsx | 14 +- frontend/src/components/ui/sheet.tsx | 38 +- frontend/src/components/ui/shine-border.tsx | 16 +- frontend/src/components/ui/sidebar.tsx | 5 +- frontend/src/components/ui/skeleton.tsx | 6 +- frontend/src/components/ui/sonner.tsx | 26 +- frontend/src/components/ui/spotlight-card.css | 8 +- frontend/src/components/ui/switch.tsx | 16 +- frontend/src/components/ui/tabs.tsx | 28 +- frontend/src/components/ui/toggle-group.tsx | 4 +- frontend/src/components/ui/toggle.tsx | 18 +- frontend/src/components/ui/tooltip.tsx | 2 +- .../components/workspace/agent-welcome.tsx | 36 - .../workspace/agents/agent-card.tsx | 140 --- .../workspace/agents/agent-gallery.tsx | 69 -- .../artifacts/artifact-file-detail.tsx | 555 +++++++++-- .../artifacts/artifact-file-list.tsx | 12 +- .../workspace/artifacts/artifact-trigger.tsx | 30 - .../workspace/artifacts/context.tsx | 41 +- .../components/workspace/artifacts/index.ts | 1 - .../components/workspace/chats/chat-box.tsx | 180 ---- .../src/components/workspace/chats/index.ts | 3 - .../workspace/chats/use-thread-chat.ts | 29 - .../workspace/citations/artifact-link.tsx | 33 - .../workspace/citations/citation-link.tsx | 12 +- .../src/components/workspace/code-editor.tsx | 4 + .../components/workspace/command-palette.tsx | 130 --- .../src/components/workspace/copy-button.tsx | 3 +- .../components/workspace/dev-todo-list.tsx | 69 ++ .../components/workspace/export-trigger.tsx | 81 -- .../workspace/iframe-test-panel.tsx | 270 +++++ .../src/components/workspace/input-box.tsx | 884 ++++++---------- .../components/workspace/messages/context.ts | 6 +- .../workspace/messages/markdown-content.tsx | 20 +- .../workspace/messages/message-group.tsx | 2 +- .../workspace/messages/message-list-item.tsx | 242 ++--- .../workspace/messages/message-list.tsx | 38 +- .../components/workspace/mode-hover-guide.tsx | 5 +- .../components/workspace/recent-chat-list.tsx | 72 +- .../components/workspace/settings/about.md | 3 + .../settings/appearance-settings-page.tsx | 8 +- .../src/components/workspace/thread-title.tsx | 45 +- .../src/components/workspace/todo-list.tsx | 19 +- .../workspace/token-usage-indicator.tsx | 74 -- .../workspace/{chats => }/use-chat-mode.ts | 3 +- frontend/src/components/workspace/welcome.tsx | 22 +- .../workspace/workspace-nav-chat-list.tsx | 13 +- frontend/src/core/agents/api.ts | 67 -- frontend/src/core/agents/hooks.ts | 64 -- frontend/src/core/agents/index.ts | 3 - frontend/src/core/agents/types.ts | 22 - frontend/src/core/api/api-client.ts | 41 +- frontend/src/core/api/stream-mode.test.ts | 43 - frontend/src/core/api/stream-mode.ts | 68 -- frontend/src/core/artifacts/hooks.ts | 7 +- frontend/src/core/artifacts/loader.ts | 8 +- frontend/src/core/artifacts/utils.ts | 5 - frontend/src/core/config/index.ts | 25 +- frontend/src/core/i18n/hooks.ts | 27 +- frontend/src/core/i18n/index.ts | 28 +- frontend/src/core/i18n/locale.ts | 36 - frontend/src/core/i18n/locales/en-US.ts | 63 +- frontend/src/core/i18n/locales/types.ts | 32 +- frontend/src/core/i18n/locales/zh-CN.ts | 73 +- frontend/src/core/i18n/server.ts | 14 +- frontend/src/core/iframe-messages.ts | 59 ++ frontend/src/core/mcp/api.ts | 14 +- frontend/src/core/messages/usage.ts | 62 -- frontend/src/core/messages/utils.ts | 282 +++--- frontend/src/core/models/api.ts | 4 +- frontend/src/core/models/hooks.ts | 1 - frontend/src/core/models/types.ts | 2 - frontend/src/core/settings/hooks.ts | 11 +- frontend/src/core/settings/local.ts | 2 - frontend/src/core/skills/api.ts | 80 ++ frontend/src/core/threads/export.ts | 142 --- frontend/src/core/threads/hooks.ts | 604 ++++------- frontend/src/core/threads/types.ts | 7 +- frontend/src/core/threads/utils.ts | 16 +- frontend/src/core/uploads/api.ts | 26 +- .../core/utils/markdown-download/converter.ts | 464 +++++++++ .../src/core/utils/markdown-download/index.ts | 47 + .../use-markdown-download.ts | 127 +++ frontend/src/hooks/use-global-shortcuts.ts | 53 - frontend/src/hooks/use-iframe-skill.ts | 78 ++ frontend/src/hooks/use-mobile.ts | 24 +- .../src/hooks/use-selected-skill-listener.ts | 152 +++ frontend/src/lib/utils.ts | 69 ++ frontend/src/styles/globals.css | 81 +- 153 files changed, 5135 insertions(+), 4919 deletions(-) create mode 100644 frontend/Dockerfile.prod delete mode 100644 frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/layout.tsx delete mode 100644 frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx delete mode 100644 frontend/src/app/workspace/agents/new/page.tsx delete mode 100644 frontend/src/app/workspace/agents/page.tsx create mode 100644 frontend/src/components/ui/dev-dialog.tsx create mode 100644 frontend/src/components/ui/dropdown-selector.tsx delete mode 100644 frontend/src/components/workspace/agent-welcome.tsx delete mode 100644 frontend/src/components/workspace/agents/agent-card.tsx delete mode 100644 frontend/src/components/workspace/agents/agent-gallery.tsx delete mode 100644 frontend/src/components/workspace/artifacts/artifact-trigger.tsx delete mode 100644 frontend/src/components/workspace/chats/chat-box.tsx delete mode 100644 frontend/src/components/workspace/chats/index.ts delete mode 100644 frontend/src/components/workspace/chats/use-thread-chat.ts delete mode 100644 frontend/src/components/workspace/citations/artifact-link.tsx delete mode 100644 frontend/src/components/workspace/command-palette.tsx create mode 100644 frontend/src/components/workspace/dev-todo-list.tsx delete mode 100644 frontend/src/components/workspace/export-trigger.tsx create mode 100644 frontend/src/components/workspace/iframe-test-panel.tsx delete mode 100644 frontend/src/components/workspace/token-usage-indicator.tsx rename frontend/src/components/workspace/{chats => }/use-chat-mode.ts (91%) delete mode 100644 frontend/src/core/agents/api.ts delete mode 100644 frontend/src/core/agents/hooks.ts delete mode 100644 frontend/src/core/agents/index.ts delete mode 100644 frontend/src/core/agents/types.ts delete mode 100644 frontend/src/core/api/stream-mode.test.ts delete mode 100644 frontend/src/core/api/stream-mode.ts delete mode 100644 frontend/src/core/i18n/locale.ts create mode 100644 frontend/src/core/iframe-messages.ts delete mode 100644 frontend/src/core/messages/usage.ts delete mode 100644 frontend/src/core/threads/export.ts create mode 100644 frontend/src/core/utils/markdown-download/converter.ts create mode 100644 frontend/src/core/utils/markdown-download/index.ts create mode 100644 frontend/src/core/utils/markdown-download/use-markdown-download.ts delete mode 100644 frontend/src/hooks/use-global-shortcuts.ts create mode 100644 frontend/src/hooks/use-iframe-skill.ts create mode 100644 frontend/src/hooks/use-selected-skill-listener.ts diff --git a/frontend/.gitignore b/frontend/.gitignore index c24a8359..1a0009e8 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -21,6 +21,8 @@ next-env.d.ts # production /build +docs + # misc .DS_Store *.pem diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json index 19bd6ebc..f06ac9c4 100644 --- a/frontend/.vscode/settings.json +++ b/frontend/.vscode/settings.json @@ -1,3 +1,67 @@ { - "window.title": "${activeEditorShort}${separator}${separator}deer-flow/frontend" + "window.title": "${activeEditorShort}${separator}${separator}deer-flow/frontend", + "todo-tree.regex.regex": "((%|#|//|