Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a summary of everything that was changed.
Core Helper Functions (googleDocsApiHelpers.ts)
findTextRange()-- Added optional tabId parameter. When provided, fetches with includeTabsContent: true, locates the target tab via findTabById(), and searches that tab's documentTab.body.content instead of the default document.body.content. Throws a UserError if the tab is not found.getParagraphRange()-- Same pattern as findTextRange(). Now accepts optional tabId and searches within the correct tab's content.createTable()-- Added optional tabId parameter, sets it on the location object when provided.insertInlineImage()-- Added optional tabId parameter, sets it on the location object when provided.Tool Parameter Schemas (types.ts)
ApplyTextStyleToolParameters-- Added optional tabId field.ApplyParagraphStyleToolParameters-- Added optional tabId field.Tool Implementations
applyTextStyle-- Threads tabId to both findTextRange() and buildUpdateTextStyleRequest().applyParagraphStyle-- Threads tabId to findTextRange(), getParagraphRange(), and buildUpdateParagraphStyleRequest().insertTable-- Added tabId parameter with tab existence verification, passes through to createTable().insertPageBreak-- Added tabId parameter with tab existence verification, sets it on the location object.insertImage-- Added tabId parameter with tab existence verification, passes through to insertInlineImage().Tests (googleDocsApiHelpers.test.ts)
findTextRangewith tabId correctly searches tab-specific contentfindTextRangethrows UserError for nonexistent tabIdfindTextRangewithout tabId does not use includeTabsContentgetParagraphRangewith tabId correctly searches tab-specific contentgetParagraphRangethrows UserError for nonexistent tabIdFixes #39, #11, and #34