Skip to content

Add page locks to palette#34243

Open
miiizen wants to merge 3 commits into
musescore:mainfrom
miiizen:pageLockPalette
Open

Add page locks to palette#34243
miiizen wants to merge 3 commits into
musescore:mainfrom
miiizen:pageLockPalette

Conversation

@miiizen

@miiizen miiizen commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Resolves: #33875

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The update adds PAGE_LOCK action support across engraving, notation interaction, XML action mapping, UI actions, and layout palettes. Page-lock undo helpers now push commands directly onto transactions. Drag-and-drop APIs and preview state change from single rectangles to vectors, including page-spanning previews. Palette creation and compatibility migration add page-lock and no-break entries. The muse submodule revision is also updated.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only links the issue and omits the required template sections, checklist items, and change details. Fill out the full template with a short change summary, checklist items, testing notes, and any relevant caveats.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding page locks to the palette.
Linked Issues check ✅ Passed The changes add page locks to the Layout palette and move 'Keep bars on the same system' into the main palette as requested.
Out of Scope Changes check ✅ Passed All shown code changes support page-lock palette handling, layout palette placement, or required API updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/muse_framework.git.


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.

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (2)
src/notation/internal/notationinteraction.cpp (2)

2521-2525: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid variable shadowing.

The tx variable is already declared in the function scope (line 2426). You can safely reuse it to avoid shadowing and potential -Wshadow compiler warnings.

♻️ Proposed fix
         case ActionIconType::PAGE_LOCK: {
-            engraving::Transaction& tx = score->transactionManager()->currentOrDummyTransaction();
             EditPageLocks::togglePageLock(tx, score, score->selection().pagesContainingSelection());
             return;
         }
🤖 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/notation/internal/notationinteraction.cpp` around lines 2521 - 2525, In
the PAGE_LOCK branch of the notation interaction handler, remove the inner tx
declaration and reuse the existing function-scope tx variable when calling
EditPageLocks::togglePageLock. Preserve the current transaction selection and
page-lock behavior.

3416-3419: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove redundant empty check before clear.

Checking empty() before clear() is unnecessary because std::vector::clear() handles empty vectors natively and efficiently.

♻️ Proposed fix
-    if (!edd.dropRects.empty()) {
-        edd.dropRects.clear();
-    }
+    edd.dropRects.clear();
🤖 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/notation/internal/notationinteraction.cpp` around lines 3416 - 3419, In
the drop-rectangle cleanup block, remove the redundant empty check and invoke
edd.dropRects.clear() directly. Preserve the existing cleanup behavior and
surrounding control flow.
🤖 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.

Nitpick comments:
In `@src/notation/internal/notationinteraction.cpp`:
- Around line 2521-2525: In the PAGE_LOCK branch of the notation interaction
handler, remove the inner tx declaration and reuse the existing function-scope
tx variable when calling EditPageLocks::togglePageLock. Preserve the current
transaction selection and page-lock behavior.
- Around line 3416-3419: In the drop-rectangle cleanup block, remove the
redundant empty check and invoke edd.dropRects.clear() directly. Preserve the
existing cleanup behavior and surrounding control flow.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 91241522-f57e-406e-8808-07b4ecd924bc

📥 Commits

Reviewing files that changed from the base of the PR and between 4d3e04e and 1cb7271.

📒 Files selected for processing (21)
  • muse
  • src/engraving/dom/actionicon.h
  • src/engraving/dom/measure.cpp
  • src/engraving/editing/edit.cpp
  • src/engraving/editing/editpagelocks.cpp
  • src/engraving/editing/editpagelocks.h
  • src/engraving/editing/editsystemlocks.cpp
  • src/engraving/editing/mscoreview.h
  • src/engraving/rw/read500/tread.cpp
  • src/notation/inotationinteraction.h
  • src/notation/internal/notationinteraction.cpp
  • src/notation/internal/notationinteraction.h
  • src/notation/internal/scorecallbacks.cpp
  • src/notation/internal/scorecallbacks.h
  • src/notation/tests/mocks/notationinteractionmock.h
  • src/notationscene/internal/notationuiactions.cpp
  • src/notationscene/widgets/exampleview.cpp
  • src/notationscene/widgets/exampleview.h
  • src/palette/internal/palettecompat.cpp
  • src/palette/internal/palettecompat.h
  • src/palette/internal/palettecreator.cpp

@Jojo-Schmitz

Jojo-Schmitz commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Can we have page locks for 4.7 too, please?

Seems this PR needs a rebase

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.

Add page locks to Layout palette

3 participants