fix: live transcription partials update in place instead of stacking rows

- lk.transcription handler now uses addPartial() (in-place update)
  instead of addMessage() (new row per word)
- addMessage() clears stale partials before rendering the final
This commit is contained in:
Shane
2026-08-22 15:57:27 -04:00
parent c2f4c62aad
commit 24026e47de
+3 -1
View File
@@ -264,6 +264,7 @@ function renderMessage(msg) {
} }
function addMessage(role, text) { function addMessage(role, text) {
clearPartials();
const msg = { role, text, ts: Date.now() }; const msg = { role, text, ts: Date.now() };
history.push(msg); history.push(msg);
persistHistory(); persistHistory();
@@ -335,7 +336,8 @@ function registerTranscriptionStream(rm) {
if (pub) { role = isAgent(p) ? "agent" : "user"; break; } if (pub) { role = isAgent(p) ? "agent" : "user"; break; }
} }
} }
addMessage(role, text.trim()); // Use partial rendering: updates the same row in place until final.
addPartial(role, text.trim());
}); });
} catch (e) { } catch (e) {
// Older SDKs may not support registerTextStreamHandler — the data // Older SDKs may not support registerTextStreamHandler — the data