feat(editor): add audio region volume control#354
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds per-audio-region volume controls and delete support: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
bffa2a6 to
bd12ab2
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/video-editor/VideoEditor.tsx`:
- Around line 3260-3271: The handler handleAudioVolumeChange currently treats
non-finite volume as 1, which can spike audio; change it to ignore invalid input
instead of defaulting to 100%: inside handleAudioVolumeChange (and before
calling setAudioRegions) validate Number.isFinite(volume) and if it's false
simply return (no state update) so the existing region.volume is preserved for
the selectedAudioId; locate the update logic that maps regions
(setAudioRegions(prev) => prev.map(...)) and only run that when the sanitized
nextVolume is a finite number within [0,1].
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6167c514-7659-4d2d-9898-0e6b922219f8
📒 Files selected for processing (3)
src/components/video-editor/SettingsPanel.tsxsrc/components/video-editor/VideoEditor.tsxsrc/components/video-editor/timeline/Row.tsx
Description
Add a volume control for the currently selected added-audio region in the editor settings footer, and keep timeline row hit targets visible so added-audio regions can be selected reliably.
Motivation
Issue #187 reports that added background audio can overpower the original recording, but there is no in-app way to lower that added audio after inserting it. #360 also reports a volume-control problem in the new multi-audio-track editor flow.
Recordly already stores
AudioRegion.volume, applies it during preview playback, persists it in projects, and uses it during export. This PR keeps the change focused on exposing that existing control path in the UI and making the selected-audio row target reachable.Type of Change
Related Issue(s)
Changes Made
Audio Volumepanel when an added audio region is selected on the timelineAudioRegion.volumefield[0, 1]volume rangeScope Note
This PR only addresses added-audio volume control and the small timeline hit-target issue needed to make that control reachable. The audio-track scrolling fix is handled by #361, and the 1.5x export speed fix is handled by #362.
Testing Guide
Audio Volumepanel appears in the settings footer.Checklist
Local checks run:
vitest run src/components/video-editor/audio.test.ts src/components/video-editor/timeline/timelineLayout.test.tstsc --noEmitbiome check --formatter-enabled=false src/components/video-editor/VideoEditor.tsx src/components/video-editor/SettingsPanel.tsx src/components/video-editor/timeline/Row.tsxgit diff --checkvite build --config vite.config.tsRuntime UI smoke:
vite previewon a clean porttoneaudio region on the timelineAudio Volumepanel appeared in the settings footer25%25%volume = 0.25Runtime export smoke:
100%export: success, 5.00s output, AAC audio,mean_volume: -21.1 dB0%export: success, 5.00s output, AAC audio,mean_volume: -91.0 dBSummary by CodeRabbit
New Features
Bug Fixes
Style/UI