Bug
Comments and ins/del runs are anchored to the start/end of the containing paragraph, not to the actual span offsets. The offsetInParagraph value is computed and immediately discarded:
Location: src/LambdaRag.Markup/OpenXmlMarkupService.cs line ~194
_ = offsetInParagraph; // reserved for future precise-run-split logic
CommentRangeStart is inserted before the first run; CommentRangeEnd is appended at paragraph end; InsertedRun/DeletedRun are appended at paragraph end.
Impact: Word's review pane shows the right paragraph but no highlight on the actual phrase being commented on. Reviewers cannot tell which words a comment refers to in long paragraphs. Inserts/deletes appear in the wrong position visually.
Expected: Split the run that contains offsetInParagraph (and the run that contains offsetInParagraph + span.Length) so that:
CommentRangeStart is placed immediately before the run starting at the span's char-start.
CommentRangeEnd is placed immediately after the run ending at the span's char-end.
InsertedRun is placed at the span's start position (for Insert/Replace).
DeletedRun replaces the spanned runs in place (for Delete/Replace).
Acceptance criteria
Out of scope
- Cross-paragraph spans (tracked separately).
Bug
Comments and ins/del runs are anchored to the start/end of the containing paragraph, not to the actual span offsets. The
offsetInParagraphvalue is computed and immediately discarded:Location:
src/LambdaRag.Markup/OpenXmlMarkupService.csline ~194CommentRangeStartis inserted before the first run;CommentRangeEndis appended at paragraph end;InsertedRun/DeletedRunare appended at paragraph end.Impact: Word's review pane shows the right paragraph but no highlight on the actual phrase being commented on. Reviewers cannot tell which words a comment refers to in long paragraphs. Inserts/deletes appear in the wrong position visually.
Expected: Split the run that contains
offsetInParagraph(and the run that containsoffsetInParagraph + span.Length) so that:CommentRangeStartis placed immediately before the run starting at the span's char-start.CommentRangeEndis placed immediately after the run ending at the span's char-end.InsertedRunis placed at the span's start position (forInsert/Replace).DeletedRunreplaces the spanned runs in place (forDelete/Replace).Acceptance criteria
Out of scope