Repository navigation
fix(parser): recover text_box and nested table/list text in office IR - #19319
Conversation
bwbd.pptx stores all slide text in graphicFrame tables, which office_oxide emits as text_box -> table IR. The IR text flattening only recognized paragraph/heading blocks, so every slide flattened to empty text. The empty items bypassed the PlainText salvage (gated on len(items) == 0) and were later filtered by the Tokenizer, silently yielding 0 chunks for a readable deck. Flatten each text_box block, table cell block, and list item block via docxElementText so nested table/list/text_box content is recovered. Extend the PPTX PlainText fallback to trigger when all items are empty, not just when there are no items. Co-authored-by: CommandCodeBot <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe parser now preserves nested DOCX block content through generic flattening. PPTX parsing detects structured sections with no extractable text and retains whole-document plain text. ChangesParser text preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Nested PPTX and DOCX content is now retained during text extraction, and decks with only empty structured items fall back to plain text. The covered parser behavior is ready to merge. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Add fail-before-fix regression tests for the text_box/table/list flattening recovery: list item nesting a table, table cell nesting a list, and a text_box wrapping a table at the DOCX layer (mirrors the PPTX bwbd.pptx shape). All three fail on the old paragraph-only paths and pass with the docxElementText recursion. Co-authored-by: CommandCodeBot <[email protected]>
Extend TestBuildPPTXJSONSections with the missing nesting shapes: text_box wrapping a list, nested text_box, and a table cell wrapping a list. All three fail on the old paragraph-only flattening and pass with the docxElementText recursion. Co-authored-by: CommandCodeBot <[email protected]>
Summary
bwbd.pptx stores all slide text in graphicFrame tables, which office_oxide emits as
text_box -> tableIR. The IR text flattening only recognized paragraph/heading blocks, so every slide flattened to empty text. The empty items bypassed the PlainText salvage (gated onlen(items) == 0) and were later filtered by the Tokenizer, silently yielding 0 chunks for a readable deck.Changes
docxElementTextso nested table/list/text_box content is recovered (internal/parser/parser/docx_ir.go).internal/parser/parser/pptx_parser.go, gate ininternal/parser/parser/pptx_ir.go).text_box wrapping table keeps textandTestItemsAllEmpty(internal/parser/parser/pptx_ir_test.go).Verification
bash build.sh --test ./internal/parser/parser/passes.docx_ir.gofix and passes with it.bash build.sh --test ./internal/ingestion/component/...passes (no downstream regression).Fixes the 0-chunk ingestion of grouped-shape PPTX decks while leaving paragraph/heading/image paths unchanged.