Repository navigation
Give the keyboard back after using the seek bar - #49
Merged
Merged
Conversation
Clicking the seek bar disabled Space and the arrow keys for the rest of the session. transportHotkeys stands down whenever the event target is an <input>, which a range slider is, and a range natively eats arrow keys to drive its own thumb -- so focus landing there took the transport keys with it. The control added for moving around a song was the one thing that stopped you moving around a song with the keyboard. The guard is not wrong: a slider that the user has deliberately tabbed to should own its arrow keys. So the fix is at the other end -- the seek bar releases focus when the pointer lifts. Click it and the hotkeys come straight back; tab to it and arrow-key adjustment still works, which is the case the guard exists for. The same trap is waiting in every other slider on the play surface (song volume, metronome, piano gain, spacing). They are less exposed because nobody clicks them mid-song, and they are left alone here rather than swept up. Pinned in transportHotkeys.test.ts, where the guard lives, so the next person to add a slider meets this in a test rather than in the app. Co-Authored-By: Claude Opus 5 <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.
Clicking the seek bar disabled Space and the arrow keys for the rest of the session.
transportHotkeysstands down whenever the key event's target is an<input>— which a range slider is — and a range natively consumes arrow keys to drive its own thumb. So focus landing on the seek bar took the transport keys with it. The control added for moving around a song was the one thing that stopped you moving around a song from the keyboard.The fix
The guard isn't wrong: a slider you deliberately tabbed to should own its arrow keys. So the fix is at the other end — the seek bar releases focus when the pointer lifts. Click it and the hotkeys come straight back; tab to it and arrow-key adjustment still works, which is the case the guard exists for.
Not swept up
The same trap sits in every other slider on the play surface — song volume, metronome, piano gain, spacing. They're far less exposed because nobody clicks them mid-song, and they're left alone here rather than bundled into an unrelated fix.
Test
Pinned in
transportHotkeys.test.ts, beside the guard itself, so the next person to add a slider to the play surface meets this in a test rather than in the app. The test asserts both halves: a focused range swallows the keys, and once focus moves away they work again.Full suite: 1215 passed, 3 skipped.
🤖 Generated with Claude Code