Skip to content

sheets insert: add a flag to control number-format inheritance (inheritFromBefore) #655

Description

@chrischall

Version

v0.19.0 (b25a3c0)

Summary

gog sheets insert exposes only --count and --after. Inserted rows/columns
inherit the adjacent dimension's formatting, with no way to opt out. Inserting
plain columns next to a currency-formatted column makes plain 0–100 values first
render as e.g. $79.20 until the format is manually cleared.

Steps to reproduce

  1. A sheet whose last data column (say column AO) uses a currency number format.
  2. Insert new columns immediately after it:
    gog sheets insert <spreadsheetId> Sheet1 cols 42 --count=8
    
  3. Write plain integers (0–100) into the new columns.

Expected

A way to insert without inheriting the neighbour's formatting — ideally a flag
mapping to the Sheets API's InsertDimensionRequest.inheritFromBefore
(false = inherit from the row/column after; for an edge insert this yields
default/plain formatting).

Actual

New dimensions always inherit the preceding neighbour's number format; the only
remedy is a follow-up formatting clear.

Proposed

  • Add --inherit-from-before=<true|false> (or --no-inherit) to sheets insert,
    passed straight through to InsertDimensionRequest.inheritFromBefore.
  • Document the current default behaviour either way.

API reference

InsertDimensionRequest
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#InsertDimensionRequest
(inheritFromBefore boolean).


Filed from usage of the gogcli-mcp wrapper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions