feat(editor): Parts view — stacked overview of every part - #100
Conversation
|
Warning Review limit reached
Next review available in: 35 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 (3)
📝 WalkthroughWalkthroughAdds a new "Parts view" editor mode showing all parts as stacked lanes with playback playhead, click-to-arm and double-click-to-focus-edit interactions, a toolbar toggle button, Shift+A keyboard shortcut, mutual exclusivity with drum-edit/Tempo Map modes, plus tests and changelog entry. ChangesParts View Feature
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Screen as screen.js draw loop
participant PartsView as Parts View handlers
participant Editor as Focus editor (arrangement/drum)
User->>Screen: triggers draw()
Screen->>PartsView: _partsViewDraw(w, h) when S.partsViewMode
User->>Screen: mousedown on lane
Screen->>PartsView: _partsViewOnMouseDown(e, x, y)
PartsView-->>Screen: arms selected part
User->>Screen: double-click on lane
Screen->>PartsView: _partsViewOnDblClick(e)
PartsView->>Editor: opens arrangement editor or enters drum edit mode
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Parts view had three reviewer-confirmed bugs: 1. _partsKindTag and _partsDrawSilhouette called the param-less isBassArr(arr), which ignores its argument and always tests the ARMED arrangement — so every non-armed lane inherited the armed part's bass-ness (wrong instrument tag + wrong ribbon colour). Factored a name-only _partsArrKindPure(name) helper (inside the @pure:parts-view block) that keys off each lane's own name. 2. onKeyDown had no partsViewMode guard, so note-editing shortcuts (f, fret digits, arrows, Delete, technique toggles) stayed live against the armed arrangement behind the read-only overview. Added an early guard that ignores everything except the Shift+A Parts toggle (spacebar/transport is handled above, Escape by the global dialog listener). 3. _partsViewOnDblClick on the drums lane set S.drumEditMode = true directly, bypassing the format === 'sloppak' gate the Edit-Drums button enforces — a non-sloppak session with a drum_tab could enter drum mode with no visible exit. Gated the drums branch on sloppak. Adds a parts_view unit test asserting a Bass lane tags Bass regardless of the armed part. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The editor showed one arrangement at a time through a bare <select>; there was no way to SEE the whole song across parts. Adds a Parts view (Shift+A / the new toolbar button): every part renders as a named horizontal lane over one shared timeline — each arrangement plus the drum tab — with a header (name, instrument tag, event count), a compact silhouette, downbeat grid lines, and one playhead sweeping all lanes during playback. Silhouettes per kind: guitar/bass = string-ribbon rows (low strings at the bottom, matching the focus editor); keys = pitch-mapped mini roll auto-fit to the part's range; drums = the 3-row cymbals/drums/kick collapse (piece colors from DRUM_PIECE_META). Non-active arrangements are not chord-flattened, so silhouettes walk arr.chords[].notes explicitly. The armed part is highlighted. Interaction is deliberately navigational (workspace design D: the overview navigates, focus editors edit): click a lane to arm it (switches the arrangement selector), double-click to open its focus editor — arrangements land in the note editor, the drums lane enters the drum grid. Waveform-band clicks seek, as in every other mode. Mutually exclusive with drum-edit / Tempo Map modes, like they are with each other; joins the command registry in both shortcut profiles. Tests: tests/parts_view.test.js (5 cases: part-list assembly incl. chord counting + drums lane, lane layout clamps, 3-band drum mapping, lane hit-testing). node --check clean; all 26 JS test files pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu
Parts view had three reviewer-confirmed bugs: 1. _partsKindTag and _partsDrawSilhouette called the param-less isBassArr(arr), which ignores its argument and always tests the ARMED arrangement — so every non-armed lane inherited the armed part's bass-ness (wrong instrument tag + wrong ribbon colour). Factored a name-only _partsArrKindPure(name) helper (inside the @pure:parts-view block) that keys off each lane's own name. 2. onKeyDown had no partsViewMode guard, so note-editing shortcuts (f, fret digits, arrows, Delete, technique toggles) stayed live against the armed arrangement behind the read-only overview. Added an early guard that ignores everything except the Shift+A Parts toggle (spacebar/transport is handled above, Escape by the global dialog listener). 3. _partsViewOnDblClick on the drums lane set S.drumEditMode = true directly, bypassing the format === 'sloppak' gate the Edit-Drums button enforces — a non-sloppak session with a drum_tab could enter drum mode with no visible exit. Gated the drums branch on sloppak. Adds a parts_view unit test asserting a Bass lane tags Bass regardless of the armed part. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
75fd762 to
eaf53ca
Compare
Summary
The editor shows one arrangement at a time through a bare
<select>— there's no way to see the whole song. This adds the Parts view (Shift+A in both profiles, or the new "☰ Parts" toolbar button): every part as a named horizontal lane over one shared timeline, with one playhead sweeping all lanes during playback — the first slice of the workspace design's arrange window.chords[].notesexplicitly.Rename/reorder headers, mute/solo per lane, and coverage fills are the next slices on this view (2.2b in the design doc); they need the guide-engine per-part gains (#90) and the rename-safety work (
typestamping) respectively.Verification
node --check screen.jscleantests/parts_view.test.js— 5 cases via the@pure:parts-viewblock (part-list assembly incl. chord-instance counting and the drums lane, empty-drum-tab exclusion, lane-height clamps, 3-band drum mapping, lane hit-testing vs the waveform band)🤖 Generated with Claude Code
https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu
Summary by CodeRabbit
New Features
Tests