Skip to content

feat(editor): add snap enable toggle - #58

Merged
byrongamatos merged 1 commit into
feat/editor-expanded-snap-gridfrom
feat/editor-snap-toggle
Jul 5, 2026
Merged

feat(editor): add snap enable toggle#58
byrongamatos merged 1 commit into
feat/editor-expanded-snap-gridfrom
feat/editor-snap-toggle

Conversation

@ChrisBeWithYou

Copy link
Copy Markdown
Contributor

Summary

  • split snap on/off into a dedicated toolbar toggle instead of using Off as a snap resolution
  • preserve the selected snap resolution when snap is disabled
  • wire FeedBack Native G to toggle snapping
  • update snap option and shortcut tests for the separated snap state

Testing

  • node --check screen.js
  • node tests/snap_options.test.js
  • node tests/eof_shortcuts.test.js
  • all tests/*.test.js via node

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b28e5ce2-6f11-477b-a419-1f5d98c5c224

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/editor-snap-toggle

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

@byrongamatos

Copy link
Copy Markdown
Collaborator

Review pass (Claude Code) — stacked on #57. Own snap-toggle logic is correct: snapEnabled (default true) + _editorEffectiveSnapValuePure(enabled, value) → enabled ? value : 0, editorSetSnap now clamps + syncs the select, editorSetSnapEnabled syncs the checkbox. node --check + all JS tests green.

Two things to fix before this lands:

  1. [bug — inherited] Drum-edit G/F shadowed. This stack is based on the pre-fix feat(editor): wire FeedBack Native hotkeys #55: the drum g/f/k articulation handler (screen.js:3886) is still after the shortcut dispatch (3773), and this PR adds FeedBack-Native G → toggleSnap. So in drum-edit mode G toggles snap (and F edits fret) instead of setting ghost/flam. I already fixed exactly this on feat(editor): wire FeedBack Native hotkeys #55's branch (moved the drum g/f/k handler before the dispatch — it covers g/f/k, so G→toggleSnap is correctly shadowed by ghost in drum mode). Rebase feat(editor): add shortcut interaction settings #56feat(editor): add tempo signature denominator control #61 onto the updated feat(editor): wire FeedBack Native hotkeys #55 and it resolves cleanly; I didn't apply a duplicate here because it would conflict on that rebase.
  2. [conflict] Snap model vs editor: upgrade snap grid and timeline jumps #46 + feat(editor): expand snap grid options #57. With feat(editor): expand snap grid options #57 this converges toward editor: upgrade snap grid and timeline jumps #46's snapEnabled model but is still a separate SNAP_OPTIONS definition — same editor: upgrade snap grid and timeline jumps #46 overlap flagged on feat(editor): expand snap grid options #57. (Codex second-opinion rate-limited until ~1 AM — manual + test-backed.)

@byrongamatos
byrongamatos force-pushed the feat/editor-expanded-snap-grid branch from cff0e97 to 93fa52f Compare July 5, 2026 12:24
@byrongamatos
byrongamatos force-pushed the feat/editor-snap-toggle branch from 3ca2420 to bf78154 Compare July 5, 2026 12:25
@byrongamatos
byrongamatos merged commit 0ab2d3a into feat/editor-expanded-snap-grid Jul 5, 2026
1 check passed
byrongamatos pushed a commit that referenced this pull request Jul 5, 2026
The snap grid jumped from 1/4 straight to 1/8 with no quarter- or
eighth-note triplet resolution, so triplet passages could only snap at
1/12T or finer. Add 1/3T (value 1/3) and 1/6T (value 1/6) in value order,
and label the triplet-family divisions (3/6/12/24/48/96) with a T suffix
so the grid reads clearly against the binary options.

The snap <select> options are static in screen.html and index-mapped via
editorSetSnap(selectedIndex), so screen.html, SNAP_OPTIONS, and the
snapIdx default are kept in lockstep; 1/4 shifts from index 2 to 3, so the
S.snapIdx default and snap_options.test.js move with it. snapIdx is not
persisted, so no migration is needed.

Ports the one division set #62 (feat/snap-grid-on-profile-stack) had over
the merged #57/#58 snap options, without adopting its {step} engine.

Tests: snap_options.test.js updated (+1/3, +1/6 subdivisions, new label
list, default index); full editor JS suite green (24 files).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UR2Cr7GEu3yMY7SrfxH6c1
byrongamatos pushed a commit that referenced this pull request Jul 5, 2026
The snap grid jumped from 1/4 straight to 1/8 with no quarter- or
eighth-note triplet resolution, so triplet passages could only snap at
1/12T or finer. Add 1/3T (value 1/3) and 1/6T (value 1/6) in value order,
and label the triplet-family divisions (3/6/12/24/48/96) with a T suffix
so the grid reads clearly against the binary options.

The snap <select> options are static in screen.html and index-mapped via
editorSetSnap(selectedIndex), so screen.html, SNAP_OPTIONS, and the
snapIdx default are kept in lockstep; 1/4 shifts from index 2 to 3, so the
S.snapIdx default and snap_options.test.js move with it. snapIdx is not
persisted, so no migration is needed.

Ports the one division set #62 (feat/snap-grid-on-profile-stack) had over
the merged #57/#58 snap options, without adopting its {step} engine.

Tests: snap_options.test.js updated (+1/3, +1/6 subdivisions, new label
list, default index); full editor JS suite green (24 files).


Claude-Session: https://claude.ai/code/session_01UR2Cr7GEu3yMY7SrfxH6c1

Co-authored-by: ChrisBeWithYou <chris@rifflarr.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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