Commit 1d3af54
committed
fix(comments): order replyLst before txBody per [MS-PPTX] CT_Comment — replies now render (issue #25)
Follow-up to ca4da3f. After the four parent-binding fixes, PowerPoint
rendered parent comment threads but SILENTLY DROPPED every reply
(`interceptor macos find "Merging"` → 0; only empty Reply boxes). The
advisor (Rule 2) correctly flagged reply-rendering as a logically
independent concern none of the four parent fixes touched.
Root cause is authoritative, not inference: the [MS-PPTX] CT_Comment
schema (learn.microsoft.com/openspecs MS-PPTX, 2018/8/main) defines
<xsd:complexType name="CT_Comment"><xsd:sequence>
<xsd:group ref="EG_CommentAnchor"/> <!-- pc:sldMkLst -->
<xsd:element name="pos" minOccurs="0"/>
<xsd:element name="replyLst" type="CT_CommentReplyList" minOccurs="0"/>
<xsd:group ref="EG_CommentProperties"/> <!-- txBody, extLst -->
</xsd:sequence></xsd:complexType>
replyLst MUST precede txBody. Our CT_ThreadedComment ZeroOrOne
successors emitted txBody first, replyLst after — out of sequence, so
PowerPoint validated the parent and discarded the misplaced replyLst.
The reply element itself (CT_CommentReply = EG_CommentProperties only)
was already correct; this was purely a child-ordering defect.
Fix: reorder the successor tuples in src/pptx/oxml/comments.py so the
emitted order is pc:sldMkLst, [pos], p188:replyLst, p188:txBody,
[p188:extLst] — matching the schema sequence exactly. No API change.
Two new regression assertions lock it
(it_places_replyLst_before_txBody_per_ms_pptx_sequence,
it_keeps_reply_txBody_with_bodyPr_after_reorder); red->green proven by
stashing oxml/comments.py (the order test fails pre-fix).
Verification: pytest 3761 passed; ruff check All checks passed; ruff
format clean; behave 1062 scenarios / 3215 steps 0 failed. Regenerated
UAT deck: replyLst-before-txBody True, reply texts present. Opened in
real PowerPoint via Interceptor — AX tree now exposes the reply node
"Comment from Alex Reviewer. Merging now." plus a "View 1 more reply"
control (PowerPoint parsed the full reply list); pre-fix that count was
zero. uat/FIXED_replies_rendering.png.
Issue #25 now fully resolves: parent comments AND replies render in
PowerPoint's Comments pane. UAT script runs clean — pending maintainer
visual signoff in PowerPoint/Keynote. No push/PR per repo §6a. Refs #25.1 parent ca4da3f commit 1d3af54
2 files changed
Lines changed: 58 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
339 | 350 | | |
340 | | - | |
| 351 | + | |
341 | 352 | | |
| 353 | + | |
342 | 354 | | |
343 | 355 | | |
344 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
758 | 758 | | |
759 | 759 | | |
760 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
761 | 804 | | |
762 | 805 | | |
763 | 806 | | |
0 commit comments