浏览代码

feat(speaking): record start work entry on fresh "开始对话" click

Injects recordSpeakingStart and fires it once inside startDialogue(),
right after the existing notifySpeakingProgress('active', ...) broadcast.
The resume path (loadLatestStudentSession) and completion path
(handleDialogueComplete) deliberately do NOT call it — idempotency is
enforced purely at the call site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jimmylee 3 月之前
父节点
当前提交
1ecc645de2
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/views/Editor/EnglishSpeaking/preview/TopicDiscussionPreview.vue

+ 2 - 0
src/views/Editor/EnglishSpeaking/preview/TopicDiscussionPreview.vue

@@ -112,6 +112,7 @@ type SpeakingNotify = (
   payload: { configId: string; sessionId: string },
 ) => void
 const notifySpeakingProgress = inject<SpeakingNotify>('notifySpeakingProgress', () => {})
+const recordSpeakingStart = inject<(sessionId: string) => void>('recordSpeakingStart', () => {})
 
 const speakingStore = useSpeakingStore()
 
@@ -334,6 +335,7 @@ async function startDialogue() {
       configId: props.configId || '',
       sessionId: preparedSession.value?.sessionId || '',
     })
+    recordSpeakingStart(preparedSession.value?.sessionId || '')
   } catch (err: unknown) {
     if (err instanceof DialogueApiError) {
       sessionError.value = `创建会话失败(${err.status}),请重试`