Skip to content

feat(editor): numbered bookmarks — Alt+1-9 jump, Shift+Alt+1-9 set/clear - #114

Merged
byrongamatos merged 3 commits into
mainfrom
feat/editor-bookmarks
Jul 7, 2026
Merged

feat(editor): numbered bookmarks — Alt+1-9 jump, Shift+Alt+1-9 set/clear#114
byrongamatos merged 3 commits into
mainfrom
feat/editor-bookmarks

Conversation

@ChrisBeWithYou

@ChrisBeWithYou ChrisBeWithYou commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Roadmap 2.3 (parity cluster, final item alongside #113): numbered bookmarks for hopping between working spots in a long chart.

What

  • Shift+Alt+1–9 sets/clears a bookmark at the cursor (toggle-set: setting a slot at its own spot clears it); Alt+1–9 jumps to it through the existing _editorSeekToTime (scroll-into-view + mid-playback restart included).
  • Numbered green flags render over the waveform band — hooked through the same typeof-guarded closure as the onset strip, so drawWaveform stays extractable by the render test.
  • Key matching is on the physical key (e.code Digit1–9): with Shift held the digit row produces !,@,… on most layouts, so e.key matching would break. Plain digits still set frets; Ctrl+Alt+digit stays unclaimed. Registry rows in both profiles (gotoBookmark:/setBookmark: prefix commands, the setFretDigit: pattern).
  • Editor authoring state only (design §6): one junk-proof localStorage entry per song, cached per filename so the draw path never parses storage per frame. Never pack data.

Tests

tests/bookmarks.test.js (7 cases): per-song key, junk-proof parsing (bad JSON, arrays, out-of-range slots, negative times), toggle-set semantics + input-map immutability + identity-skip, and dispatch through both real shortcut-profile resolvers including the shifted-digit case. Full JS suite: 42 files green; node --check clean.

Fresh region vs the open queue — waveform-band draw hook, seek helpers region, registry rows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu

Summary by CodeRabbit

  • New Features

    • Added numbered per-song bookmarks (Alt+1–9) to jump within long charts, and Shift+Alt+1–9 to set/clear the bookmark at the cursor.
    • Added green numbered bookmark markers over the waveform for quick navigation.
    • Updated the shortcut panel hints so digit-range bookmark actions show the correct key combinations.
  • Bug Fixes

    • Improved digit shortcut handling to use physical key detection for more consistent behavior.
    • Hardened bookmark persistence/loading to ignore invalid values and prevent them from affecting playback.
  • Tests

    • Added automated tests covering bookmark storage, parsing, toggle behavior, and shortcut dispatch.

@coderabbitai

coderabbitai Bot commented Jul 7, 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: 21 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: a6549d6d-a757-450c-a970-0b521ef69202

📥 Commits

Reviewing files that changed from the base of the PR and between ae8f855 and cdc2960.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • screen.js
📝 Walkthrough

Walkthrough

This PR adds numbered bookmarks with Alt/Shift+Alt digit shortcuts, per-song localStorage persistence, waveform markers, command routing, tests, and changelog notes.

Changes

Numbered bookmarks

Layer / File(s) Summary
Waveform marker rendering
screen.js
Separates onset-strip and bookmark overlay drawing, and renders numbered bookmark markers on the waveform band.
Keyboard shortcuts and command dispatch
screen.js
Adds bookmark digit commands, switches digit detection to e.code, and routes bookmark commands to editor handlers.
Bookmark persistence and editor actions
screen.js
Adds per-song bookmark storage helpers, parsing/toggling logic, caching, and set/goto editor actions.
Tests and changelog
tests/bookmarks.test.js, CHANGELOG.md
Adds tests for storage, parsing, toggle semantics, key dispatch, and shortcut-panel hints, plus a changelog entry.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant KeyHandler
  participant CommandDispatcher
  participant EditorActions
  participant LocalStorage

  User->>KeyHandler: Shift+Alt+Digit
  KeyHandler->>CommandDispatcher: setBookmark:<n>
  CommandDispatcher->>EditorActions: _editorSetBookmark(n)
  EditorActions->>LocalStorage: save bookmark map
  EditorActions-->>User: status update and redraw

  User->>KeyHandler: Alt+Digit
  KeyHandler->>CommandDispatcher: gotoBookmark:<n>
  CommandDispatcher->>EditorActions: _editorGotoBookmark(n)
  EditorActions->>LocalStorage: read bookmark map
  EditorActions-->>User: seek to stored time
Loading

Possibly related PRs

🚥 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 editor bookmark feature and its Alt/Shift+Alt shortcuts.
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-bookmarks

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

Roadmap 2.3 parity cluster. Nine per-song time markers for hopping between
working spots in a long chart:

- Shift+Alt+1-9 sets/clears a bookmark at the cursor (toggle-set: setting
  a slot at its own spot clears it); Alt+1-9 jumps via _editorSeekToTime.
- Numbered green flags render over the waveform band (same typeof-guarded
  hook as the onset strip, so drawWaveform stays test-extractable).
- Key matching uses e.code (physical digit keys) so the shifted digit row
  ('!','@',...) resolves on any layout; plain digits still set frets.
- Editor authoring state only: one localStorage entry per song (parse is
  junk-proof), cached per filename so the draw path never parses per
  frame; never pack data (design section 6).

Tests: tests/bookmarks.test.js (7 cases) — storage/parse/toggle semantics +
both shortcut profiles dispatch. Full JS suite 42 files green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEoFeTPSnz4NpwwCG52hnu
@ChrisBeWithYou
ChrisBeWithYou force-pushed the feat/editor-bookmarks branch from a99cba4 to ca61556 Compare July 7, 2026 21:34
Panel rows for the ready digit-range commands (gotoBookmarkDigit /
setBookmarkDigit) rendered as enabled buttons but _editorRunEofCommand
only handles the per-digit forms, so the clicks were silently inert
(same latent pattern as setFretDigit). Route digit-range panel clicks
through a new pure hint helper so they show which keys to press.
Adds a regression test that fails on pre-fix screen.js.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@byrongamatos

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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