feat(editor): drum grid row density — Full / Compact family rows - #120
Conversation
EDITOR-VIEW-MODALITY-DESIGN P2 (VD.1, decision V6): one grid, density presets, never a second data path or a parallel "game-style" editor. - Lane geometry now routes through a density lane table: Full = one row per piece (today's grid unchanged), Compact = the community 7-row family shape (crash/hi-hat/ride/toms/floor-toms/snare/kick, mirroring core lib/drums.py PRESET_RB4 family boundaries). - Render/selection grouping ONLY: hits keep real piece-ids + per-piece colors; every piece maps to exactly one row (collapse never hides data); hit lookup matches any row member. - Add in a compact row writes the family's CANONICAL piece; a time-only drag keeps the hit's original piece (hh_open never silently becomes hh_closed); crossing rows assigns the target family's canonical — in Full both rules reduce to today's behavior exactly. - "Rows: Full/Compact" button next to Edit Drums (drum mode only), registry command toggleDrumDensity; localStorage pref, never pack. Tests: tests/drum_density.test.js (7) — full-mode identity, total coverage/uniqueness of the compact mapping, canonical membership, junk pref fallback, purity, and the same-row/cross-row drag semantics. Full suite green except the pre-existing CRLF section_coverage failure (#116). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu
|
Important Review skippedNo new commits to review since the last review. ⚙️ 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:
📝 WalkthroughWalkthroughIntroduces a drum grid row density toggle (Full/Compact) with a family-lane mapping table, pure helper functions, localStorage persistence, updated rendering/hit-testing/drag logic keyed off lane index, a new UI toggle button, a Node test suite, and a changelog entry. ChangesDrum row density feature
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant UIButton as editor-drum-density-btn
participant Toggle as _editorToggleDrumDensity
participant LaneTable as _drumLanes / lane helpers
participant Renderer as Drum grid renderer
User->>UIButton: click toggle
UIButton->>Toggle: onclick()
Toggle->>Toggle: flip density, persist preference
Toggle->>Toggle: clear drum selection
Toggle->>Renderer: redraw()
Renderer->>LaneTable: _drumLanes() / _drumLaneIdxForPiece()
LaneTable-->>Renderer: lane rows, canonical pieces
Renderer-->>User: updated grid + status text
Related Issues: None referenced. Related PRs: None referenced. Suggested labels: enhancement, editor, drum-grid Suggested reviewers: None identified from the provided context. 🐰 A drummer's rows once stood alone, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
# Conflicts: # CHANGELOG.md # screen.js
P2 of the view-modality train (
EDITOR-VIEW-MODALITY-DESIGN.mdVD.1, decision V6: one evolving drum grid with density presets — never a parallel "game-style" editor, which could only lose information). Independent of the P1 stack; branched off current main.What
lib/drums.py PRESET_RB4family boundaries — so the backbeat reads at a glance.toggleDrumDensity, localStorage pref — never pack data.Tests
tests/drum_density.test.js(7): full-mode identity with the physical-kit order, total coverage + uniqueness of the compact mapping (no piece falls off the grid), canonical row-membership, junk-pref fallback to Full, table purity (no config mutation leaks), and the same-row/cross-row drag semantics. Full suite green except the pre-existing CRLFsection_coveragefailure (#116 fixes it).Fresh region vs the open queue — drum lane geometry + one toolbar button. (Registry/draw-wrapper insertion points may keep-both against sibling PRs, the usual resolution.)
🤖 Generated with Claude Code
https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu
Summary by CodeRabbit
New Features
Bug Fixes