feat(sheets): add reorder-tab command#616
Open
chrischall wants to merge 2 commits into
Open
Conversation
Closes openclaw#603. Surfaces spreadsheets.batchUpdate -> updateSheetProperties with field mask `index` as a standalone CLI subcommand. add-tab, rename-tab, and delete-tab were already exposed; reordering was the missing primitive. Usage: gog sheets reorder-tab <spreadsheetId> --tab=<name|sheetId> --to=N Notes: - --tab accepts a literal tab title OR a numeric sheet ID; numeric IDs are resolved without a name lookup so the command works on tabs that share titles or have empty titles. - --to is the destination 0-based tab index; --to=0 is the leftmost position and is force-sent over the wire (Index would otherwise be elided as Go's zero value, leaving the API call a no-op). - Aliases: move-tab, reorder-sheet, move-sheet. Tests cover: name → sheetId resolution, numeric sheetId pass-through, --to=0 reaching the wire as "index":0 (raw JSON inspection), unknown- tab error, and the --to=-1 guard. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #603.
Summary
Surfaces `spreadsheets.batchUpdate` → `updateSheetProperties` with field mask `index` as a standalone CLI subcommand. `add-tab`, `rename-tab`, and `delete-tab` were already exposed; reordering was the missing primitive (today the only workarounds are recreating tabs or hoping for alphabetical order via renames).
Usage
```
gog sheets reorder-tab --tab=<name|sheetId> --to=N
```
Aliases: `move-tab`, `reorder-sheet`, `move-sheet`.
Tests
`go test ./internal/cmd/ -count=1` → ok 23.6s.