mirror of
https://github.com/bitbaum/chatkit.git
synced 2026-12-04 05:47:38 +01:00
Android's Chrome-family recognisers (Chrome, Brave, Samsung Internet), with
continuous + interimResults, report one utterance CUMULATIVELY: "why",
"why exactly", "why exactly is", ... - either one result re-reported with
resultIndex 0 on every event, or a new result per event at the next index -
and often every one flagged isFinal. Both the browser leg (listen) and the
preview beside a server recording (startPreview) pushed every final from
resultIndex onwards into an array kept across events, so Substrata's Ask box
on Brave/Android typed the sentence once per word: "why why exactly why
exactly is ...". Desktop Chrome reports stable finals at rising indices, so
it never showed.
heardFromResults (core, pure) now rebuilds the transcript from the WHOLE
results list on every event and collapses a growing chain to its last link:
a result that begins with the previous one's words and adds more replaces it;
once a list has shown that growth, a late shorter/identical re-report is
dropped and a near-identical revision ("is is so" -> "is it so hard")
replaces too. Only the tail may be interim; ending mid-revision delivers the
settled words. Both hooks call it; nothing accumulates between events.
Desktop behaviour is unchanged: different phrases stay, and a word repeated
as separate results ("no", "no", "no") stays repeated. Documented limitation:
"no" then "no no" as two separate results reads as one growing utterance.
Unit fixtures in test/dictation.test.js; test/browser.mjs drives the real
composer with a fake cumulative recogniser (fails on the old hook with the
owner's exact stutter). Released as 0.15.2.
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE
Co-authored-by: Claude <noreply@anthropic.com>