fix(editor): snap dragged barlines to chart-time onsets (fixes #254) - #255
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTempo-map barline dragging with onset snapping now compares chart-time positions against shift-corrected onsets. The unused unshifted onset import is removed, and the related guard test is updated. ChangesTempo onset snapping
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
_tempoMapOnDragMove snapped a dragged barline to the nearest onset using _ensureOnsets() (BUFFER time) against rawT (CHART time). When the recording is shifted (S.audioShift != 0) the two diverge, so the barline snapped to the un-shifted attack. Use _ensureOnsetsShifted() — the chart-time onsets Suggest-fit already uses. Pre-existing since #235; low impact (only with a shifted audio), undoable, but a wrong snap target. Also drops the now-unused _ensureOnsets import. tempo_onset_snap.test.mjs's source-text assertion updated to _ensureOnsetsShifted. 146 JS green, lint 0-err. Fixes #254. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBQCHCNA81E9tHmSDHSe2Q
byrongamatos
force-pushed
the
fix/editor-tempo-snap-timebase
branch
from
July 14, 2026 17:40
c2116da to
2be6164
Compare
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.
Fixes #254 (Byron's review catch on #249).
_tempoMapOnDragMovesnapped a dragged barline to the nearest detected onset using_ensureOnsets()(buffer time) againstrawT(chart time). When the recording is shifted (S.audioShift != 0) the two time bases diverge, so the barline snapped to the un-shifted attack instead of the heard one.Fix: use
_ensureOnsetsShifted()— the chart-time onsets the Suggest-fit path already uses (tempo.js~L691). Pre-existing since the onset-snap-on-drag change (#235); low impact (only bites with shifted audio), undoable, but a wrong snap target._ensureOnsetsimport fromtempo.js.tempo_onset_snap.test.mjs's source-text assertion updated to_ensureOnsetsShifted.routes.pyuntouched.🤖 Generated with Claude Code
Summary by CodeRabbit