Skip to content

skip zero-length slurs in layout#34000

Open
alexpavlov96 wants to merge 1 commit into
musescore:mainfrom
alexpavlov96:slur_assert_fix
Open

skip zero-length slurs in layout#34000
alexpavlov96 wants to merge 1 commit into
musescore:mainfrom
alexpavlov96:slur_assert_fix

Conversation

@alexpavlov96

Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 3813515b-5c48-4bec-b943-714c281cdf88

📥 Commits

Reviewing files that changed from the base of the PR and between 7d56d71 and 3518160.

📒 Files selected for processing (1)
  • src/engraving/rendering/score/slurtielayout.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/engraving/rendering/score/slurtielayout.cpp

📝 Walkthrough

Walkthrough

In SlurTieLayout::layoutSystem, a zero-length check is added after slurSegment creation. When item->ticks().isZero() is true and both chordrests are non-grace, and the slur is neither incoming nor outgoing, a debug message is logged and slurSegment is returned immediately, skipping the remaining layout and positioning logic.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No PR description was provided, so the required issue reference, summary, and checklist items are missing. Add the template sections: issue reference, short motivation/summary, and complete the checklist items relevant to this change.
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 matches the main change: skipping zero-length slurs during layout.
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.
✨ 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.

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 `@src/engraving/rendering/score/slurtielayout.cpp`:
- Around line 85-89: Move the zero-tick check in SlurTieLayout::layout before
acquiring the segment from TLayout::getNextLayoutSystemSegment, since the
current early return can leave an existing slurSegment with stale type/geometry
from setSpannerSegmentType and layoutSegment. If the guard must remain after
acquisition, explicitly clear, reset, or remove the slurSegment before returning
so zero-length slurs are fully hidden on relayout.
🪄 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: 97451f97-4ba0-4f9e-889b-1f4f120603d3

📥 Commits

Reviewing files that changed from the base of the PR and between 1fddddb and cf0fe29.

📒 Files selected for processing (1)
  • src/engraving/rendering/score/slurtielayout.cpp

Comment thread src/engraving/rendering/score/slurtielayout.cpp Outdated
item->track(), item->tick().ticks());
return slurSegment;
}
if (item->endCR() == 0) { // sanity check

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.

We should also return here: item->setTick2(item->tick()); will just create a zero length slur

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added

@alexpavlov96 alexpavlov96 force-pushed the slur_assert_fix branch 2 times, most recently from 2bc79d3 to 7d56d71 Compare July 7, 2026 22:43
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