Fix whisper dictation closing launcher when triggered from within SuperCmd (fixes #251)#292
Open
shobhit99 wants to merge 2 commits into
Open
Fix whisper dictation closing launcher when triggered from within SuperCmd (fixes #251)#292shobhit99 wants to merge 2 commits into
shobhit99 wants to merge 2 commits into
Conversation
Adds a microphone icon button to the launcher search header that triggers the existing Whisper STT system. The button turns red while dictation is active and is only shown when AI is enabled. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…erCmd (fixes #251) When Whisper dictation was triggered while the SuperCmd launcher was visible, the transcribed text was being routed to the previously frontmost external app via activateLastFrontmostApp(), which switched focus away from SuperCmd and effectively closed it. Fix: in whisper-type-text-live, if the launcher is currently visible, skip app-switching entirely and instead send a whisper-insert-into-launcher IPC event directly to the renderer. The renderer inserts the transcribed text at the current cursor position using document.execCommand('insertText'), which works for the search bar, notes, canvas, and any other focused input. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
activateLastFrontmostApp()— switching focus away from SuperCmd and effectively closing itRoot cause
whisper-type-text-liveIPC handler always calledactivateLastFrontmostApp()before typing, regardless of whether the launcher was open. When launched from within SuperCmd, this switched focus to a different app.Fix
main.ts: if the launcher window is currently visible whenwhisper-type-text-liveis called, send awhisper-insert-into-launcherevent directly to the renderer instead of activating another apppreload.ts+electron.d.ts: exposeonWhisperInsertIntoLauncherbridgeApp.tsx: listen forwhisper-insert-into-launcherand insert the transcribed text at the current cursor position usingdocument.execCommand('insertText'), which works for the search bar, notes, canvas, and any focused contenteditableTest plan
Closes #251
🤖 Generated with Claude Code