feat(editor): drums are a selectable part in the arrangement switcher - #337
Conversation
|
Warning Review limit reached
Next review available in: 39 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 (7)
✨ 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 |
…#337) Includes review fixes: drop stale view lenses when switching parts in the switcher. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
8fa0341 to
a723920
Compare
Stacked on #336 (which is stacked on #335). Merge order: #335 → #336 → this.
What
Builds on the drums-as-arrangement foundation (#336): the drums arrangement now appears as a "🥁 Drums" option in the part switcher, so you open the drum editor by picking it — exactly like switching to Lead/Rhythm/Bass — instead of a mode button off to the side. Drums become a first-class part in the one place parts are chosen, and the set-up for choosing between multiple drum charts later.
Safe invariant kept
S.currentArrnever moves onto the drums arrangement. The drum grid stays a MODE (S.drumEditMode) over the current pitched part — a brand-newcurrentArr === drumsstate would have exposed the drums arrangement (empty notes, no tuning) to the pervasive "current arrangement" readers, none of which expect it. So:editorSwitcherSelectwrapper (the<select>onchange) routes a drums option into drum-edit mode without touchingcurrentArr(mirrors the Tracks 'drums' row /openTrackSessionTarget); a pitched option leaves drum mode and selects it normally;editorSelectArrangementstays drums-unaware, so its other callers (undo replay, the Tracks row) are unchanged, and a drums index can never reach it (theisDrumArrangementbranch returns first).Changes
screen.html: switcher onchange →editorSwitcherSelect.main.js:editorSwitcherSelect(new);updateArrangementSelectorlists the 🥁-marked drums option and, while drum-edit mode is on, displays it as selected via the newswitcherShownIndexpure (currentArr stays pitched);openTrackSessionTargetrefreshes the selector.drum.js: the 🥁 Edit Drums toggle refreshes the selector too — all three drum entry points keep the dropdown in sync.drum-arrangement.js:drumArrangementIndex+switcherShownIndex(pure).Verification
Runtime-verified (Playwright, isolated host, the one library pack with drums — keys arr + drums): dropdown shows
[Keys, 🥁 Drums]; selecting Drums opens the drum grid and shows 🥁 Drums selected; selecting Keys returns the piano roll; the 🥁 Edit Drums toggle also flips the dropdown; no console errors; the pitched view is intact after toggling back (currentArr never landed on drums).Gates: JS 297/0 · lint 0 err / 3 baseline ·
routes.pyuntouched (no pytest). Tests:drum_arrangement.test.mjs+2 (drumArrangementIndex,switcherShownIndex).Next in the arc
N drums (drop the one-drum block) → the per-arrangement
drum_tabbuild format (needs the feedpak-spec FEP + core loader) → region R3b.🤖 Generated with Claude Code