Add waveform zoom in/out support#97
Conversation
Bump ggml: cuda gains bf16 bin_bcast, metal gains f16 and bf16 bin and unary ops. The snake fusion chain (mul, sin, sqr, mul, add) now runs at f32, f16 and bf16 storage on CPU, CUDA and Metal, with f32 compute everywhere. This is backend plumbing only: each project still needs one commit to switch its vocoder activation dtype and benefit from the halved bandwidth.
im2col now reads f16 data on CPU, CUDA, Vulkan and Metal, closing the last f32 lock on convolution inputs. Vocoder activation chains can hold f16 storage from one mul_mat output to the next across snake, im2col and col2im. Plumbing only: each project still needs its vae dtype switch to benefit.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesThe waveform now supports zoomed visible ranges, range selection, panning, and scrollbar navigation. Waveform zoom
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SongCard
participant Waveform
User->>Waveform: Select or pan waveform range
Waveform->>SongCard: Report zoom selection
SongCard->>Waveform: Update visible range
Waveform->>Waveform: Recompute display peaks and redraw
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/webui/src/components/Waveform.svelte`:
- Around line 151-159: Eliminate duplicate synchronous peak scans during
waveform panning by ensuring each bound-state update triggers only one
computePeaksRange() path; remove direct updateDisplayPeaks()/draw() calls from
the keyboard, wheel, scrollbar, and related handlers where the reactive effect
already performs them. Throttle the remaining rendering or reuse precomputed
level-of-detail peaks so rapid pointer movement does not rescan the visible
audio interval repeatedly.
- Around line 141-164: Update the Waveform keyboard and scrollbar interaction
around onKeyDown/onKeyUp so arrow navigation is handled only by a focusable
waveform or scrollbar, not by global mouseOver state. Make the scrollbar
keyboard-focusable with appropriate scrollbar semantics, move key handling to
the focused element, and enlarge its 5px interaction target while preserving
existing navigation behavior. Apply the same focus and interaction-target
changes to the related scrollbar handlers.
- Around line 102-139: Replace the separate onTouchStart/onTouchMove/onTouchEnd
touch handlers with a single pointer-event state machine for two-finger zoom,
ensuring the initial finger cannot trigger seeking or mutate rangeStart/rangeEnd
before zoom begins. Update the canvas listener setup to use pointer events
consistently, and make pointer cancellation abort and clear the in-progress
selection without invoking onZoomSelect.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: b983bdbc-83d7-4977-a944-51ca943e18a9
📒 Files selected for processing (2)
tools/webui/src/components/SongCard.sveltetools/webui/src/components/Waveform.svelte
Being able to precisely select portions of the waveform is difficult when the song is of any decent length. This PR adds support for a "rubber band" zoom selection by holding shift, left-clicking, and dragging (two finger touch on mobile). The waveform viewport will be zoomed and the user has the ability to zoom back out to the last zoom level or all the way out.
During zoom selection:

After zoom selection:

When zoomed, a scrollbar appears under the waveform that allows zooming left and right via scroll wheel or left/right keys.
Summary by CodeRabbit
Summary by CodeRabbit