Optimization: load popups only when needed#33476
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis pull request refactors QML popup buttons across MuseScore's UI modules from manual popup state management to the PopupButton/popupComponent pattern. It introduces 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@muse`:
- Line 1: The PR pins the muse submodule to an unstable, unmerged commit SHA
(c7e8671d5fb751e4376a347f7a6b16b0af46c9ef) which is the head of muse_framework
PR 40; revert this pin and instead wait for muse_framework PR 40 to be merged,
then update the submodule reference (the commit SHA stored for the muse
submodule) to the stable commit on main produced by that merge; ensure the
change updates the submodule entry (where the commit is recorded) rather than
pointing at an open PR head so the repository remains reproducible.
In `@src/inspector/qml/MuseScore/Inspector/common/InspectorPopupButton.qml`:
- Around line 117-125: The checkForInsufficientSpace() helper in
InspectorPopupButton.qml assumes root.anchorItem always exists, which can
trigger a QML runtime error when the popup opens without an anchor. Add a guard
at the start of checkForInsufficientSpace() to return early if root.anchorItem
is null/undefined before calling mapToItem or reading anchorItem.height, and
keep the existing geometry logic unchanged for the valid anchored case.
In
`@src/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qml`:
- Line 33: The current readonly property mode uses bar.currentIndex before bar
exists (due to popupComponent lazy loading), so add a root-level property
modeIndex (numeric) initialized to 0 and replace references to mode with a
derived getter/setter or computed string based on modeIndex (e.g., modeIndex ===
0 ? "major" : "minor"); when the popup/popupComponent loads, bind/sync modeIndex
bidirectionally with the internal bar component by setting bar.currentIndex =
modeIndex on load and attaching a handler to update modeIndex when
bar.currentIndex changes (and vice versa) so the header and list view track mode
correctly; update analogous bindings at the other affected spots (the uses
originally at lines 44 and 62–63) to read/write modeIndex instead of directly
referencing bar.currentIndex.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 79a1fd14-a8d7-49c9-bb2f-ad3bd4d66aea
📒 Files selected for processing (15)
musesrc/inspector/qml/MuseScore/Inspector/CMakeLists.txtsrc/inspector/qml/MuseScore/Inspector/common/InspectorPopupButton.qmlsrc/inspector/qml/MuseScore/Inspector/common/PopupViewButton.qmlsrc/inspector/qml/MuseScore/Inspector/general/GeneralInspectorView.qmlsrc/inspector/qml/MuseScore/Inspector/measures/MeasuresInspectorView.qmlsrc/inspector/qml/MuseScore/Inspector/notation/NotationMultiElementView.qmlsrc/inspector/qml/MuseScore/Inspector/score/ScoreAppearanceInspectorView.qmlsrc/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qmlsrc/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qmlsrc/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
💤 Files with no reviewable changes (1)
- src/inspector/qml/MuseScore/Inspector/common/PopupViewButton.qml
23e35c0 to
1cce99d
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@muse`:
- Line 1: The repository's muse submodule is pinned to an unmerged PR commit
(muse_framework PR `#40`, SHA 98ee69c042d6e4bd09934b4047b6ee2ca040299e); update
the submodule reference in .gitmodules and the gitlink to point to a commit that
is merged into the muse_framework main branch (or remove the PR-SHA pin and
track main), then commit the updated submodule pointer and push; ensure the new
commit SHA you set is from muse_framework main (not the PR branch) and mention
PR `#40` in your commit message for traceability.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fe63d137-7cc6-45c5-9c36-11c55776cd5d
📒 Files selected for processing (15)
musesrc/inspector/qml/MuseScore/Inspector/CMakeLists.txtsrc/inspector/qml/MuseScore/Inspector/common/InspectorPopupButton.qmlsrc/inspector/qml/MuseScore/Inspector/common/PopupViewButton.qmlsrc/inspector/qml/MuseScore/Inspector/general/GeneralInspectorView.qmlsrc/inspector/qml/MuseScore/Inspector/measures/MeasuresInspectorView.qmlsrc/inspector/qml/MuseScore/Inspector/notation/NotationMultiElementView.qmlsrc/inspector/qml/MuseScore/Inspector/score/ScoreAppearanceInspectorView.qmlsrc/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qmlsrc/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qmlsrc/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/KeySignatureSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/MeasuresSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qmlsrc/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
💤 Files with no reviewable changes (1)
- src/inspector/qml/MuseScore/Inspector/common/PopupViewButton.qml
🚧 Files skipped from review as they are similar to previous changes (10)
- src/inspector/qml/MuseScore/Inspector/CMakeLists.txt
- src/inspector/qml/MuseScore/Inspector/measures/MeasuresInspectorView.qml
- src/notationscene/qml/MuseScore/NotationScene/NoteInputBar.qml
- src/inspector/qml/MuseScore/Inspector/general/GeneralInspectorView.qml
- src/playback/qml/MuseScore/Playback/internal/PlaybackToolBarActions.qml
- src/inspector/qml/MuseScore/Inspector/notation/NotationMultiElementView.qml
- src/project/qml/MuseScore/Project/internal/NewScore/TimeSignatureSettings.qml
- src/inspector/qml/MuseScore/Inspector/score/ScoreAppearanceInspectorView.qml
- src/palette/qml/MuseScore/Palette/internal/PalettesPanelHeader.qml
- src/project/qml/MuseScore/Project/internal/NewScore/TempoSettings.qml
1cce99d to
fb4e8bd
Compare
Depends on: musescore/muse_framework#40