mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 09:50:24 +08:00
Remove course pages, APIs and the course_study capability. Add anchored note threads and reviewed learning-block generation, queued and withdrawable chat messages, quote attachments, side chats, and the calendar/favorites/navigation updates. Keep preview's existing backend architecture. Wire the new features through its Python application and existing chat engine, retain legacy selected-text requests, persist mid-turn messages in replay, and restore note context when regenerating. Leave stored user data intact. Validate frontend contracts, dependency boundaries, types, 1290 node tests, 840 rendered tests, lint, localization and the production build. Exercise session/notes/API regressions, 53 chat-engine tests and 20 Python/native integration tests with isolated runtime data.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import type { NoteThreadView } from '../model/threads'
|
|
import type { OpenThread, ThreadSendOptions } from './useNoteThreads'
|
|
|
|
export interface NoteCompanionProps {
|
|
pageId: string
|
|
pageTitle?: string
|
|
thread: OpenThread
|
|
bound: boolean
|
|
threads: NoteThreadView[]
|
|
/** Plain text of a block, for naming where a conversation was held. */
|
|
blockText: (blockId: string) => string | null
|
|
/** A learning block's `learning:<kind>`, else the block type; null once gone. */
|
|
blockKind: (blockId: string) => string | null
|
|
/** Another block the learner clicked while this conversation is under way. */
|
|
focus: string | null
|
|
/** Ask about the clicked block, in a conversation of its own. */
|
|
onAskFocus: (draft: string) => void
|
|
onDismissFocus: () => void
|
|
prefill: { id: number; text: string } | null
|
|
onSend: (content: string, options?: ThreadSendOptions) => void
|
|
/** Insert a learning block after the line and fill it from this thread;
|
|
* `again` fills the block the thread was opened to regenerate instead. */
|
|
onMake: (kind: string, prompt: string, again?: boolean) => void
|
|
onRegenerate: () => void
|
|
onSelect: (sessionId: string) => void
|
|
onNewHere: () => void
|
|
onJump: () => void
|
|
onSuggestions: () => void
|
|
onClose: () => void
|
|
}
|