Skip to content

Add destructive Docs/Slides ops: docs clear, slides delete-slide (+ list-slides)#22

Merged
ronaldmannak merged 3 commits into
mainfrom
claude/gog-docs-slides-destructive
Jun 21, 2026
Merged

Add destructive Docs/Slides ops: docs clear, slides delete-slide (+ list-slides)#22
ronaldmannak merged 3 commits into
mainfrom
claude/gog-docs-slides-destructive

Conversation

@ronaldmannak

Copy link
Copy Markdown
Contributor

Completes the Docs/Slides write surface from #21 with the destructive operations, gated at .full (matching the tier model where destructive/irreversible writes need the top tier).

New commands

Command Tier API
docs clear <id> .full documents.batchUpdate (deleteContentRange)
slides delete-slide <id> <objectId> .full presentations.batchUpdate (deleteObject)
slides list-slides <id> read presentations.get (lists slide objectIds)

list-slides exists so the objectIds for delete-slide are discoverable from the CLI.

Notes

  • docs clear reads the body extent first (deleteContentRange needs an explicit range), deletes [1, end-1], and keeps the document's mandatory final newline. Empty or tab-only docs report no body content and are left untouched (fail-safe). --dry-run prints the intent without the read.
  • All --dry-run / --json as usual; uses docs.googleapis.com / slides.googleapis.com, already allow-listed by Add Docs and Slides write commands (create / append / find-replace, etc.) #21.
  • Still not included (follow-ups if wanted): the richer gogcli surface — image/table inserts, markdown decks, smart chips, tabs management.

Tests

4 wiring tests: docs clear delete-range + the empty-doc no-op path, slides list-slides objectIds, slides delete-slide body. SKILL.md documents all three. CI green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA


Generated by Claude Code

…e (+ list)

Completes the Docs/Slides write surface from #21 with the destructive ops,
gated at .full:

  docs clear <id>                 (batchUpdate deleteContentRange; reads the
                                   body extent first, keeps the final newline)
  slides delete-slide <id> <obj>  (batchUpdate deleteObject)
  slides list-slides <id>         (read: lists slide objectIds for delete-slide)

docs clear leaves empty / tab-only docs untouched. Adds wiring tests (verb +
endpoint + body, plus the empty-doc no-op path) and documents the commands in
SKILL.md. Uses the docs/slides hosts already allow-listed in #21.

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 Google Docs and Slides CLI, including gog docs clear to empty a document's content, gog slides list-slides to retrieve slide object IDs, and gog slides delete-slide to remove a slide. Corresponding unit tests and documentation updates are also provided. Feedback on these changes suggests outputting valid JSON instead of plain text when docs clear is run on an already empty document with the --json flag enabled, ensuring consistency by adding the standard --fail-empty flag to slides list-slides, and adding a unit test to verify this behavior.

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
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: 53ada375cc

ℹ️ 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 Outdated
…on & tabs

- slides list-slides: add --fail-empty (FailEmptyFlag) for parity with the
  other list commands; test covers the empty -> exit 3 path.
- docs clear: emit {} (not plain text) under --json on the already-empty no-op.
- docs clear: it only clears the main (first) tab, so make that explicit in the
  abstract/help/comment rather than claiming "all content" (multi-tab docs keep
  their other tabs).

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA

@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: aa66f857cf

ℹ️ 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
Codex: deleteObject removes any page element (shape/table/image), so a
mistyped or copied element ID would quietly delete non-slide content while the
CLI reports "deleted slide". Confirm the ID is one of the presentation's slide
object IDs first (refuse with exit 2 otherwise); dry-run still previews
offline. Tests cover both the valid and the rejected-ID paths.

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
@ronaldmannak ronaldmannak merged commit ecf1cef into main Jun 21, 2026
2 checks passed
@ronaldmannak ronaldmannak deleted the claude/gog-docs-slides-destructive branch June 21, 2026 23:51
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