Repository navigation
Round 3: outline groups once, empty placeholders, table styles and flags - #10
Merged
Merged
Conversation
slide.shapes lists a group and then its members; the outline walked the groups as well, so every grouped shape came twice (to_outline, ppt_read_slides outline, outline_blocks, find_text, replace_text). The outline now walks the slide's own shapes and their groups once, and marks a group's blocks between <!-- 256.5 group "Name" --> and <!-- /256.5 -->, docx-agent's closing form; insert_outline reads the marks as nothing. A test holds the other readers of slide.shapes (collisions, design facts, find_text) to the same facts grouped or not. Production feedback round 3, D3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
slide.empty_placeholders() names the placeholders PowerPoint shows as "Click to add text" while editing and draws nothing for in a show or an export: a p:sp placeholder with no text, only whitespace or only empty paragraphs, and no field. One that took a picture, table, chart or SmartArt holds it; date, footer, slide number and header are PowerPoint's to fill and are left out; titles and subtitles count. delete_empty_placeholders() deletes them in one undo step and keeps an empty title unless titles=True. The tools report empty_placeholders (shape, type, idx) in every changing call's checks and in check (with fit, the default); save_document lists those left under unresolved; ppt_manage_slides gains delete_empty_placeholders. Also Document.table_styles (the next commit's), and find_shapes' docstring says what it returns. Production feedback round 3, A3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
deck.table_styles lists the deck's own styles (tableStyles.xml) and PowerPoint's 74 built-in ones by GUID and name (pptx2svg's measured catalogue), the default marked. table.style reads one and sets it by name or id; table.flags and table.set_flags turn the Header Row, Total Row, First and Last Column and Banded Rows and Columns on and off, as PowerPoint writes them. add_table(style=) takes a name too and refuses an unknown id. Tools: ppt_add_table's style, ppt_edit_table's set_style and set_flags, a table's style and flags in its results, describe's theme.table_styles. Every definition 10,269 -> 10,464 estimated tokens (guard 10,500), the core unchanged at 3,398 (about 5,029 counted). Golden p14: a chart slide on a content layout with its empty body deleted, and a table in the template's own style without banding. SUPPORTED, GUIDANCE, USAGE and the changelog. Production feedback round 3, A4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
Measured in PowerPoint 16 (probe deck exported and viewed in Normal view): an empty placeholder (no text, or one empty paragraph) shows its prompt while editing and none in the export; a whitespace-only one shows no prompt but a bullet, exported too; several empty paragraphs show nothing; and a placeholder's own fill is drawn in the export whether it holds text or not. So delete_empty_placeholders now keeps a placeholder that draws a fill or an outline (its own, or its layout placeholder's) and the tool says which it kept; the docstrings, the checks' note, GUIDANCE, USAGE and the changelog say what PowerPoint shows. p14's table-slide title wrapped to two lines in PowerPoint's export; it is shorter now, and its check asks for one line as drawn (text_fit), as p9's does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Production feedback round 3, items D3, A3 and A4.
D3, the outline lists every grouped shape twice.
slide.shapeslists a group and then its members; the outline walked the groups as well. It now walks the slide's own shapes and their groups once and marks each group around its blocks,<!-- 256.5 group "Agenda item 1" -->...<!-- /256.5 -->(docx-agent's closing form), nested as the groups are.ppt_read_slidesoutline,outline_blocks,find_textandreplace_textfollow. The other readers ofslide.shapes(fit, collisions, layout and design facts, comments) already deduplicated; a new test holds them to the same facts grouped or not. Reprod3_group_outline.py: BUG PRESENT -> fixed.A3, empty placeholders.
slide.empty_placeholders()andslide.delete_empty_placeholders(titles=False)(one undo step). Empty: ap:spplaceholder with no text body, no paragraphs, or only whitespace/empty paragraphs, and no field. A placeholder that took a picture, table, chart or SmartArt (ap:pic/p:graphicFrame) is not empty. Date, footer, slide number and header are left out, and so is a hidden shape. Titles and subtitles count (they show "Click to add title/subtitle"), but deleting keeps an empty title unless asked: a title names the slide in navigation and to a screen reader. The tools reportempty_placeholders: [{shape, type, idx}]in every changing call's checks and incheck(withfit, the default), andsave_documentlists the ones left underunresolved.ppt_manage_slidesgainsdelete_empty_placeholders.A4, table styles and Table Design flags.
deck.table_styles -> [{id, name, builtin}]lists the deck's own styles (tableStyles.xml) and then PowerPoint's 74 built-in styles (GUIDs and names from pptx2svg's catalogue, measured in PowerPoint). The default is marked.table.stylecan be read, and set by name or id.table.flagsandtable.set_flags(...)cover the six flags.add_table(style=)also takes a name and refuses an id that neither the deck nor PowerPoint knows. Tools:ppt_add_tablestyle,ppt_edit_tableset_style/set_flags,styleandflagsin table results, anddescribetheme.table_styles.Budget: core unchanged (3,398 estimated, about 5,029 counted, budget 5,500). All definitions 10,269 -> 10,464 (guard 10,500, stays). Strict tool set unchanged.
Golden p14: a chart slide on "Title and Content" with its empty body deleted, and a table in the template's own style ("Harbor Lane Table", added to the business review's
tableStyles.xmlby the input builder) with banding off. 10 calls, 18/18 checks.PowerPoint verification (PowerPoint 16, Dutch UI; PDF exports and Normal-view screenshots):
delete_empty_placeholdersnow keeps a placeholder that draws a fill or outline (its own or its layout's) and reports it askept_drawn(commit 8f3e17c).tableStyles.xmlkeeps onlydefand the deck's own style. Built-ins are referenced by GUID only, as implemented. PowerPoint writes the flag attributes in the same order asset_flags.check_p14checks one line as drawn.🤖 Generated with Claude Code
https://claude.ai/code/session_01WCxhY1fvWQPiWCwz7SYUVh