feat(shortcut): add M key to toggle audio mute (#173)#751
Open
Rucha0901 wants to merge 4 commits into
Open
Conversation
- Move M-key handler from AudioSpeedControl into useVideoEditor hook so the shortcut is guarded by ile (only fires when a video is loaded) - Protect against text input focus (INPUT, TEXTAREA, contentEditable) - Also guard against Ctrl/Meta/Alt modifiers to avoid conflicts - Use setRecipe functional update (no stale-closure risk; no extra deps) - Add visible M kbd badge on the mute toggle button for discoverability - Add collapsible KeyboardShortcutsPanel in the right sidebar documenting both shortcuts: M (mute) and Ctrl+Enter (export) Closes magic-peach#173
|
@Rucha0901 is attempting to deploy a commit to the magic-peach1's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
👋 Thanks for your PR, @Rucha0901!Welcome to Reframe — a browser-based video editor built for everyone 🎬 What happens next
Quick checklist
Useful links
Happy coding! 🎉 |
Contributor
✅ PR Format Check Passed — @Rucha0901Basic format checks passed. A maintainer will review your code changes. This does not mean the PR is approved — it just means the format is correct. |
- VideoEditor.tsx: remove role='list' from <ul> (jsx-a11y/no-redundant-roles) ul already has an implicit list role; the explicit attribute is redundant - useVideoEditor.ts: add loopMusic, musicFile, musicVolume, originalAudioVolume to handleExport dependency array (react-hooks/exhaustive-deps)
Upstream added normalizeAudio: boolean as a required second param to buildAudioFilter. Update all test call sites to pass false (no normalization), and add a new test case verifying the loudnorm filter is appended when normalizeAudio is true. Also fix stray '++' syntax corruption in presets.ts introduced during merge.
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
Closes #173
Implements the M key as a keyboard shortcut to toggle audio mute/unmute, following standard video player conventions.
Changes
src/hooks/useVideoEditor.tsuseEffectthat listens for theMkey ondocumentand callssetRecipe(prev => ({ ...prev, keepAudio: !prev.keepAudio })).if (!file) return) - satisfying the acceptance criterion that the shortcut does nothing without a video.INPUT,TEXTAREA,contentEditable) and modifier keys (Ctrl,Meta,Alt) to avoid conflicts with OS shortcuts or typed text.setRecipeupdate - no stale-closure risk and no extra hook dependencies.src/components/AudioSpeedControl.tsxuseEffectkeyboard handler from this component (it lacked thefileguard).Mkbd badge on the mute toggle button so users can discover the shortcut at a glance.src/components/VideoEditor.tsxKeyboardShortcutsPanel- a collapsible panel in the right sidebar that documents all keyboard shortcuts:Acceptance Criteria