Skip to content

[fix] voice typing: cap overlay preview so long dictation doesn't overflow#93

Open
yui0303 wants to merge 1 commit into
mainfrom
fix/voice-typing-overlay-preview
Open

[fix] voice typing: cap overlay preview so long dictation doesn't overflow#93
yui0303 wants to merge 1 commit into
mainfrom
fix/voice-typing-overlay-preview

Conversation

@yui0303

@yui0303 yui0303 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Holding the push-to-talk key and dictating a lot made the live transcript appear to "stop" partway through. Two root causes, both in the floating overlay (not a time/character limit — there is none in the session, mic capture, or host):

  1. Preview overflow. The overlay window is a fixed 460×180px, but the transcript bubble had no height bound. A long dictation grew the bubble past the window and it got clipped off-screen.
  2. O(n²) conversion. publish re-ran the full Simplified→Traditional (OpenCC) conversion over the entire accumulated transcript on every incoming token, so a long hold got progressively laggier.

Fix

  • Bottom-anchor + clip the bubble (max-h-[84px], flex-col justify-end, overflow-hidden): the newest words stay visible while older lines scroll off the top, so the preview never outgrows the window. The full text still goes to the clipboard / auto-paste unchanged — only the on-screen preview is bounded.
  • Cache the conversion per final segment, converting only the live interim tail each token. Cost stays flat regardless of dictation length. Cache is cleared on each session start.

Notes

🤖 Generated with Claude Code

… overflow

The transcript bubble had no height bound, so a long dictation grew past the
fixed 460x180 overlay window and got clipped off-screen (looked like it
"stopped"). Bottom-anchor + clip the bubble (max-h, overflow-hidden) so the
newest words stay visible while older lines scroll off the top; the full text
still goes to the clipboard unchanged.

Also cache the Simplified->Traditional conversion per final segment instead of
re-converting the whole transcript on every token (was O(n^2) over a long hold).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant