feat(docs): add +page-setup helper#688
feat(docs): add +page-setup helper#688jonathanlinford wants to merge 4 commits intogoogleworkspace:mainfrom
Conversation
…erties Adds a new `docs +page-setup` helper command that builds an `updateDocumentStyle` batchUpdate request from user-friendly flags: --mode (pages/pageless), --orientation, --paper-size, --margin-*, and --page-color.
🦋 Changeset detectedLatest commit: 58d1415 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new helper command to the Google Workspace CLI that simplifies the process of updating document page styles. By abstracting the complex batchUpdate API requirements, users can now easily adjust page layout settings such as margins, orientation, and background color using intuitive command-line arguments. The implementation includes necessary validation and conversion logic to ensure inputs are correctly translated into the format expected by the Google Docs API. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces the docs +page-setup helper command to the Google Workspace CLI, allowing users to configure document properties such as page orientation, paper size, margins, and background color. The implementation includes hex color parsing, paper size mapping, and integration with the Google Docs batchUpdate API. Feedback was provided to replace an unwrap() call with explicit error handling to prevent potential panics if the supported paper sizes list becomes desynchronized.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the +page-setup helper for the docs command, allowing users to configure document properties such as page orientation, paper size, margins, and background color. The implementation includes a new subcommand, helper functions for unit conversions and color parsing, and expanded unit tests. Feedback was provided regarding the detection of the dry-run flag, which is currently being checked on subcommand matches instead of the parent command matches, potentially leading to the flag being ignored.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the docs +page-setup helper command to the Google Workspace CLI, enabling users to configure page mode, orientation, paper size, margins, and background colors for Google Docs. The implementation includes utility functions for paper size mapping and hex color parsing, alongside a refactor of the DocsHelper to accommodate multiple subcommands using the batchUpdate API. Feedback focuses on improving the maintainability of the subcommand handling logic and refining the field masks used in the API requests to ensure that only intended properties are updated, preventing the accidental reset of other document style attributes.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new +page-setup helper command for Google Docs, allowing users to configure document mode, orientation, paper size, margins, and background color through the CLI. The implementation includes utility functions for paper size mapping and hex color parsing, updates to the command-line interface, and logic to generate the appropriate batchUpdate requests for the Google Docs API. Comprehensive unit tests have been added to verify the new functionality. I have no feedback to provide.
|
@jpoehnelt this is ready for review when you get a chance. Gemini bot comments have been addressed — two field mask suggestions were applied, the rest declined with explanations. |
Summary
docs +page-setuphelper command that configures document page properties viaupdateDocumentStylebatchUpdate--mode(pages/pageless),--orientation(portrait/landscape),--paper-size(letter, a4, legal, etc.),--margin-top/bottom/left/right(inches), and--page-color(hex)Examples
gws docs +page-setup --document DOC_ID --paper-size a4 --orientation landscape gws docs +page-setup --document DOC_ID --margin-top 0.5 --margin-bottom 0.5 gws docs +page-setup --document DOC_ID --page-color '#f0f0f0' gws docs +page-setup --document DOC_ID --mode pagelessTest plan
#, invalid length, invalid chars)cargo clippyandcargo testpass🤖 Generated with Claude Code