-
Notifications
You must be signed in to change notification settings - Fork 648
feat(docs): read-only surface for suggested edits (tracked changes) — docs suggestions list / --suggestions #876
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
No fields configured for issues without a type.
What I'm trying to do
Read the pending suggested edits (tracked changes) on a Google Doc from the CLI — the per-run inserted/deleted text a reviewer has proposed but not yet accepted — so a caller can see "what is being suggested on this doc" without opening it in the browser.
Gap (confirmed in CLI + source, v0.30.0)
There is no surface for Docs suggestions:
gog docs --help,gog docs cat --helpexpose no--suggestionsflag and nosuggestionssubcommand. TheDocsCmdstruct ininternal/cmd/docs.gohas no suggestions command.Documents.Getcall setsSuggestionsViewMode—grep -rn "SuggestionsViewMode("returns nothing.docs raw(the lossless dumper) callssvc.Documents.Get(id)without.SuggestionsViewMode("SUGGESTIONS_INLINE"), so it returns the default view, where per-runsuggestedInsertionIds/suggestedDeletionIdsare not reliably populated. The struct field is only copied through inprojectRawDocumentTab(SuggestionsViewMode: doc.SuggestionsViewMode), never set on the request.suggestedInsertionIds/suggestedDeletionIds/suggestedTextStyleChanges—grep -rn "SuggestedInsertionIds\|SuggestedDeletionIds"(excluding tests) returns nothing.So today there is no way, raw or rendered, to reliably get a doc's pending suggestions out of
gog.Why this is feasible (Docs API)
The Docs REST API supports reading suggestions.
documents.getaccepts asuggestionsViewModequery parameter; withSUGGESTIONS_INLINEthe response carries per-TextRunsuggestedInsertionIdsandsuggestedDeletionIds, plus document-levelsuggestedDocumentStyleChanges/suggestedNamedStylesChangesand per-element style-change maps. Ref: https://developers.google.com/docs/api/reference/rest/v1/documents/get and the view-mode docs at https://developers.google.com/docs/api/reference/rest/v1/documents#Document.SuggestionsViewModegogalready reaches this exact tree viadocs raw; the only missing pieces are (1) setting the view mode on the request and (2) walking the runs to surface the suggested insertions/deletions.Scope: READ-ONLY (known API ceiling)
Accepting or rejecting suggestions is not in the Docs API — there is no
acceptSuggestion/rejectSuggestionrequest; accept/reject is UI-only. This issue is intentionally read-only surfacing. Please do not scope it to mutation.Also note this is distinct from comments and from #672:
docs comments/drive comments— a different object from suggestions.docs raw, but in practice they aren't, because the view mode is never set. This issue closes that actual gap.Proposed surface
A read-only command:
For each pending suggestion, print the suggestion id, kind (insertion / deletion), the affected text, and — where the API exposes it (it surfaces suggestion ids; author attribution is limited) — any available range/context. Honour
-j/--jsonfor the structured form and-p/--plain(TSV) for scripting.Optionally, a lighter alternative for parity with existing read paths:
Either way the load-bearing fix is: issue
Documents.GetwithSuggestionsViewMode=SUGGESTIONS_INLINEand walkbody.content[].paragraph.elements[].textRun.{suggestedInsertionIds,suggestedDeletionIds}.Other Workspace surfaces (scoped out, verified)
Sheets and Slides have no Docs-style suggestions / tracked-changes mode —
gog sheets --helpandgog slides --helpexpose nothing, and the underlying Sheets/Slides APIs have no suggestions view-mode equivalent. So this should stay Docs-only and not over-promise a generic "tracked changes" surface.Version
v0.30.0 (Homebrew 2026-06-22)