8000 feat(transport): L shortcut to toggle loop mode by johannboehme · Pull Request #16 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

feat(transport): L shortcut to toggle loop mode - #16

Merged
johannboehme merged 1 commit into
mainfrom
claude/objective-agnesi-691bec
May 2, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/objective-agnesi-691bec

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

  • Adds L (and Shift+L) as a focus-independent keyboard shortcut to toggle loop mode in the editor — mirrors the IN/OUT shortcuts (I / O).
  • Behaviour matches the LOOP button click: turn loop off if active, otherwise create a 2-second region from the playhead.
  • Auto-registers in the help overlay (?) under TRANSPORT; description swaps between "Loop a 2-second region from the playhead" and "Disable loop" based on current state.
  • DRY: extracts the existing button-onClick logic into a shared toggleLoop() helper used by both the click handler and the keydown handler.

Why

Loop-toggle was the only transport function without a keyboard shortcut. Pattern follows the existing IN/OUT shortcuts (lower- + uppercase both bound, e.preventDefault(), INPUT/TEXTAREA guard, knob-focus guard).

Test plan

  • L while loop is off → LOOP button glows orange, region appears on timeline
  • L while loop is on → button greys out, region clears
  • Lower- and uppercase both work (l and Shift+L)
  • Help overlay (?) shows the new entry under TRANSPORT with the loop icon and a state-dependent description
  • Focus-independent: listener is on window, only skips when an INPUT / TEXTAREA / contentEditable / knob is focused (matches all other editor shortcuts)
  • Existing IN/OUT loop-edit semantics unaffected

🤖 Generated with Claude Code

Adds a focus-independent keyboard shortcut for toggling loop mode,
mirroring the existing IN/OUT (I/O) shortcuts. Behaviour matches the
LOOP button: turns loop off if active, otherwise creates a 2-second
region from the playhead.

The shortcut auto-registers with the help overlay (?), where its
description switches between "Loop a 2-second region from the
playhead" and "Disable loop" depending on current state, mirroring
how the I/O entries adapt to loop context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@johannboehme
johannboehme merged commit 8650d78 into main May 2, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/objective-agnesi-691bec branch May 2, 2026 18:48
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

0