Skip to content

[Epic] Threaded Comments & Review #25

@MHoroszowski

Description

@MHoroszowski

Problem

Slide comments are completely absent from python-pptx. The content-type registry already declares commentAuthors and comments parts but there are no part classes, no Python API, and no read path. Modern PowerPoint uses threaded comments (replies, @mentions) under the p188: schema (Office 2017+), distinct from the legacy single-comment <p:cm> schema. Programmatic deck-review automation (generating a deck, seeding it with reviewer questions, harvesting reviewer responses) is impossible today. Demand is small but pure (scanny/python-pptx#756, scanny/python-pptx#487, scanny/python-pptx#538).

Sub-features

  • CommentAuthor part class wrapping commentAuthors.xml
  • Comment and CommentReply part classes for legacy <p:cm> and modern <p188:cm>
  • Slide.comments collection with .add(text, author, anchor=None), .remove(comment), iteration
  • Comment.replies for threaded reply chains (modern schema)
  • Comment.author, .text, .created_at, .anchor_position (slide-relative xy if anchored to a shape, else null)
  • Comment.resolve() for the resolution-state flag
  • Per-shape comments: Shape.comments filter
  • Format coexistence: writing modern threaded comments preserves legacy <p:cm> siblings on round-trip

Prior art

  • Open PRs: none in upstream queue.
  • User issues this would close: #487, #538, #756.
  • OOXML: PresentationML §19.5.6 <p:cm> legacy comments in commentsN.xml. Modern threaded: namespace http://schemas.microsoft.com/office/powerpoint/2018/8/main with <p188:cm> in commentsExt.xml. Authors: commentAuthors.xml with <p:cmAuthor> IDs referenced from comments.
  • Code paths: new src/pptx/parts/comments.py, new src/pptx/oxml/comments.py, register content-types in src/pptx/__init__.py and src/pptx/opc/constants.py.

Acceptance criteria

  • A deck authored with slide.comments.add("Looks great!", author="Reviewer Name") shows the comment in PowerPoint's Review pane.
  • Threaded reply (comment.replies.add(...)) round-trips through PPT Mac/Win.
  • 12+ unit tests + 4 behave scenarios.

Effort: M

Two-part work (legacy + modern schema). Authors part is small; comments part has the schema-version branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:commentsFeature area: commentsepicMulti-feature roadmap epicprior-art:noneNo known prior art — greenfieldpriority:P1Important but not urgent

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions