fix(pptx): order text inside a moved group by its position on the slide

CH
3d ago
+42-2

Summary

_order_shapes() promises top-to-bottom, left-to-right order on the slide, but sorts by .top and .left, which inside a group are child coordinates (a:chOff/a:chExt). On 293d235 the new test's grouped box at 5.25 in reads before a box at 1 in. #4619 mapped these coordinates onto the slide for the off-slide check and left reading order for a separate PR. The sort key now uses the same _shape_slide_box(). Ungrouped items keep their key.

Validation

$ python -m pytest -q -p no:cacheprovider test_unstructured/partition/test_pptx.py   # base 293d235, Python 3.12
this branch:                 119 passed
pptx.py reverted, test kept: 1 failed, 118 passed (test_partition_pptx_orders_group_children_by_their_position_on_the_slide)
$ ruff check && ruff format --check    # ruff 0.15.10, the uv.lock pin, both changed files
All checks passed!
2 files already formatted
# not run: test_auto.py, whose collection needs extras this venv lacks

Release note (optional)

partition_pptx now orders text inside a moved group by its position on the slide.

Checklist

  • The PR title is a user-facing release-note entry with a conventional commit prefix.
  • Apply a category label (enhancement, bug, or an appropriate existing label), or ask a maintainer to apply it.
    • A fork can't set labels; this is a bug.
  • For breaking changes, use ! in the title and explain impact and migration above.
    • Not breaking: only the order inside a moved or scaled group changes.

No issue exists. @cragwolfe, you merged #4619. A rotated item in a group now sorts by the top-left of its rotated bounds, as the off-slide check measures it. Should it use its unrotated box instead?