feat(slides): add insert-image to place a sized image on an existing slide#695
Conversation
|
Codex review: found issues before merge. Reviewed June 7, 2026, 4:46 PM ET / 20:46 UTC. Summary Reproducibility: not applicable. this is a feature PR rather than a bug report. The PR discussion includes redacted live terminal proof plus mocked tests for the new command behavior. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the focused command after bounding cleanup and after maintainers explicitly choose the intended temporary-public-sharing policy for Slides image commands. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a feature PR rather than a bug report. The PR discussion includes redacted live terminal proof plus mocked tests for the new command behavior. Is this the best way to solve the issue? Unclear; the implementation is narrow and proof-positive, but it is not the best merge state until cleanup is bounded and maintainers accept or adjust the temporary public-sharing policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 7256355c7fc8. Label changesLabel justifications:
Evidence reviewedSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Thanks for the review. Addressed both P1 findings and added the requested behavior proof. Changes (commit on this branch)
TestsLive behavior proofRun against a real (now-deleted) scratch presentation, account redacted. A neutral 300x150 (2:1) PNG was used; note The temporary Drive upload was deleted automatically after insertion (verified separately; a subsequent Drive listing shows no residual file). @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Fixed the test-isolation nit: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…slide add-slide only lays a full-bleed image on a new slide. insert-image places a positioned, sized image on an existing slide, reusing the same private-image flow as add-slide: upload to Drive, grant a temporary anyone-reader permission so the Slides image fetcher can read it, createImage, then delete the temp file. - Args: presentationId, slideId, image (PNG/JPG/GIF). - Flags: --x, --y, --width (required), --height, --unit (PT|EMU, default PT). - --height is optional: derived from the image's aspect ratio when omitted. - Confirms the target slide exists before uploading anything. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ge cleanup failures Address review feedback on insert-image: - Create the Drive service and upload only after confirming the target slide exists, so a bad slide id never touches Drive. - Delete the temporary public image via a cancellation-immune context and log a loud warning if deletion fails, instead of swallowing the error (a failed cleanup could otherwise leave the upload world-readable until manual removal). - Add a cleanup-failure test asserting the warning is emitted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…slide test The missing-slide test overrode the package-global newDriveService without restoring it, leaking the stub into later tests. Save and restore it in the cleanup alongside newSlidesService. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ba70530 to
31a0c11
Compare
|
Landed in bedfa7d. Thanks @Czaruno. I accepted the temporary public Drive read handoff for this command so Slides can fetch the uploaded local image, with cleanup warning coverage if deletion fails. Proof:
|
What
Adds
gog slides insert-image: place a positioned, sized image on an existing slide.add-slideis great for full-bleed image slides, but there's no way to drop a sized image (a logo top-right, a chart in a content area) onto a slide you already have. The Slides RESTcreateImageonly accepts a publicly-fetchable URL, so callers otherwise have to hand-roll the upload + temporary public permission +createImage+ cleanup, or make files public by hand.This reuses the exact private-image flow
add-slide/replace-slidealready use, so nothing is left public:anyone: readerpermission so the Slides image fetcher can read it.createImageonto the target slide with explicit size + transform.defer).Usage
presentationId,slideId,image(PNG/JPG/GIF).--widthis required;--heightis optional and derived from the image's aspect ratio when omitted.--unitdefaults toPT.Testing
go build ./...,go vet ./internal/cmd/clean.slides_add_slide_test.go):./internal/cmdtests still pass.Notes
imagefor aspect detection).docs/commands/can be regenerated by the maintainers' doc tooling.