feat(editor): add tempo map signature control - #50
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Review pass (Claude Code) — draft, stacked on #49. Its own change (the Sig beat-count control via |
Signed-off-by: ChrisBeWithYou <chris@rifflarr.local>
b5614b1 to
1513d94
Compare
ac32314 to
fc43f6c
Compare
There was a problem hiding this comment.
Pull request overview
Adds a compact time-signature (“Sig”) control to Tempo Map mode, wiring it through the existing undoable tempo-grid editing path and adding a focused Node-based test for the pure resubdivision helper.
Changes:
- Render/update a new “Sig” input in the toolbar during Tempo Map mode, and expose
window.editorSetTempoSignature. - Extract a pure helper
_tempoSetBeatsPerMeasurePure(with@pure:markers) and route the existing grid command through it. - Add
tests/tempo_map_timesig.test.jsto validate resubdivision behavior and clamping.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| screen.js | Adds the Sig UI control + display updates, exposes editorSetTempoSignature, and extracts/tests a pure resubdivision helper for beat-grid time-signature edits. |
| tests/tempo_map_timesig.test.js | New Node test covering beat-count resubdivision, clamping, and final-measure duration boundary behavior for the new pure helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _renderLoopStrip(); | ||
| updateBPMDisplay(); | ||
| updateTempoSigDisplay(); |
| const prev = _tempoMeasureBeatCount(d); | ||
| _tempoSetBeatsPerMeasure(d, n); | ||
| updateTempoSigDisplay(); | ||
| const next = _tempoMeasureBeatCount(d); |
| _tempoRenumberMeasures(newBeats); | ||
| S.history.exec(new TempoGridCmd(beats.map(b => ({ ...b })), newBeats, 'timesig')); | ||
| updateTempoSigDisplay(); | ||
| draw(); |
Summary
Notes
Testing