fix: show and dismiss teacher introductions as one group

This commit is contained in:
鲨鱼辣椒 committed 2026-09-29 23:06:27 +08:00
1 parent a77ddbd681
commit 7458c37fb0
12 files changed
+290 -148

No files matched your search

+2 -2
View File
@@ -25,7 +25,7 @@ export function TeacherCompanion({ companion, open, onOpen, onToggle, bubbleRef,
const agents = companion.selectedAgent && !companion.agents.some((item) => item.teacher_id === activeId)
? [...companion.agents, companion.selectedAgent] : companion.agents;
const viewConversation = () => { companion.dismiss(); onOpen(); };
const meetTeacher = (agentId: string) => { setIntroductionId(null); companion.dismissWelcome(agentId); onOpen(agentId); };
const meetTeacher = (agentId: string) => { setIntroductionId(null); companion.dismissWelcomes(); onOpen(agentId); };
const status = loading ? '正在连接智能体…'
: checking ? '智能体在看看你最近的进展…'
: error || (!enabled ? '智能体暂未开放,仍可查看以往讨论' : open ? '我们慢慢聊,想到什么都可以说' : '点我聊聊,想到什么都可以说');
@@ -74,7 +74,7 @@ export function TeacherCompanion({ companion, open, onOpen, onToggle, bubbleRef,
<span className="teacher-welcome-text" title={item.text}>{item.text}</span>
<span className="teacher-welcome-action">和我聊聊 <ArrowUpRight aria-hidden="true" className="h-3 w-3" /></span>
</button>
<button type="button" className="teacher-welcome-dismiss" aria-label={`收起${item.definition.name}的介绍`} onClick={() => companion.dismissWelcome(item.agentId)}>
<button type="button" className="teacher-welcome-dismiss" aria-label={`收起全部老师介绍(${item.definition.name})`} onClick={() => companion.dismissWelcomes()}>
<X className="h-3.5 w-3.5" aria-hidden="true" />
</button>
</div>