Skip to content

feat(slides): add structured introspection#836

Merged
steipete merged 1 commit into
mainfrom
feat/slides-introspection
Jun 18, 2026
Merged

feat(slides): add structured introspection#836
steipete merged 1 commit into
mainfrom
feat/slides-introspection

Conversation

@steipete

Copy link
Copy Markdown
Collaborator

Summary

  • add slides locate / find-element for read-only shape and table-cell text lookup with exact UTF-16 ranges
  • enrich slides read-slide with table-cell text and image source URLs; --detail adds flattened element types, parent links, normalized PT bounds, runs/styles/links/colors, paragraphs, bullets, and table structure
  • extend slides info with slide count, PT page size, locale, masters/theme colors, and layouts while retaining Drive metadata
  • document the structured output contract and retain slides raw as the lossless API escape hatch

Closes #822.

Compatibility

Existing read-slide JSON fields remain. textElements and images are additive; table-cell entries, sourceUrl, and tables are new. Detailed high-volume structure is opt-in with --detail.

Verification

  • focused geometry, styled-run, table-cell, metadata, split-run, and UTF-16/emoji regression tests
  • make ci
  • local diff and full branch autoreview: no actionable findings
  • live Google Slides proof on a disposable deck: native metadata and 720x405 PT page size; shape/image/table element bounds; image sourceUrl; bold/italic/font/size/color/link runs; table-cell content; literal locator ranges for ordinary text, table text, and an emoji surrogate pair
  • disposable live deck moved to trash and verified trashed

Docs

  • add docs/slides-introspection.md
  • update README examples and generated command reference

Thanks @sebsnyk for the report.

@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: 64aacdd1bd

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

if err != nil {
return err
}
presentation, err := svc.Presentations.Get(file.Id).Context(ctx).Do()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a field mask to the slides info fetch

For large presentations this unqualified Presentations.Get downloads every slide's full page elements, notes, image URLs, and other content even though buildSlidesPresentationInfo only uses title, locale, revision ID, page size, slide count, masters, and layouts. That makes a metadata-only gog slides info unexpectedly slow and quota-heavy on large decks; request just those fields with Fields(...) before Do().

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 5ff811d into main Jun 18, 2026
9 checks passed
@steipete

Copy link
Copy Markdown
Collaborator Author

Landed as 5ff811dc.

Maintainer verification:

  • Focused tests cover transformed/grouped PT bounds, EMU conversion, styled runs, paragraphs/bullets, table cells, source URLs, Slides-native metadata, split text runs, and UTF-16 emoji ranges.
  • Full local gate: make ci.
  • Autoreview: local diff and full branch review both returned no actionable findings.
  • Live Google Slides proof used a disposable deck containing styled and linked text, an HTTPS image, and a populated native table. slides info reported the native slide count, 720x405 PT page size, master, and layouts; read-slide --detail --json exposed element bounds, normalized colors, links, image source URL, and table-cell text; slides locate returned exact ranges for ordinary text, table text, and a two-code-unit emoji.
  • Cleanup verified: the disposable deck was moved to trash and read back as trashed.
  • GitHub checks: both push and PR runs passed on Linux, Windows, macOS, and worker; image build passed.

Thanks @sebsnyk.

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.

slides: read-slide/info expose no geometry, text styling, table-cell text, or element locator

1 participant