feat(editor): drums become a type:"drums" arrangement (model foundation) - #336
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
✨ 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 |
948edb2 to
e4d0e83
Compare
…on) (#336) Includes review fixes: audit S.arrangements consumers after materializing drums. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e2133e2 to
555d3e1
Compare
Stacked on #335 (needs
arrKind/_arrTypeKind/ thetyperound-trip). Review/merge #335 first; I'll retarget this tomainafter.What & why
The foundation for multiple drum charts (the drums-as-arrangements arc). The single drum tab has always lived entirely outside
S.arrangements[]as a lone off-array singleton edited through a global mode — the one instrument that isn't an ordinary arrangement. This gives it a home in the list as a derivedtype:"drums"arrangement (via the #335 instrument-type-as-data seam), the substrate multiple drum charts grow from.Byte-identical: no pack change, no UI change, drum-editor undo untouched.
routes.pyuntouched.How
New leaf
src/drum-arrangement.js:syncDrumArrangement(S)materializes / updates / removes the drums arrangement so its.drumTabpayload isS.drumTab— the same object reference, so every existingS.drumTabreader/mutator and every drum undo command (which hold references intoS.drumTab.hits) keep working unchanged. Appends (never inserts), so existing arr indices /arr:<idx>keys are stable. Called at everyS.drumTab(re)assignment: load migration, GP/MIDI import + empty-add, delete + its undo-restore.isDrumArrangementkeys on the authoredtypealone (normalized), notarrKind—arrKindwould name-infer and wrongly catch a pitched part a user literally named "Drums", then hide/drop it.pitchedArrangementCount/clampAwayFromDrums/pitchedIndexOfkeep index math correct now thatS.arrangements[]can hold a drums entry: the remove-last-arrangement guard counts pitched parts,S.currentArrnever lands on drums, and the/remove-arrangementbackend index maps to its pitched-only position (the backend manifest has no drums arrangement).Byte-identical surfaces (drums bridged to the legacy paths; promoting them to
arr:<idx>+ drum-edit-via-selection is the follow-up):_buildSaveBody,editorBuild): the drums arrangement is excluded frombody.arrangements— drums still persist as the song-leveldrum_tab, so the built pack is byte-identical (and no drums entry reachesarrangements[], where an old core would fretted-grade it as garbage).'drums'target/key.Tests
tests/drum_arrangement.test.mjs(+15): the sync state machine (materialize/update/remove/idempotent/append/same-ref/degrade), the remove→restore undo round-trip, byte-identical load→save, the "Drums"-named-but-untyped safety case (survives save, keeps its arr target), no duplicate tracks/band rows, and the index helpers incl. the interspersed-drums backend index.Gates: JS 297/0 · lint 0 err / 3 baseline ·
routes.pyuntouched (no pytest).Next in the arc
Promote the tracks/mixer/switcher off the legacy
'drums'singleton →arr:<idx>+ open the drum grid via arrangement selection; then N drums; then the per-arrangementdrum_tabbuild format (with the spec/core FEP); then the region R3b import driver.🤖 Generated with Claude Code