From 0dbcad771b7169e536aa5392d8677cddc5bc866d Mon Sep 17 00:00:00 2001
From: ValueOn AG
Date: Sat, 7 Mar 2026 02:12:22 +0100
Subject: [PATCH] fix: Transcript isContinuation - merged STT-Chunks updaten
statt duplizieren
Made-with: Cursor
---
src/api/teamsbotApi.ts | 2 ++
src/pages/views/teamsbot/TeamsbotSessionView.tsx | 14 +++++++++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/api/teamsbotApi.ts b/src/api/teamsbotApi.ts
index 3216050..607d998 100644
--- a/src/api/teamsbotApi.ts
+++ b/src/api/teamsbotApi.ts
@@ -33,6 +33,8 @@ export interface TeamsbotTranscript {
confidence: number;
language?: string;
isFinal: boolean;
+ isContinuation?: boolean;
+ source?: string;
}
export interface TeamsbotBotResponse {
diff --git a/src/pages/views/teamsbot/TeamsbotSessionView.tsx b/src/pages/views/teamsbot/TeamsbotSessionView.tsx
index e002a57..345524c 100644
--- a/src/pages/views/teamsbot/TeamsbotSessionView.tsx
+++ b/src/pages/views/teamsbot/TeamsbotSessionView.tsx
@@ -126,7 +126,19 @@ export const TeamsbotSessionView: React.FC = () => {
case 'transcript': {
const t = sseEvent.data as TeamsbotTranscript;
_dlog('TRANSCRIPT', `[${t?.speaker || '?'}] ${(t?.text || '').substring(0, 50)}...`);
- setTranscripts(prev => [...prev, t]);
+ if (t?.isContinuation && t?.id) {
+ setTranscripts(prev => {
+ const idx = prev.findIndex(x => x.id === t.id);
+ if (idx >= 0) {
+ const updated = [...prev];
+ updated[idx] = { ...updated[idx], ...t };
+ return updated;
+ }
+ return [...prev, t];
+ });
+ } else {
+ setTranscripts(prev => [...prev, t]);
+ }
break;
}