Conversation
Word Tools (Phase 1 - Parity with PowerPoint): - get_document_overview: structural scan with headings, word count, tables - get_selection_text: plain text selection (not raw OOXML) - insert_content_at_selection: surgical HTML insert at cursor - find_and_replace: search/replace with case and whole-word options Word Tools (Phase 2 - Enhanced): - get_document_section: read content by heading name - insert_table: insert formatted table with header/striped styles - apply_style_to_selection: format text (bold, italic, font, color, highlight) PowerPoint Tools (Phase 3 - Refinement): - get_slide_notes: read speaker notes - set_slide_notes: add/update speaker notes - duplicate_slide: copy existing slide Total: 10 new tools to improve Word/PowerPoint capabilities
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83958eb434
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| range.expandTo(endPara.getRange(Word.RangeLocation.whole)); | ||
|
|
||
| const html = range.getHtml(); |
There was a problem hiding this comment.
Use expanded range when extracting section HTML
The section reader builds a range from startPara and calls expandTo, but then it reads HTML from the original range object instead of the expanded one. In Word JS, expandTo returns a new range, so this currently returns only the first paragraph/heading rather than the whole section, which breaks the core behavior of get_document_section for multi-paragraph sections.
Useful? React with 👍 / 👎.
| // Due to API limitations, we provide feedback about the limitation | ||
| // In a full implementation, this would use Office.context.document.setSelectedDataAsync | ||
| // or OOXML manipulation for notes | ||
|
|
||
| return `Note: Setting slide notes via the web add-in API has limitations. For slide ${slideIndex + 1}, please use the Notes pane in PowerPoint to add: "${notes.substring(0, 100)}${notes.length > 100 ? "..." : ""}"`; |
There was a problem hiding this comment.
Persist notes instead of returning an instructional message
This tool never writes to slide notes: after validating the index, it immediately returns a message telling the user to edit notes manually. That makes set_slide_notes a no-op even on successful calls, so callers will believe notes were updated when no presentation state changed.
Useful? React with 👍 / 👎.
| if (targetIndex !== undefined && targetIndex !== slideCount) { | ||
| // Reload slides to get updated order | ||
| slides.load("items"); | ||
| await context.sync(); | ||
|
|
||
| // Find and move the new slide | ||
| // Note: Moving slides requires specific API support |
There was a problem hiding this comment.
Honor targetIndex when duplicating slides
When targetIndex is provided, the code enters a branch that only reloads slides and leaves a TODO comment, but never repositions the new slide. The response still reports the duplicate at targetIndex + 1, so callers get incorrect placement and misleading success output whenever a non-default target is requested.
Useful? React with 👍 / 👎.
| // Copy text shapes (basic duplication - full OOXML copy would be more complete) | ||
| for (const shape of sourceSlide.shapes.items) { | ||
| try { | ||
| const text = shape.textFrame?.textRange?.text; | ||
| if (text) { | ||
| newSlide.shapes.addTextBox(text, { |
There was a problem hiding this comment.
Copy non-text shapes when duplicating a slide
The duplication logic recreates only text boxes (addTextBox) from shapes that expose text and drops everything else (images, charts, tables, lines, formatting/layout metadata). For typical slides this produces a materially incomplete duplicate while the tool advertises full duplication, so users can lose most slide content.
Useful? React with 👍 / 👎.
New Excel tools: - get_workbook_overview: structural scan with sheets, used ranges, named ranges, charts - find_and_replace_cells: search/replace text in cells with case/whole-cell options - insert_chart: create charts (column, bar, line, pie, area, scatter, doughnut) - apply_cell_formatting: format cells (bold, colors, borders, number format, alignment) - create_named_range: define named ranges for easier reference Total new tools: 5 Excel + 10 Word/PowerPoint = 15 new tools
Word Tools (Phase 1 - Parity with PowerPoint):
Word Tools (Phase 2 - Enhanced):
PowerPoint Tools (Phase 3 - Refinement):
Total: 10 new tools to improve Word/PowerPoint capabilities