Skip to content

Fix fretboard layout for variable string counts - #20

Open
raphaelmorrissy wants to merge 1 commit into
got-feedBack:mainfrom
raphaelmorrissy:fix/19-dynamic-string-count
Open

raphaelmorrissy wants to merge 1 commit into
got-feedBack:mainfrom
raphaelmorrissy:fix/19-dynamic-string-count

Conversation

@raphaelmorrissy

@raphaelmorrissy raphaelmorrissy commented Aug 31, 2026 •

Copy link
Copy Markdown

Summary

  • derive the fretboard string count from highway.getStringCount() when available
  • fall back to chart metadata and instrument-aware defaults for older hosts
  • generate labels, colors, spacing, and note row mapping for 4-, 5-, 6-, 7-, and 8-string arrangements
  • ignore note string indices that fall outside the resolved fretboard

Testing

  • node tests/screen.test.js (16 tests passing)
  • node --check screen.js
  • git diff --check

Fixes #19

Summary by CodeRabbit

  • New Features

    • Fretboards now support varying string counts, including bass and lead instrument configurations.
    • String names, colors, note positions, labels, fretboard geometry, and dot placement adapt automatically to the selected setup.
    • Expanded color options improve string visibility and active-note display.
  • Bug Fixes

    • Invalid string indexes are safely ignored during fretboard rendering.
  • Tests

    • Added coverage for string resolution, tunings, display ordering, colors, and responsive fretboard layouts.

Signed-off-by: Raphael Morrissy <54593695+raphaelmorrissy@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9d9fda5e-9000-4ce8-91d5-675aa1b80351

📥 Commits

Reviewing files that changed from the base of the PR and between 6a4c246 and 72bc37d.

📒 Files selected for processing (2)
  • screen.js
  • tests/screen.test.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The fretboard now supports 4–8 strings, bass metadata, dynamic string names, expanded colors, calculated layout geometry, and validated active-note mapping. New Node exports and tests cover the added helpers.

Changes

Dynamic fretboard rendering

Layer / File(s) Summary
String metadata and layout helpers
screen.js
Added helpers for string-count resolution, instrument-specific names, color selection, display-index validation, and layout calculation.
Dynamic fretboard drawing
screen.js
Updated fret lines, dots, labels, colors, and active-note positions to use the resolved string count.
Helper coverage across configurations
tests/screen.test.js
Added tests for string-count fallbacks, tuning names, display mapping, color formats, and layout positions across supported configurations.

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

Merge Risk: ⚪ Minimal · up to 72bc3

The change updates fretboard rendering for variable string counts and adds coverage for supported arrangements and fallback behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: byrongamatos

Sequence Diagram(s)

sequenceDiagram
  participant HighwayAPI
  participant _fbDraw
  participant Helpers
  participant FretboardCanvas
  HighwayAPI->>_fbDraw: Provide song metadata and string count
  _fbDraw->>Helpers: Resolve count, names, colors, and layout
  Helpers-->>_fbDraw: Return dynamic fretboard values
  _fbDraw->>FretboardCanvas: Draw strings, labels, dots, and notes
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: correcting fretboard layout behavior for variable string counts.
Linked Issues check ✅ Passed The changes satisfy issue [#19]. They resolve string counts from host data with metadata and instrument-aware fallbacks, generate dynamic names and layouts, support 4- through 8-string arrangements, a…
Out of Scope Changes check ✅ Passed The changes remain within the scope of issue [#19]. The added helpers, dynamic drawing logic, exports, and focused tests directly support variable-string fretboard rendering.
Full details: Linked Issues check

Explanation

The changes satisfy issue [#19]. They resolve string counts from host data with metadata and instrument-aware fallbacks, generate dynamic names and layouts, support 4- through 8-string arrangements, align note rows, and skip invalid string indexes.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@raphaelmorrissy

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 31, 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.

Overlay hardcodes 6 strings — notes misaligned on bass/7-string charts

1 participant