From 1ba31844a94cad09924d83f83a5348922ec52669 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 27 Oct 2026 12:22:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=96=B0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E2=80=9C=E5=B8=AE=E6=88=91=E5=86=99=E6=B8=85=E6=A5=9A=E2=80=9D?= =?UTF-8?q?=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 标题从“调教提示词”改成“帮我把要求写清楚”,开头说明怎么用 - 学生每次发的标成“你的要求 · 第 N 版”,AI 的回复标成“AI 的建议” - 输入框明确是“你的要求”;按钮改成“让 AI 再看看”和“用这段生成网页”, 没改过的要求不会重复发;AI 回复时不能直接生成 Co-Authored-By: Claude Opus 5.5 --- client/src/components/ai/GuidancePanel.vue | 236 ++++++++++++--------- 1 file changed, 132 insertions(+), 104 deletions(-) diff --git a/client/src/components/ai/GuidancePanel.vue b/client/src/components/ai/GuidancePanel.vue index dfbf73c..75a1c5b 100644 --- a/client/src/components/ai/GuidancePanel.vue +++ b/client/src/components/ai/GuidancePanel.vue @@ -2,82 +2,74 @@ -
-
+

+ AI 会看看你的要求哪里还不够清楚,给你提建议。照着建议改好下面的要求,再让它看看; + 觉得可以了就点“用这段生成网页”。 +

+ +
+
+
+ {{ msg.role === "user" ? `你的要求 · 第 ${versionOf(i)} 版` : "AI 的建议" }} +
+
+
+ +
+
AI 的建议
+
+ +
-
{{ msg.role === "user" ? "你" : "AI" }}
-
-
- -
-
AI
-
- -
-
-
+ v-else + class="content markdown-body" + v-html="renderMarkdown(displayStreamingContent)" + >
+
-
- - 提示词已优化,可以生成代码了! -
+
+ + AI 觉得要求已经写清楚了,可以生成网页了 +
-
- - -
- - 停止 - - - 发送 - -
+
+
你的要求
+ + + + 停止 - - 生成代码 + 让 AI 再看看 + Enter 发送,Shift + Enter 换行 -
+ + + 用这段生成网页 + +
@@ -106,13 +98,23 @@ const emit = defineEmits<{ const draftPrompt = ref("") const messagesRef = ref() +// 第几版要求:只数学生发的 +function versionOf(index: number) { + return messages.value.slice(0, index + 1).filter((m) => m.role === "user").length +} + +// 没改过就不用再发一遍 +const lastSent = computed( + () => [...messages.value].reverse().find((m) => m.role === "user")?.content.trim() ?? "", +) + const displayStreamingContent = computed(() => streamingContent.value.replace(/^\[READY\]\n?/, "") ) function send() { const text = draftPrompt.value.trim() - if (!text || streaming.value) return + if (!text || streaming.value || text === lastSent.value) return sendGuidance(text) } @@ -141,87 +143,113 @@ watch([() => messages.value.length, streamingContent], () => {