feat(docs): read and create comments - #19
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Comment-free documents can fail reading, and repeated matches within one text run can be replaced ambiguously.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Extends the Docs helpers with suggestion workflows, comment retrieval, and anchored comment creation.
Changes:
- Adds
+suggestoperations and documentation. - Adds opt-in comment inclusion with
referencedText. - Adds
+comment createwith range validation and preview support.
File summaries
| File | Description |
|---|---|
README.md |
Documents Docs suggestions and comments |
crates/google-workspace-cli/src/helpers/docs/suggest.rs |
Implements suggestion workflows |
crates/google-workspace-cli/src/helpers/docs/read.rs |
Adds comment retrieval and anchor resolution |
crates/google-workspace-cli/src/helpers/docs/read_tests.rs |
Tests comment parameters and text resolution |
crates/google-workspace-cli/src/helpers/docs/comment.rs |
Implements anchored comment creation |
crates/google-workspace-cli/src/helpers/docs.rs |
Registers new Docs helpers |
.changeset/docs-suggest-workflow.md |
Adds suggestion feature changeset |
.changeset/docs-read-comments.md |
Adds comment-reading changeset |
.changeset/docs-comment-create.md |
Adds comment-creation changeset |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed all three Copilot review findings in commit
Validation: 751 unit tests, 22 integration tests, 4 file-root tests, rustfmt, Clippy, and diff checks all pass. |
There was a problem hiding this comment.
🟡 Changes recommended
Suggestion replacement omits child tabs, and comment anchor resolution conflates separate document segments.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
crates/google-workspace-cli/src/helpers/docs/read.rs:346
collect_text_runswalks the entire normalized document, including each tab'sheaders,footers, andfootnotes, butTextRuncarries only the tab ID. Docs indices are scoped by tab/segment, so a body comment range can incorrectly match same-numbered text in a header/footer/footnote (and ranges withsegmentIdare ignored), producing a concatenated or unrelatedreferencedText. Preserve the segment identity while collecting runs and require it to match the anchor range, treating an absent/empty segment as the body.
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
|
Addressed the latest Copilot findings in commit
Validation: 754 unit tests, 22 integration tests, 4 file-root tests, rustfmt, Clippy, and diff checks pass. |
Summary
gws docs +read --include-commentswith per-anchorreferencedTextgws docs +comment createwith UTF-16 range validation and internal preview-field opt-inVerification
cargo test -p google-workspace-cli --quiet(747 unit, 22 integration, 4 file-root tests)cargo fmt --all -- --checkcargo clippy -p google-workspace-cli -- -D warnings--allow-unknown-fields, read it back withreferencedText, and deleted the temporary documentThis PR is based on the suggestion workflow branch and includes its commits.