From 7225eeb378fcc46c29ef98f856df1cf4caedbb27 Mon Sep 17 00:00:00 2001 From: whf <2399365302@qq.com> Date: Tue, 12 May 2026 22:27:04 +0800 Subject: [PATCH] fix: restore guided_learning frontend UI integration lost in upstream merge --- .../(workspace)/chat/[[...sessionId]]/page.tsx | 16 ++++++++++++---- web/components/chat/home/ChatMessages.tsx | 5 +++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/web/app/(workspace)/chat/[[...sessionId]]/page.tsx b/web/app/(workspace)/chat/[[...sessionId]]/page.tsx index a933ebd74..279e27c24 100644 --- a/web/app/(workspace)/chat/[[...sessionId]]/page.tsx +++ b/web/app/(workspace)/chat/[[...sessionId]]/page.tsx @@ -224,10 +224,18 @@ const CAPABILITIES: CapabilityDef[] = [ label: "Visualize", description: "Generate SVG, Chart.js, or Mermaid visualizations", icon: BarChart3, - allowedTools: [], - defaultTools: [], - }, -]; + allowedTools: [], + defaultTools: [], + }, + { + value: "guided_learning", + label: "Guided Learning", + description: "Framework v1.8.2 — diagnostic, mastery-based study, spaced repetition", + icon: Lightbulb, + allowedTools: ["rag", "web_search", "code_execution"], + defaultTools: ["rag"], + }, +]; interface KnowledgeBase { name: string; diff --git a/web/components/chat/home/ChatMessages.tsx b/web/components/chat/home/ChatMessages.tsx index 7e08b4b0b..012fd309d 100644 --- a/web/components/chat/home/ChatMessages.tsx +++ b/web/components/chat/home/ChatMessages.tsx @@ -73,8 +73,9 @@ function getModeBadgeLabel(capability?: string | null): string { if (capability === "deep_question") return "Quiz Generation"; if (capability === "deep_research") return "Deep Research"; if (capability === "math_animator") return "Math Animator"; - if (capability === "visualize") return "Visualize"; - return capability; + if (capability === "visualize") return "Visualize"; + if (capability === "guided_learning") return "Guided Learning"; + return capability; } function imageSrcForAttachment(attachment: MessageAttachment): string | null {