Skip to content

Richer Docs/Slides authoring: docs insert-table, slides read-slide + insert-text#23

Merged
ronaldmannak merged 2 commits into
mainfrom
claude/gog-docs-slides-authoring
Jul 4, 2026
Merged

Richer Docs/Slides authoring: docs insert-table, slides read-slide + insert-text#23
ronaldmannak merged 2 commits into
mainfrom
claude/gog-docs-slides-authoring

Conversation

@ronaldmannak

@ronaldmannak ronaldmannak commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

First slice of the richer Docs/Slides authoring roadmap (after the create/edit/delete surface in #21#22). All additive — .edit for the writes, a read for read-slide.

New commands

Command Tier API
docs insert-table <docId> --rows R --cols C [--index N] .edit documents.batchUpdate (insertTable)
slides read-slide <presentation> <slideId> read presentations.pages.get (element objectIds + text, one slide)
slides insert-text <presentation> <objectId> --text … [--index N] [--row R --col C] .edit presentations.batchUpdate (insertText)

read-slide exists so the page-element objectIds that insert-text targets are discoverable from the CLI (mirrors how list-slides feeds delete-slide).

Notes

  • insert-table inserts an empty R×C table at the end of the doc (or at --index); cells start empty. Validates rows/cols > 0.
  • read-slide fetches a single page via presentations.pages.get, so --json returns only the requested slide's elements and an unknown slideId fails (404 → exit 1) rather than silently dumping every slide.
  • insert-text inserts into an existing shape by objectId at --index (default 0); pass --row R --col C together to target a table cell (cellLocation). Supplying only one of --row/--col is a usage error (exit 2).
  • Deliberately deferred (later PRs): image inserts, markdown→deck, smart chips.
  • --dry-run / --json throughout; uses the docs/slides hosts already allow-listed in Add Docs and Slides write commands (create / append / find-replace, etc.) #21.

Tests

6 wiring tests: insert-table verb/endpoint/body + positive-dimensions validation; read-slide element listing (asserts the single-page URL); insert-text shape body; insert-text into a table cell (asserts the cellLocation payload); and the --row/--col-together usage guard. SKILL.md documents all three commands. CI green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA


Generated by Claude Code

…text

First slice of the richer-authoring roadmap, all additive (.edit for the
writes; read-slide is a read):

  docs insert-table <id> --rows R --cols C   (empty table at end or --index)
  slides read-slide <id> <slideObjId>        (list a slide's page-element
                                              objectIds + text)
  slides insert-text <id> <objId> --text     (insert into a shape/table cell)

read-slide makes the element objectIds for insert-text discoverable. Cell-level
table population, image inserts, markdown->deck and smart chips are deliberately
left for later. Wiring tests (verb + endpoint + body, plus an insert-table
validation) and SKILL.md entries included.

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several new commands to the gog CLI: docs insert-table for inserting empty tables into Google Docs, slides read-slide for listing slide elements, and slides insert-text for inserting text into slide shapes. The review feedback highlights a critical issue where slides insert-text cannot insert text into table cells as documented because the Google Slides API requires a cellLocation (row and column index) rather than just an objectId. Additionally, the feedback suggests escaping slide text with tsvEscaped in slides read-slide to prevent TSV corruption from tabs, and adding a corresponding test case for the table cell text insertion.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Sources/GogCommands/GogCommand.swift Outdated
Comment thread Sources/GogCommands/GogCommand.swift
Comment thread Tests/GogShellTests/GogWiringTests.swift

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a2652b0cdc

ℹ️ 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".

Comment thread Sources/GogCommands/GogCommand.swift
Comment thread Sources/GogCommands/GogCommand.swift
Review fixes on #23:
- slides insert-text: add --row/--col and encode cellLocation, so a table
  objectId can actually address a cell (the API needs cellLocation; without it
  a table target was rejected). --row/--col must be given together. Tests cover
  the cellLocation payload and the both-or-neither guard.
- slides read-slide: fetch the single page via presentations.pages.get instead
  of the whole deck, so --json is scoped to the requested slide and an unknown
  ID 404s rather than dumping every slide. TSV-escape element text.

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
@ronaldmannak ronaldmannak merged commit 3b62f9a into main Jul 4, 2026
2 checks passed
ronaldmannak pushed a commit that referenced this pull request Jul 4, 2026
…ion test

- create-textbox: reject non-finite / out-of-range --x/--y/--width/--height
  before the Double->Int EMU conversion, which traps on NaN/Infinity (and an
  Infinity slipped past the positive-size guard). Flagged by Codex + Gemini on
  #24. Adds a test that `--x inf` exits 2 instead of crashing the process.

- Fix a pre-existing flaky assertion in slidesInsertTextIntoTableCellEncodes-
  CellLocation: JSONEncoder emits object keys in per-process-random order, so
  assert rowIndex/columnIndex independently rather than as one fixed-order
  substring. This was the only CI failure on #24 (it passed on #23 by luck of
  the process hash seed, not because the order is stable).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants