Skip to content

fix(docs): include document title in getText and getSuggestions#309

Merged
allenhutchison merged 2 commits into
mainfrom
fix/docs-include-title
Mar 31, 2026
Merged

fix(docs): include document title in getText and getSuggestions#309
allenhutchison merged 2 commits into
mainfrom
fix/docs-include-title

Conversation

@allenhutchison
Copy link
Copy Markdown
Contributor

Summary

  • docs.getText and docs.getSuggestions were the only read tools that didn't return the document title — slides.getText, sheets.getText, and gmail.get all already did
  • getText: Prepends Document Title: ... for single-tab plain text responses; wraps multi-tab JSON in a { title, tabs } object
  • getSuggestions: Returns { title, suggestions } instead of a bare array

Test plan

  • All 43 DocsService tests pass (updated assertions for new response shapes)
  • Lint and format checks pass

…nses

docs.getText and docs.getSuggestions were not returning the document
title, unlike slides.getText and sheets.getText which already did.

- getText: prepends "Document Title: ..." for single-tab plain text,
  wraps multi-tab JSON in { title, tabs } object
- getSuggestions: returns { title, suggestions } instead of bare array
Copy link
Copy Markdown
Contributor

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

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 updates the DocsService to include the document title in the output of various methods, including those for retrieving text and suggestions. The changes involve updating the Google Docs API field masks to fetch the title and restructuring the JSON response to include it. Test files have been updated to accommodate the new response structure. The review feedback suggests adding explicit assertions in the tests to verify that the title field is correctly populated, ensuring the primary goal of the PR is fully validated.

Comment thread workspace-server/src/__tests__/services/DocsService.test.ts
Add mock title data and explicit assertions verifying the document
title is present in responses, not just the tab/suggestion content.
Copy link
Copy Markdown
Contributor

@abhipatel12 abhipatel12 left a comment

Choose a reason for hiding this comment

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

LGTM!

@allenhutchison allenhutchison merged commit 0793a5f into main Mar 31, 2026
14 checks passed
@allenhutchison allenhutchison deleted the fix/docs-include-title branch March 31, 2026 00:40
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.

3 participants