Skip to content

SF-3680 Ensure that a verse that is not in a para has a blank segment#3665

Open
pmachapman wants to merge 1 commit intomasterfrom
fix/SF-3680
Open

SF-3680 Ensure that a verse that is not in a para has a blank segment#3665
pmachapman wants to merge 1 commit intomasterfrom
fix/SF-3680

Conversation

@pmachapman
Copy link
Collaborator

@pmachapman pmachapman commented Feb 2, 2026

This PR fixes an issue where a { blank: true } operation is not created for a verse that is not in a para, where that verse is followed by a blank para, resulting in operations subsequent ops being incorrectly offset by 1 by the TextViewModel, which requires a blank operation to be present for the first verse.

Although this bug only manifests in the frontend editor (not in conversion from Delta to USX), I have added tests to ensure that behavior is not broken in future, and fixed this bug in the backend as that was the least complicated and most compatible fix (note that I did not have to change the logic in ToUsx(), only ToChapterDeltas()).

I've also run this PR with the roundtrip tool, and can confirm that additional blank segments were only added where they should have been (a very small number of projects I had access to locally were affected by this).


This change is Reviewable

@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.95%. Comparing base (eda080f) to head (ee30746).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3665   +/-   ##
=======================================
  Coverage   81.95%   81.95%           
=======================================
  Files         618      618           
  Lines       38495    38496    +1     
  Branches     6300     6300           
=======================================
+ Hits        31549    31550    +1     
- Misses       5972     5985   +13     
+ Partials      974      961   -13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pmachapman pmachapman marked this pull request as ready for review February 3, 2026 01:04
@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

will require testing PR should not be merged until testers confirm testing is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant