style(teacher): make the retry action a playful sticker
This commit is contained in:
1 parent
a7124fb53a
commit
cb48f604dd
7 files changed
+52
-7
No files matched your search
@@ -10,6 +10,13 @@ const samples: Record<string, unknown> = {
|
||||
const scenario = new URLSearchParams(location.search).get('kind') ?? 'ideas';
|
||||
let current: TeacherTopic = { schemaVersion: 1, revision: 1, id: 'discussion-fixture', accountId: 'fixture', projectId: 'fixture', sourceConversationId: 'project', definition, version: 1, createdAt: 'now', updatedAt: 'now', requests: Array.from({ length: 8 }, (_, i) => ({ id: `r${i}`, text: i === 7 ? '我还没想好,我们边聊边想。' : '我希望这个游戏更有意思。', references: [], createdAt: 'now', sourceCursor: { workerGeneration: 0, seq: i }, sourceCapturedAt: 'now', includedSourceMessageIds: [], omittedMessages: 0, status: 'completed', response: i === 7 ? '可以,我们先把已经想到的放在一起。哪里还不确定,就留着继续聊。' : '先从你最在意的一个小地方开始想。', ...(i === 7 ? { suggestedQuestions: ['有什么好玩的想法?'] } : {}) })), ...(samples[scenario] ? { discussion: { id: 'tool', revision: 1, status: 'active', content: structuredClone(samples[scenario]) } } : {}) };
|
||||
const stream = Object.assign(new EventTarget(), { close() {}, onerror: null, onopen: null });
|
||||
if (scenario === 'retry') {
|
||||
const status = new URLSearchParams(location.search).get('status') === 'cancelled' ? 'cancelled' : 'failed';
|
||||
current.requests = [{
|
||||
...current.requests[0], text: '给我一点提示', intent: 'suggestions', status, response: '',
|
||||
...(status === 'failed' ? { error: '这次没连上,我们可以再试一次。' } : {}),
|
||||
}];
|
||||
}
|
||||
if (scenario === 'rich-text') {
|
||||
current.requests = [{
|
||||
...current.requests[0], text: '帮我看看项目和最近的讨论',
|
||||
|
||||
Reference in new issue
Block a user