Skip to content

Move Home > Scores > Cloud scores components into project module#33333

Merged
igorkorsukov merged 1 commit into
musescore:masterfrom
cbjeukendrup:home-scores-cloud-move-into-project
May 8, 2026
Merged

Move Home > Scores > Cloud scores components into project module#33333
igorkorsukov merged 1 commit into
musescore:masterfrom
cbjeukendrup:home-scores-cloud-move-into-project

Conversation

@cbjeukendrup
Copy link
Copy Markdown
Collaborator

@cbjeukendrup cbjeukendrup commented May 8, 2026

Near all other Home > Scores components

This fixes the master branch, which would not run because the framework was unexpectedly already updated with musescore/muse_framework#6, while that should only have happened as part of this commit (extracted from #33301).


This is part 1 of 2 in a stack made with GitButler:

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
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request introduces three new QML components for browsing cloud (online) scores in MuseScore. CloudScoresView acts as the main container, instantiating CloudScoresModel and selecting between grid, list, empty, not-signed-in, and error UI states. CloudScoresGridView and CloudScoresListView implement the respective browsing layouts, each with viewport-based pagination logic that schedules increases to desired-row-count when insufficient scores remain visible. Both views show a loading indicator during the Loading model state. The module CMakeLists.txt is updated to register the new components and add the muse_cloud_qml dependency. Redundant imports are removed from existing components to complete the integration.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description lacks required template sections: no GitHub issue reference, no CLA/checklist completion, and missing commit message verification details. Add issue reference, clarify checklist completion status, and confirm commits follow the required message format with issue references.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: moving cloud scores components into the project module to organize them with other scores components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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
`@src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresGridView.qml`:
- Around line 36-38: Component.onCompleted currently calls
prv.updateDesiredRowCount() without guarding for early/invalid geometry (e.g.,
cellHeight <= 0 or columns <= 0), causing unstable pagination; update the
Component.onCompleted handler in CloudScoresGridView.qml (and the other similar
blocks around the 54-56 and 67-87 regions) to check that relevant layout metrics
(columns and cellHeight) are positive and finite before calling
prv.updateDesiredRowCount(), and in the callers inside the
resize/geometry-change logic ensure the same guards are applied so
updateDesiredRowCount() only runs when the grid has valid geometry.

In
`@src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresListView.qml`:
- Around line 37-39: Guard calls to prv.updateDesiredRowCount() so the
pagination math runs only after the list geometry (rowHeight and height) is
valid: replace the direct calls from Component.onCompleted and the other spots
(around the blocks calling prv.updateDesiredRowCount at lines noted) with a
check that ListView.rowHeight and ListView.height (or an equivalent geometry
metric) are > 0, and if not, attach a one‑time handler (e.g. by listening to
rowHeightChanged or heightChanged on the ListView) to re-run
prv.updateDesiredRowCount() when those values become valid; ensure the handler
disconnects itself after invoking updateDesiredRowCount so the update is only
retried once.
🪄 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: 66759ffb-cf59-4c07-bbbd-fccf7770de51

📥 Commits

Reviewing files that changed from the base of the PR and between 5d037b3 and b66f260.

📒 Files selected for processing (8)
  • src/project/qml/MuseScore/Project/CMakeLists.txt
  • src/project/qml/MuseScore/Project/ScoresPage.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresGridView.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresListView.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresView.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/ScoresGridView.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/ScoresListView.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/ScoresView.qml
💤 Files with no reviewable changes (3)
  • src/project/qml/MuseScore/Project/internal/ScoresPage/ScoresListView.qml
  • src/project/qml/MuseScore/Project/ScoresPage.qml
  • src/project/qml/MuseScore/Project/internal/ScoresPage/ScoresGridView.qml

