fix: show teacher introductions as standalone clickable bubbles

This commit is contained in:
鲨鱼辣椒
2026-09-29 17:16:37 +08:00
parent 2922f35e4b
commit 3a175101c9
11 changed files with 43 additions and 26 deletions

View File

@@ -25,7 +25,6 @@ export function Layout() {
welcomes: new URLSearchParams(location.search).has('teachers') ? agents.flatMap((agent, index) => dismissed.includes(agent.teacher_id)
? [] : [{ agentId: agent.teacher_id, definition: agent.definition, text: agent.definition.description, tone: index }]) : [],
dismissWelcome: (id: string) => setDismissed(values => [...values, id]),
dismissWelcomes: () => setDismissed(['0', '1']),
} as ComponentProps<typeof TeacherCompanion>['companion'];
return <div className="flex h-screen">
{new URLSearchParams(location.search).has('sidebar') && <aside data-testid="project-sidebar" className="shrink-0 border-r p-4 text-sm" style={{ width: 210, background: '#f1f6fc' }}>我的项目</aside>}

View File

@@ -33,7 +33,6 @@ export function Layout() {
welcome: null, enabled: true, loading: false, checking: false, error: null,
welcomes: welcomeMode && !open ? agents.flatMap((agent, index) => dismissed.includes(agent.teacher_id) ? [] : [{ agentId: agent.teacher_id, definition: agent.definition, text: agent.definition.description, tone: index % 3 }]) : [],
dismissWelcome: (id: string) => setDismissed(ids => [...new Set([...ids, id])]),
dismissWelcomes: () => setDismissed(agents.map(agent => agent.teacher_id)),
refreshing, refreshStatus,
refresh: async () => {
setRefreshing(true);