Skip to content

Do not overwrite an open dialog when a primary page opens - #334

Open
manolo wants to merge 1 commit into
musescore:mainfrom
manolo:35130-primary-page-stack
Open

manolo wants to merge 1 commit into
musescore:mainfrom
manolo:35130-primary-page-stack

Conversation

@manolo

@manolo manolo commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • onOpen replaced the bottom item of the stack on a primary page open, assuming it always holds the current primary page
  • raiseWindowInStack reorders the stack by window activation, so an open dialog can end up at the bottom and be overwritten
  • Closing that dialog then fails to find it in the stack

Context

Reproduced on 4.7.2 and on current main: open a plugin window, switch to Home, close the plugin window. A debug build aborts on the obj.objectId.isValid() assert in onClose. In a release build the assert is compiled out and the following obj.resolve() runs on a default constructed ObjectInfo.

The same change also covers a stack that is not empty but has no primary page yet, which happens when the restore session dialog opens before the home page.

Closes musescore/MuseScore#35128

The stack is reordered by window activation, so its bottom item is not
always the current primary page.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: musescore/muse_framework/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 13c7b82a-3ec2-4419-a8a9-1d80c873934d
📥 Commits

Reviewing files that changed from the base of the PR and between 404fb5c and 4b6eae6.

📒 Files selected for processing (1)
  • framework/interactive/internal/interactive.cpp

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


📝 Walkthrough

Walkthrough

When a primary page opens, Interactive::onOpen searches the stack for an existing primary page. It replaces that entry when found. Otherwise, it appends the new page.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 4b6ea

The change replaces the matching primary page or appends one when absent, preserving open dialogs. No concrete new failure path is established, so no actionable merge risk remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the stack-handling bug, gives reproduction context, and links the issue. It omits the repository’s required checklist, which the template says must be completed accurately. Add the template checklist and mark each item accurately. Complete the AI-assistance item and list the tools used if applicable. The optional build-configuration section can remain omitted if the defaults apply.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly describes the main change: prevent a primary page from overwriting an open dialog.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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.

Crash on closing a plugin window after switching to Home

1 participant