feat(docs): honor --tab when setting page layout#878
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 23, 2026, 11:03 PM ET / 03:03 UTC. Summary Reproducibility: yes. from source inspection: current main builds Docs document-style update requests without Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the focused tab-aware document-style fix after proof is added, preserving default-tab behavior when no tab is provided and leaving final release notes to the release owner. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main builds Docs document-style update requests without Is this the best way to solve the issue? Yes for the code path: threading a resolved tab ID through the existing Docs tab helpers into Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7af5c68d93b3. Label changesLabel justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Co-authored-by: Jonathan Greene <[email protected]>
9cddbf7 to
ffcf631
Compare
|
Landed as 57e3283a. Validation:
Maintainer adjustments: normalized result output to the existing Live-proof caveat: the contributor reports successful secondary-tab Docs API readback. I could not independently repeat the live mutation because the available local test OAuth was revoked and the existing-Chrome bridge was unavailable; the local HTTP boundary test and official Docs API contract provide the independent request-shape proof. |
What
Add
--tabsupport todocs page-layoutso document-layout changes can target a specific tab, and fixdocs write --pagelesssilently no-opping on secondary tabs of multi-tab documents.Why
Document-style fields (
documentMode/pageless, page size, margins) are per-tab in the Docs API.page-layoutandwrite --pagelessbuilt anUpdateDocumentStyleRequestbut never setTabId, so the change always applied to the document's default tab. On a multi-tab document, setting pageless on a non-default tab reported success while nothing actually changed —documentFormat.documentModestayedPAGESon the targeted tab.Changes
docs page-layout: add--tab(title or ID, with the existing deprecated--tab-idalias), resolved to a concrete tab ID viaresolveDocsTabID.docs_layout.go: threadTabIDthroughdocsDocumentStyleOptionsontoUpdateDocumentStyleRequest.TabId.docs write: resolve--tabinapplyDocumentStyleso--pageless/layout flags land on the targeted tab across every write path, including the markdown/Drive-replace path that never resolved the tab.--tabis omitted (emptyTabId→ default tab).Tests
TabIDset → request carries it; omitted → empty, default-tab behaviour preserved).make fmt-check lint deadcode testall pass locally; regenerateddocs/commands/gog-docs-page-layout.mdand updatedCHANGELOG.md.page-layout --layout pageless --tab <id>flipsdocumentFormat.documentModetoPAGELESSon the targeted secondary tab (confirmed by reading that tab back).