Repository navigation
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This branch has not been deployed
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.
Closes #1628 (the main part: "more detail as the timeline is zoomed in").
Problem
ClipWaveformalways drew one sample per ~125 ms of source (capped at 400), whatever the zoom level. The peak data underneath is much finer (up to 200 blocks/s), but zooming in only stretched the same coarse curve. Word boundaries and short pauses got folded into one bump, so placing a precise cut was hard.Change
waveformSampleCount(spanSec, detailPxPerSec, rangeBlocks): the sample count now follows how wide the clip is on screen, at one sample per 3 px. It is bounded:waveformDetailScale(pxPerSec): rounds the timeline scale up to a power of two (0 while the timeline is unmeasured). The memoised waveforms therefore only rebuild each time the zoom doubles, not on every wheel tick. Rounding up means the detail is never coarser than what is on screen.ClipWaveform(clip pills, audio-lane pills and their ghosts) as a prop, the same waygainis, so the per-clip memo stays intact.The drawing style is unchanged (the same smoothed filled area). The spline passes through every sample, so once samples are this dense the peaks and the dips between words show up directly.
I did not implement the optional taller track / vertical zoom. That is a separate UI/design decision.
Tests
V4Timeline.waveform.test.tsx:I could not run the tests here; the expected values were worked out by hand.
Fixes #1628
Happy to adjust anything or close it if it isn't a fit.