Skip to content

fix: exclude ignored notation from chord diagrams - #77

Merged
stufro merged 1 commit into
stufro:mainfrom
snowyukitty:fix/ignore-non-chord-diagrams
Jul 29, 2026
Merged

stufro merged 1 commit into
stufro:mainfrom
snowyukitty:fix/ignore-non-chord-diagrams

Conversation

@snowyukitty

Copy link
Copy Markdown
Contributor

Fixes #70.

Summary

  • Exclude bar/repeat markers, asterisks, and N.C. from the chord names used
    to render diagrams.
  • Preserve real chord names, including slash chords such as D/F#, and the
    existing annotation filtering.
  • Add regression coverage for every notation form already treated as ignored
    when chord lines are parsed.

Why

ChordSheet#unique_chords feeds both the guitar and ukulele diagram renderers.
It removed bracketed annotations, but it still returned other permitted
chord-sheet notation as chord names. A bar line such as | therefore reached
the renderer and produced a missing-chord placeholder.

The updated sanitization mirrors the ignored notation used when classifying
chord lines, so D |: D/F# :| G* N.C. now yields only D, D/F#, and G.

Testing

  • Full RSpec suite: 170 examples, 0 failures.
  • Related model specs: 37 examples, 0 failures.
  • RuboCop on the changed files: no offenses.
  • Full-project RuboCop: 72 files, no offenses.
  • Brakeman, Bundler Audit, Rails Best Practices, and Slim-Lint: passed.
  • Cypress guitar and ukulele chord-diagram scenarios: passed on every run.

The default Rake pipeline reached Cypress after all preceding checks passed.
The full Cypress run completed 48 of 51 cases; its three failures were unrelated
textarea/sorting timing cases. Focused reruns changed the failure set, and the
exact pre-change base also reproduced existing sorting and version-history
timing failures.

@stufro stufro left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙇

@stufro
stufro merged commit 68b18b5 into stufro:main Jul 29, 2026
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.

Don't show chord diagram for ignored characters

2 participants