Skip to content

feat(editor): drums are a selectable part in the arrangement switcher - #337

Merged
byrongamatos merged 1 commit into
mainfrom
mt-drums-p2
Jul 21, 2026
Merged

feat(editor): drums are a selectable part in the arrangement switcher#337
byrongamatos merged 1 commit into
mainfrom
mt-drums-p2

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

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.currentArr never moves onto the drums arrangement. The drum grid stays a MODE (S.drumEditMode) over the current pitched part — a brand-new currentArr === drums state would have exposed the drums arrangement (empty notes, no tuning) to the pervasive "current arrangement" readers, none of which expect it. So:

  • a new editorSwitcherSelect wrapper (the <select> onchange) routes a drums option into drum-edit mode without touching currentArr (mirrors the Tracks 'drums' row / openTrackSessionTarget); a pitched option leaves drum mode and selects it normally;
  • editorSelectArrangement stays drums-unaware, so its other callers (undo replay, the Tracks row) are unchanged, and a drums index can never reach it (the isDrumArrangement branch returns first).

Changes

  • screen.html: switcher onchange → editorSwitcherSelect.
  • main.js: editorSwitcherSelect (new); updateArrangementSelector lists the 🥁-marked drums option and, while drum-edit mode is on, displays it as selected via the new switcherShownIndex pure (currentArr stays pitched); openTrackSessionTarget refreshes 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.py untouched (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_tab build format (needs the feedpak-spec FEP + core loader) → region R3b.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@byrongamatos, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28c144b2-a105-46e8-91c0-a51282b95b7b

📥 Commits

Reviewing files that changed from the base of the PR and between 96de8e7 and a723920.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • screen.html
  • src/drum-arrangement.js
  • src/drum.js
  • src/main.js
  • tests/drum_arrangement.test.mjs
  • tests/view_switcher.test.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mt-drums-p2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…#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>
@byrongamatos
byrongamatos merged commit f60e5f8 into main Jul 21, 2026
3 of 4 checks passed
@byrongamatos
byrongamatos deleted the mt-drums-p2 branch July 21, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants