feat: 按老师发布配置渲染快捷提示

This commit is contained in:
2026-09-29 17:04:55 +08:00
committed by 鲨鱼辣椒
parent 78cfde6734
commit bb96941461
6 changed files with 100 additions and 2 deletions

View File

@@ -9,6 +9,12 @@ const samples: Record<string, unknown> = {
comparison: { kind: 'comparison', title: '哪一种更像你想要的小狗?', columns: [{ id: 'click', label: '点了才回应' }, { id: 'active', label: '会主动找我' }], rows: [{ id: 'home', label: '刚回到家的时候', cells: [{ columnId: 'click', text: '等我点一下,才跳起来。' }, { columnId: 'active', text: '看见我就跑过来,还带着玩具。' }] }, { id: 'busy', label: '我忙着种东西的时候', cells: [{ columnId: 'click', text: '安静等着,不打扰我。' }, { columnId: 'active', text: '有时来蹭一蹭,可能也会打断我。' }] }] },
};
const scenario = new URLSearchParams(location.search).get('kind') ?? 'ideas';
if (scenario === 'shortcuts') definition.shortcuts = [
{ label: '看看进展', prompt: '请结合当前项目,分析我最近完成的工作。' },
{ label: '解释代码', prompt: '请解释当前项目最近的代码改动,用一个具体例子帮助我理解。' },
...Array.from({ length: 6 }, (_, i) => ({ label: `入口${i + 3}:看看我的项目进展,帮我理解当前代码并提出下一步的编程建议`, prompt: `请讨论第 ${i + 3} 个主题。` })),
];
if (scenario === 'shortcuts-empty') definition.shortcuts = [];
export const fixtureAgent = { teacher_id: definition.teacher_id, version: 1, is_default: true, definition };
const continuous = new URLSearchParams(location.search).get('chat') !== 'legacy';
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: [], projectId: 'fixture', sourceConversationId: 'source', teacherVersion: 1, createdAt: `2026-09-28T10:00:${String(i).padStart(2, '0')}Z`, 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]) } } : {}) };