Keep global shortcuts alive after a file picker - #73
Merged
Conversation
The desktop File > Open Project... menu clicks a hidden <input type="file">, which keeps focus once the OS picker closes. The global keydown handler bails on any focused <input>, so from that point on space (play/pause), S, Cmd+Z and Delete were dead for the rest of the session. The transcript Import label uses the same hidden-input trick and broke them the same way. File inputs never receive typed text, so exclude them from the guard. Pulled the predicate into isTypingTarget() and reused it in the two TranscriptPanel handlers (Escape, @) that had the same copy-pasted check. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem
The space bar play/pause hotkey stopped working. The code was never removed — the guard in the global keydown handler was swallowing it.
71d4168added a persistent hidden<input type="file">(components/Editor.tsx:401) that the desktop File › Open Project… menu clicks. Clicking a file input focuses it, and it stays focused after the OS picker closes. The handler bails on any focused<input>, so from then on every global shortcut — space,S, ⌘Z, Delete — is dead for the rest of the session. The transcript Import label uses the same hidden-input trick and breaks them the same way.Fix
File inputs can't receive typed text, so they shouldn't count as a typing target.
lib/keyboard.ts(new) —isTypingTarget(): contentEditable /TEXTAREA/INPUTexcepttype="file".components/Editor.tsx— global shortcut handler uses it.components/TranscriptPanel.tsx— the Escape and@handlers had the same copy-pasted guard and the same latent bug; both now use it.Testing
Typecheck and lint pass. Not yet verified end-to-end in the desktop app — repro is: open a project via the File menu, then press space.
🤖 Generated with Claude Code