Skip to content

Link partial lyric dash verse with ending lyric#33350

Open
miiizen wants to merge 2 commits into
musescore:mainfrom
miiizen:32979-pll-link-verse
Open

Link partial lyric dash verse with ending lyric#33350
miiizen wants to merge 2 commits into
musescore:mainfrom
miiizen:32979-pll-link-verse

Conversation

@miiizen
Copy link
Copy Markdown
Contributor

@miiizen miiizen commented May 11, 2026

Resolves: #32979

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

coderabbitai Bot commented May 11, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This change implements coordinated undo behavior for verse property changes in lyrics spanning partial lines. When a verse property is undone on a PartialLyricsLine, the change propagates to associated ending lyrics elements. Similarly, when verse is undone on a Lyrics element, it updates preceding partial-line dashes if their verse differs. The implementation adds override declarations to the Lyrics and PartialLyricsLine classes, implements custom undo logic in both, and includes a new test fixture and test case to verify verse synchronization across undo operations.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is minimal, containing only an issue reference without substantive detail about changes, testing, or methodology from the provided template. Expand the description to explain the implementation approach, testing strategy, and notable changes; fill in relevant template checkboxes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: linking the verse property between partial lyric dashes and their ending lyrics.
Linked Issues check ✅ Passed The code changes properly implement the linked issue #32979 requirement by linking verse properties between partial lyric dashes and ending lyrics.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the verse-linking functionality described in issue #32979; no extraneous modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@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: 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/tests/lyrics_tests.cpp`:
- Around line 40-67: Replace the soft checks with hard assertions for any
pointer that is dereferenced later: use ASSERT_TRUE/ASSERT_NE instead of
EXPECT_TRUE for the result of ScoreRW::readScore (score), Measure* m2 (from
first()->nextMeasure()), ChordRest* endCR (from lastChordRest), the found
Lyrics* l1 and l2 (from iterating endCR->lyrics()), and the PartialLyricsLine*
pll (from findPrevPartialLyricsLineDash(l1)); this ensures the test aborts on
null and prevents null dereference when calling methods like first(),
nextMeasure(), lastChordRest(), lyrics(), and findPrevPartialLyricsLineDash().
🪄 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: ae47a3c0-49ef-4c5f-8f42-7bdd3b31c6be

📥 Commits

Reviewing files that changed from the base of the PR and between 3c30b96 and 546a1ee.

📒 Files selected for processing (6)
  • src/engraving/dom/lyrics.cpp
  • src/engraving/dom/lyrics.h
  • src/engraving/dom/lyricsline.cpp
  • src/engraving/tests/CMakeLists.txt
  • src/engraving/tests/lyrics_data/partialLyricsLineVerse.mscx
  • src/engraving/tests/lyrics_tests.cpp

Comment on lines +40 to +67
MasterScore* score = ScoreRW::readScore(LYRICS_DATA_DIR + u"partialLyricsLineVerse.mscx");

Measure* m2 = score->first()->nextMeasure();

EXPECT_TRUE(m2);

ChordRest* endCR = m2->lastChordRest(0);

EXPECT_TRUE(endCR);

Lyrics* l1 = nullptr;
Lyrics* l2 = nullptr;

for (Lyrics* l : endCR->lyrics()) {
if (l->verse() == 0) {
l1 = l;
}
if (l->verse() == 1) {
l2 = l;
}
}

EXPECT_TRUE(l1);
EXPECT_TRUE(l2);

PartialLyricsLine* pll = findPrevPartialLyricsLineDash(l1);

EXPECT_TRUE(pll);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use ASSERT_* for required pointers before dereferencing.

These are hard preconditions for the rest of the test. With EXPECT_TRUE, the test can continue and crash on null dereference.

💡 Suggested fix
 MasterScore* score = ScoreRW::readScore(LYRICS_DATA_DIR + u"partialLyricsLineVerse.mscx");
+ASSERT_TRUE(score);

 Measure* m2 = score->first()->nextMeasure();
-
-EXPECT_TRUE(m2);
+ASSERT_TRUE(m2);

 ChordRest* endCR = m2->lastChordRest(0);
-
-EXPECT_TRUE(endCR);
+ASSERT_TRUE(endCR);
@@
-EXPECT_TRUE(l1);
-EXPECT_TRUE(l2);
+ASSERT_TRUE(l1);
+ASSERT_TRUE(l2);
@@
-EXPECT_TRUE(pll);
+ASSERT_TRUE(pll);
🤖 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/engraving/tests/lyrics_tests.cpp` around lines 40 - 67, Replace the soft
checks with hard assertions for any pointer that is dereferenced later: use
ASSERT_TRUE/ASSERT_NE instead of EXPECT_TRUE for the result of
ScoreRW::readScore (score), Measure* m2 (from first()->nextMeasure()),
ChordRest* endCR (from lastChordRest), the found Lyrics* l1 and l2 (from
iterating endCR->lyrics()), and the PartialLyricsLine* pll (from
findPrevPartialLyricsLineDash(l1)); this ensures the test aborts on null and
prevents null dereference when calling methods like first(), nextMeasure(),
lastChordRest(), lyrics(), and findPrevPartialLyricsLineDash().

@igorkorsukov igorkorsukov changed the base branch from master to main May 12, 2026 07:50
@davidstephengrant
Copy link
Copy Markdown
Contributor

@miiizen Tested and approved on Ubuntu 24.04.4 LTS.

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.

Link verse for partial lyric hyphens and the syllable they are attached to

2 participants