feat: integrate pixel teacher presence and resilient classroom preview
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import type { ConversationNode } from './contracts';
|
||||
import { OPEN_WORK_PROMPT } from '../../shared/coding-work-preview';
|
||||
import { CONTINUE_CODING_PROMPT } from '../../shared/coding-recovery';
|
||||
|
||||
/** Only real user messages name a conversation; no model call or tool output. */
|
||||
export function firstMessageTitle(node: ConversationNode): string | null {
|
||||
if (node.kind !== 'message' || node.role !== 'user' || node.status !== 'complete') return null;
|
||||
const text = node.blocks.flatMap((block) => block.kind === 'text' ? [block.text] : []).join('\n').trim();
|
||||
if (text === OPEN_WORK_PROMPT || text === CONTINUE_CODING_PROMPT) return null;
|
||||
if (text.startsWith('/')) return null;
|
||||
const firstLine = text.split(/\r?\n/)[0].replace(/\s+/g, ' ').trim();
|
||||
return [...firstLine].slice(0, 32).join('')
|
||||
|
||||
Reference in New Issue
Block a user