Skip to content

Fix default instrument not updating when changing via editstaff#33050

Open
CubikingChill wants to merge 1 commit intomusescore:masterfrom
CubikingChill:update-default-instrument
Open

Fix default instrument not updating when changing via editstaff#33050
CubikingChill wants to merge 1 commit intomusescore:masterfrom
CubikingChill:update-default-instrument

Conversation

@CubikingChill
Copy link
Copy Markdown
Contributor

Resolves: #32981

  • I signed the CLA
  • The title of the PR describes the problem it addresses
  • Each commit's message describes its purpose and effects, and references the issue it resolves
  • If changes are extensive, there is a sequence of easily reviewable commits
  • The code in the PR follows the coding rules
  • There are no unnecessary changes
  • The code compiles and runs on my machine, preferably after each commit individually
  • I created a unit test or vtest to verify the changes I made (if applicable)

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: dbac6b7f-8616-43ed-89c4-12262a0fd59a

📥 Commits

Reviewing files that changed from the base of the PR and between 3dc7de4 and f9a1d06.

📒 Files selected for processing (5)
  • src/notation/internal/masternotationparts.cpp
  • src/notation/internal/notationparts.cpp
  • src/notation/notationtypes.h
  • src/notationscene/widgets/editstaff.cpp
  • src/notationscene/widgets/editstaff.h
💤 Files with no reviewable changes (1)
  • src/notationscene/widgets/editstaff.h

📝 Walkthrough

Walkthrough

The helper isMainInstrumentForPart was changed to accept only const InstrumentKey& and now checks the tick value only. Call sites in MasterNotationParts::replaceInstrument and NotationParts::replaceInstrument were updated to call the new signature. EditStaff removed the m_orgInstrument member, adjusted how it obtains the previous instrument, added detection of instrument changes, and updates m_instrumentKey.instrumentId when the instrument changes.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix default instrument not updating when changing via editstaff' clearly and concisely describes the main bug being fixed, matching the primary objective.
Description check ✅ Passed The PR description includes the issue reference (#32981), indicates that commits describe their purpose, and author attests to following coding rules and testing.
Linked Issues check ✅ Passed The code changes directly address issue #32981 by modifying instrument detection logic and ensuring the instrument ID is updated in editstaff when the instrument changes.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the instrument update bug in editstaff and related notation parts, with no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@CubikingChill
Copy link
Copy Markdown
Contributor Author

CubikingChill commented Apr 18, 2026

Comprehensive Testing:

2026-04-18.16-18-20.-.Trim.mp4
2026-04-18.16-18-20.mp4

@mathesoncalum mathesoncalum self-requested a review April 20, 2026 07:35
@CubikingChill CubikingChill force-pushed the update-default-instrument branch from 3dc7de4 to f9a1d06 Compare April 20, 2026 13:09
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.

Update instrument when changing default instrument

3 participants