🧹 [refactor] reduce deep code nesting in docx comment text extraction - #54
Conversation
Extract helper functions extractTextFromParagraph, extractTextFromParagraphChild, and extractTextFromRunChild to replace 3-level deep nested loops in extractDocxCommentPlainText. Add unit tests for edge cases.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What: Resolved deeply nested loops in
extractDocxCommentPlainTextwithinsrc/docxCommentLogging.ts.💡 Why: Splitting paragraph and run text extraction into modular single-responsibility helper functions eliminates 4 levels of indentation and significantly improves maintainability and readability.
✅ Verification: Verified with
npm run typecheck,npm run lint, and full test suite (npm test), along with dedicated edge-case unit tests intests/docx-comment-logging.test.mjs.✨ Result: Clean, readable, well-tested code with zero behavior changes or regressions.
PR created automatically by Jules for task 10413854497658198364 started by @MarsLuay