Skip to content

feat(editor): Parts view — stacked overview of every part - #100

Merged
byrongamatos merged 2 commits into
mainfrom
feat/editor-parts-view
Jul 6, 2026
Merged

feat(editor): Parts view — stacked overview of every part#100
byrongamatos merged 2 commits into
mainfrom
feat/editor-parts-view

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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.

  • One lane per part: every arrangement plus the drum tab (drums are a song-level sidecar, not an arrangement — they get their own lane). Lane headers show name, inferred instrument tag (Guitar/Bass/Keys/Drums), and event count; the armed part is highlighted.
  • Compact silhouettes per kind: guitar/bass render string-ribbon rows (low strings at the bottom, matching the focus editor's orientation); keys render a pitch-mapped mini roll auto-fit to the part's range; drums collapse to the 3-row cymbals/drums/kick bands with piece colors. Non-active arrangements aren't chord-flattened, so silhouettes walk chords[].notes explicitly.
  • Navigational by design (the overview navigates; focus editors edit): click a lane to arm it, double-click to open its focus editor — arrangements open the note editor, the drums lane enters the drum grid. Waveform clicks seek. Downbeat grid lines run through every lane.
  • Mutually exclusive with drum-edit and Tempo Map modes (same pattern they use with each other); the toggle joins the command registry and the toolbar button follows the memoized-refresh pattern of the drum/tempo buttons.

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 (type stamping) respectively.

Verification

  • node --check screen.js clean
  • New tests/parts_view.test.js — 5 cases via the @pure:parts-view block (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)
  • All 26 JS test files pass

🤖 Generated with Claude Code

https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu

Summary by CodeRabbit

  • New Features

    • Added a new Parts view showing arrangements as stacked lanes along the timeline, with playhead sweeping across all parts.
    • You can now single-click to arm a part and double-click to open its focused editor.
    • Added a Parts toggle button and keyboard shortcut for quickly switching views.
    • Parts view now stays separate from drum edit and tempo map modes.
  • Tests

    • Added coverage for Parts view lane building, layout, and click/selection behavior.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 35 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: 4a9413ec-ebc5-4dbc-a741-65f9e168472a

📥 Commits

Reviewing files that changed from the base of the PR and between c2e20fe and eaf53ca.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • screen.js
  • tests/parts_view.test.js
📝 Walkthrough

Walkthrough

Adds 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.

Changes

Parts View Feature

Layer / File(s) Summary
State flag and core implementation
screen.js
Adds S.partsViewMode state, implements _partsViewDraw, _partsViewOnMouseDown, _partsViewOnDblClick, _editorTogglePartsView (exported as window.editorTogglePartsView), toolbar button management, and short-circuits draw() into the parts-view render path.
Mouse input routing
screen.js
Routes onMouseDown and onDblClick into parts-view handlers when the mode is active, bypassing normal note/tone/anchor handlers.
Keyboard shortcut and command dispatch
screen.js
Adds a togglePartsView shortcut command bound to Shift+A in both shortcut profiles and wires the EOF command switch to invoke _editorTogglePartsView().
Mode mutual exclusivity
screen.js
Clears S.partsViewMode when entering drum edit or tempo-map mode and refreshes the relevant toggle buttons.
Tests and changelog
tests/parts_view.test.js, CHANGELOG.md
Adds a Node test script exercising pure Parts view helper functions (list building, lane layout, drum band mapping, hit-testing) and documents the feature in the changelog.

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
Loading

Possibly related PRs

  • got-feedBack/feedBack-plugin-editor#73: Both PRs modify screen.js's Tempo Map mode toggle and button refresh logic, directly overlapping with this PR's mode-exclusivity changes that clear Parts view state on tempo-map entry.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a stacked Parts view editor overview.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/editor-parts-view

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

byrongamatos added a commit that referenced this pull request Jul 6, 2026
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>
ChrisBeWithYou and others added 2 commits July 6, 2026 21:45
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>
@byrongamatos
byrongamatos force-pushed the feat/editor-parts-view branch from 75fd762 to eaf53ca Compare July 6, 2026 19:45
@byrongamatos
byrongamatos merged commit 57d154a into main Jul 6, 2026
1 check was pending
@byrongamatos
byrongamatos deleted the feat/editor-parts-view branch July 6, 2026 19:45
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