Skip to content

Move adding tuplets to the selection into EditTuplet - #35427

Merged
davidstephengrant merged 1 commit into
musescore:mainfrom
davidstephengrant:dsg-tuplet-edit-move
Oct 29, 2026
Merged

davidstephengrant merged 1 commit into
musescore:mainfrom
davidstephengrant:dsg-tuplet-edit-move

Conversation

@davidstephengrant

@davidstephengrant davidstephengrant commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

NotationInteraction::addTupletToSelectedChordRests() gathered the selected chords/rests, divided them into tuplets and set the selection afterwards, all in the notation layer, so none of it could be covered by unit tests.

This moves it unchanged into a new EditTuplet::addTuplets() in the engraving module, like the other Edit* classes. The notation side now only runs it in a transaction, as, for instance, addBeamToSelectedChordRests() does. The function returns the new tuplets in score order.

New engraving tests cover the behaviour from #35267: tuplets in score order, the start of the first tuplet selected with its note value as the input duration, a range kept (also across staves), and one tuplet for a note and its linked copy.

No change in behaviour.

Assisted by Claude Code 2.1.310 (Claude Opus 5.5)

NotationInteraction::addTupletToSelectedChordRests() gathered the
selected chords/rests, divided them into tuplets and set the selection
afterwards, out of reach of the engraving tests.

Move this unchanged into the new EditTuplet::addTuplets(), which returns
the tuplets in score order, and test it.

Assisted-by: Claude Code 2.1.310 (Claude Opus 5.5)
@davidstephengrant
davidstephengrant marked this pull request as ready for review October 29, 2026 09:36
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9ed1129 and 8d25cea.

Files selected for processing: 5
  • src/engraving/CMakeLists.txt
  • src/engraving/editing/edittuplet.cpp
  • src/engraving/editing/edittuplet.h
  • src/engraving/tests/tuplet_tests.cpp
  • src/notation/internal/notationinteraction.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The change adds EditTuplet::addTuplets to create tuplets from selected chord/rests. It orders eligible items by tick and track, processes linked groups once, and excludes grace notes and trill cue notes. The method handles ratio adjustment, selection restoration, and input-duration updates. Notation interaction now calls this method in a transaction and notifies about notation changes. New tests cover multiple selections, range preservation, cross-staff ordering, linked staves, and undo.

Priority: Low

Merge Risk: Minimal · up to 8d25c

No actionable regression was found; the change is mergeable after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the motivation, implementation, tests, and reported behavior. It does not follow the required template because it omits the Resolves issue line and all required checklist item… Update the description to include Resolves: #35267 or the applicable issue link, complete every required checklist item, and list the AI tools used under the AI-assisted contributions section.
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 with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly describes the primary change: moving tuplets creation for selected items into EditTuplet.
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.
Full details: Description check

Explanation

The description explains the motivation, implementation, tests, and reported behavior. It does not follow the required template because it omits the Resolves issue line and all required checklist items, including CLA, coding rules, testing, and AI-policy confirmations.

Resolution

Update the description to include Resolves: #35267 or the applicable issue link, complete every required checklist item, and list the AI tools used under the AI-assisted contributions section.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 8 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.

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.

@davidstephengrant
davidstephengrant merged commit ac17966 into musescore:main Oct 29, 2026
15 checks passed
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