Comment on lines +36 to +38
Component.onCompleted: {
prv.updateDesiredRowCount()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add defensive guards for early grid geometry values.

Pagination currently assumes valid cellHeight/columns. Guarding these values avoids unstable desired-row updates during early layout.

Proposed patch
     Component.onCompleted: {
-        prv.updateDesiredRowCount()
+        Qt.callLater(prv.updateDesiredRowCount)
     }

     Connections {
         target: root.model

         function onStateChanged() {
             if (root.model.state === CloudScoresModel.Fine) {
                 // After the model has loaded more, check if even more is needed
                 prv.updateDesiredRowCount();
             }
         }
     }

+    Connections {
+        target: root.view
+        function onCellHeightChanged() {
+            if (root.view.cellHeight > 0 && root.view.columns > 0) {
+                prv.updateDesiredRowCount()
+            }
+        }
+        function onColumnsChanged() {
+            if (root.view.cellHeight > 0 && root.view.columns > 0) {
+                prv.updateDesiredRowCount()
+            }
+        }
+    }
+
     QtObject {
         id: prv
@@
         function updateDesiredRowCount() {
+            if (root.view.cellHeight <= 0 || root.view.columns <= 0) {
+                return
+            }
+
             if (updateDesiredRowCountScheduled) {
                 return
             }

Also applies to: 54-56, 67-87

🤖 Prompt for 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.

In
`@src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresGridView.qml`
around lines 36 - 38, Component.onCompleted currently calls
prv.updateDesiredRowCount() without guarding for early/invalid geometry (e.g.,
cellHeight <= 0 or columns <= 0), causing unstable pagination; update the
Component.onCompleted handler in CloudScoresGridView.qml (and the other similar
blocks around the 54-56 and 67-87 regions) to check that relevant layout metrics
(columns and cellHeight) are positive and finite before calling
prv.updateDesiredRowCount(), and in the callers inside the
resize/geometry-change logic ensure the same guards are applied so
updateDesiredRowCount() only runs when the grid has valid geometry.

Comment on lines +37 to +39
Component.onCompleted: {
prv.updateDesiredRowCount()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Guard pagination math until list geometry is valid.

updateDesiredRowCount() can be scheduled before rowHeight is ready, which makes the viewport math unstable. Add a geometry guard and re-trigger when row height becomes valid.

Proposed patch
     Component.onCompleted: {
-        prv.updateDesiredRowCount()
+        Qt.callLater(prv.updateDesiredRowCount)
     }

     Connections {
         target: root.model
         function onStateChanged() {
             if (root.model.state === CloudScoresModel.Fine) {
                 // After the model has loaded more, check if even more is needed
                 prv.updateDesiredRowCount();
             }
         }
     }

+    Connections {
+        target: root.view
+        function onRowHeightChanged() {
+            if (root.view.rowHeight > 0) {
+                prv.updateDesiredRowCount()
+            }
+        }
+    }
+
     QtObject {
         id: prv
@@
         function updateDesiredRowCount() {
+            if (root.view.rowHeight <= 0) {
+                return
+            }
+
             if (updateDesiredRowCountScheduled) {
                 return
             }

Also applies to: 54-56, 67-87

🤖 Prompt for 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.

In
`@src/project/qml/MuseScore/Project/internal/ScoresPage/CloudScoresListView.qml`
around lines 37 - 39, Guard calls to prv.updateDesiredRowCount() so the
pagination math runs only after the list geometry (rowHeight and height) is
valid: replace the direct calls from Component.onCompleted and the other spots
(around the blocks calling prv.updateDesiredRowCount at lines noted) with a
check that ListView.rowHeight and ListView.height (or an equivalent geometry
metric) are > 0, and if not, attach a one‑time handler (e.g. by listening to
rowHeightChanged or heightChanged on the ListView) to re-run
prv.updateDesiredRowCount() when those values become valid; ensure the handler
disconnects itself after invoking updateDesiredRowCount so the update is only
retried once.

@igorkorsukov
Copy link
Copy Markdown
Member

@cbjeukendrup
Sorry, we rolled back your PR to MF
musescore/muse_framework#11

We are learning and gaining experience on how to work in a new way...
Once we have enough experience, we will describe the process and fine-tune it.

In this case, the PR in the MF should probably have been a draft.
First, merge this PR.
Then, make it ready for merge PR to the MF.

@cbjeukendrup
Copy link
Copy Markdown
Collaborator Author

If we do that, there is no association between the framework change and this PR. I think it's better to first merge the framework PR, then immediately update the submodule in this PR and merge it.

@cbjeukendrup
Copy link
Copy Markdown
Collaborator Author

Anyway, to keep this moving forward... it looks like it's okay to merge this PR first, and merge the framework change later, even if that is semantically questionable. So @igorkorsukov would you mind approving and merging this PR?

@igorkorsukov igorkorsukov merged commit b1b3811 into musescore:master May 8, 2026
15 checks passed
@cbjeukendrup cbjeukendrup deleted the home-scores-cloud-move-into-project branch May 8, 2026 15:02
@cbjeukendrup
Copy link
Copy Markdown
Collaborator Author

Thanks :)
Now I created musescore/muse_framework#12

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