Skip to content

Fix Navigator scaling when directly opening Score tab - #33511

Merged
RomanPudashkin merged 1 commit into
musescore:mainfrom
cbjeukendrup:navigator-scale-upon-opening-score-tab
May 21, 2026
Merged

Fix Navigator scaling when directly opening Score tab#33511
RomanPudashkin merged 1 commit into
musescore:mainfrom
cbjeukendrup:navigator-scale-upon-opening-score-tab

Conversation

@cbjeukendrup

Copy link
Copy Markdown
Collaborator

(rather than first opening the Home tab and then switching to the Score tab)

In this situation, the rescale calls in load/initVisible/onViewSizeChanged all fail to do the job, because the score is not loaded yet. Add another one upon loading notation.

En passant, let’s rename rescale to rescaleIfVisible, and remove some unnecessary visibility checks outside that method.

Resolves: #33459

(rather than first opening the Home tab and then switching to the Score tab)

In this situation, the `rescale` calls in `load`/`initVisible`/`onViewSizeChanged` all fail to do the job, because the score is not loaded yet. Add another one upon loading notation.

En passant, let’s rename `rescale` to `rescaleIfVisible`, and remove some unnecessary visibility checks outside that method.

Resolves: musescore#33459

@claude claude Bot left a comment

Copy link
Copy Markdown

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

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5a078484-3e73-4290-bcfb-f00e10ba5f6d

📥 Commits

Reviewing files that changed from the base of the PR and between d48fdd2 and 8af0256.

📒 Files selected for processing (2)
  • src/notationscene/qml/MuseScore/NotationScene/notationnavigator.cpp
  • src/notationscene/qml/MuseScore/NotationScene/notationnavigator.h

📝 Walkthrough

Walkthrough

NotationNavigator refactors its scaling behavior by introducing rescaleIfVisible(), a new private method that centralizes visibility, size, and pages validation before computing and applying scaling factors. Previously, scaling was triggered from multiple call sites with inconsistent guard patterns. The refactoring adds a onLoadNotation(INotationPtr) override, consolidates the scaling entrypoint, and integrates rescaleIfVisible() into load(), notification hooks, and view change callbacks to ensure consistent, guarded scaling across all entry points.

🚥 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 clearly and concisely describes the main fix: addressing Navigator scaling when directly opening the Score tab.
Description check ✅ Passed The description provides context, explains the root cause, describes the solution, and includes the issue reference, but omits most template checklist items.
Linked Issues check ✅ Passed Code changes directly address the root cause of issue #33459 by adding rescale call upon notation loading and centralizing scaling logic.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing Navigator scaling: adding rescaleIfVisible helper, hooking onLoadNotation, and renaming/removing rescale.

✏️ 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.

@zacjansheski

Copy link
Copy Markdown
Contributor

Tested on MacOS Tahoe 26.2, Windows 11, Ubuntu 22.04.3. Approved
#33459 FIXED

@RomanPudashkin
RomanPudashkin merged commit dd2d974 into musescore:main May 21, 2026
15 checks passed
@RomanPudashkin
RomanPudashkin deleted the navigator-scale-upon-opening-score-tab branch May 21, 2026 17:23
@Jojo-Schmitz

Copy link
Copy Markdown
Contributor

I guess we can have this for 4.7.3 too?

@Jojo-Schmitz Jojo-Schmitz mentioned this pull request May 22, 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.

Navigator empty on starting MuseScore with score open

5 participants