Skip to content

Slides element positioning: move, reorder#26

Merged
ronaldmannak merged 3 commits into
mainfrom
claude/tender-gates-vc7Mi
Jul 5, 2026
Merged

Slides element positioning: move, reorder#26
ronaldmannak merged 3 commits into
mainfrom
claude/tender-gates-vc7Mi

Conversation

@ronaldmannak

Copy link
Copy Markdown
Contributor

Continues the Docs/Slides authoring roadmap (after #23#25 added the "add any element" surface). The create-* commands (create-textbox/create-table/create-image) place elements at Slides' default position; this adds the positioning primitives to lay them out.

New commands

Command Tier API
slides move <preso> <objectId> --x <pt> --y <pt> [--scale-x N --scale-y N] .edit presentations.batchUpdate (updatePageElementTransform, ABSOLUTE)
slides reorder <preso> <objectId> --to front|back|forward|backward .edit presentations.batchUpdate (updatePageElementsZOrder)

Notes

  • move sets the element's transform in ABSOLUTE mode — position (and optional scale) are set outright, so no read of the current transform is needed. Positions are in points (→ EMU; 1 pt = 12700). Non-finite / out-of-range --x/--y and non-positive --scale-x/--scale-y are rejected (exit 2). Because ABSOLUTE replaces the transform, omitting --scale-* resets scale to 1 — fine for create-* elements, which are already scale 1.
  • reorder maps --toBRING_TO_FRONT / SEND_TO_BACK / BRING_FORWARD / SEND_BACKWARD; an unknown direction is a usage error (exit 2).
  • Object IDs come from slides read-slide. Both are .edit, with --dry-run / --json.
  • Deferred (later): absolute resize (needs the element's intrinsic size via a read), Docs table-cell population, markdown→deck.

Tests

4 wiring tests: move verb/endpoint/body (incl. the EMU translate); the non-finite --x guard; reorder z-order op mapping; and the bad---to guard. SKILL.md documents both.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA


Generated by Claude Code

Add the positioning primitives so the create-* elements (text box, table,
image) -- which land at default positions -- can be laid out:

- slides move <preso> <objectId> --x <pt> --y <pt> [--scale-x N --scale-y N]:
  updatePageElementTransform in ABSOLUTE mode. Sets position/scale outright (no
  read of the current transform needed). Points -> EMU. Non-finite / out-of-range
  geometry and non-positive scale are rejected (exit 2).
- slides reorder <preso> <objectId> --to front|back|forward|backward:
  updatePageElementsZOrder (BRING_TO_FRONT / SEND_TO_BACK / BRING_FORWARD /
  SEND_BACKWARD). An unknown direction is a usage error (exit 2).

Both are additive .edit writes with --dry-run/--json. 4 wiring tests (transform
verb/endpoint/body incl. EMU translate; the non-finite guard; z-order op mapping;
the bad-direction guard). SKILL.md documents both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 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 adds two new subcommands to the gog slides tool: move (for setting a slide element's absolute position and scale) and reorder (for changing its z-order). It also includes documentation updates and comprehensive unit tests. The feedback suggests an improvement to the move command's validation logic to allow negative scale factors, which are valid in Google Slides for reflecting or flipping elements, rather than restricting them to strictly positive values.

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
#26)

Negative scale factors are valid in Slides (they reflect/flip an element), so the
strictly-positive guard was too restrictive. Require finite and non-zero instead:
allows flipping, still rejects zero (degenerate/singular matrix) and non-finite
(would trap the JSON encoder). Matches Gemini's suggested diff. Adds tests that a
negative --scale-x is accepted and zero is rejected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: 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: 40b7f6c8e6

ℹ️ 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 Outdated
Comment thread Sources/GogCommands/GogCommand.swift Outdated
Codex correctly flagged that ABSOLUTE updatePageElementTransform replaces the whole
transform, so `move` stripped an element's rotation/shear (omitted -> 0) and reset
its scale to 1 when --scale was omitted -- wrong for "reposition an existing
element." move now first reads the element's current transform and preserves its
scale/shear, changing only the position (and scale when --scale-x/--scale-y are
given; those stay optional and still allow negative for a flip). An unknown
objectId is a clean usage error (exit 2).

--scale-x/--scale-y are now optional (omit = keep current). Rewrote the move wiring
test to assert preservation (scale + shear kept, position set) via a decoded body so
it doesn't depend on float formatting; updated the negative-scale test to supply the
element in the read response.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JGWAxXq3PZatbdBR4P5RrA
@ronaldmannak ronaldmannak merged commit 37105c7 into main Jul 5, 2026
2 checks passed
@ronaldmannak ronaldmannak deleted the claude/tender-gates-vc7Mi branch July 5, 2026 14:27
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