Skip to content

docs cat drops person smart chips from all output modes (plain, --plain, --json); readable only via --raw #907

Description

@neo-wanderer

Summary

docs cat (plain, --json, and --plain) silently drops person smart chips from its output. A tagged person in a doc is a person element — a sibling of textRun inside paragraph.elements — and the text extractor only concatenates textRun.content, so the chip contributes nothing to the rendered text. The same applies to date chips and richLink (Drive file / calendar event) chips.

The result is silently misleading output: a table row like Owner: @Jane Doe renders as Owner: with an empty cell, with no indication anything was skipped. --json doesn't help — it returns the same lossy string wrapped in {"tab": {"id", "index", "title", "text"}}. Today the only way to see who is tagged is cat --raw plus a hand-rolled jq walk.

Notably the write side already has first-class chip support (docs insert-person, #638, --at anchors in #683) — so gog can insert a person chip it then cannot read back.

Repro (self-contained, uses gog itself)

DOC=$(gog docs create "chip read test" -j | jq -r .id)
gog docs write "$DOC" --replace "Reviewer: "
gog docs insert-person "$DOC" --email [email protected] --at "Reviewer: "

gog docs cat "$DOC"
# Output: "Reviewer: "            <-- chip dropped, no marker

gog docs cat "$DOC" --json | jq -r .tab.text
# Same lossy text; no person data anywhere in the JSON

gog docs cat "$DOC" --raw | jq '[.. | objects | select(has("person")) | .person.personProperties]'
# [{"name": "Sample Person", "email": "[email protected]"}]  <-- data exists

Observed on v0.33.0 (also v0.22.0).

Expected

Two parts, either would help; both would be ideal:

  1. cat text rendering: render chips inline instead of skipping them, e.g.

    • person → @Jane Doe <[email protected]>
    • date → the chip's display text
    • richLink → [Title](url)

    (Possibly behind a --chips flag if changing the default output is a concern, though rendering something seems strictly better than an invisible drop.)

  2. cat --json structured output: include the chips as data, e.g. a persons / chips array per tab alongside text, so scripting consumers don't need to fall back to --raw + a recursive jq descent (which on multi-tab docs also means downloading the entire doc, since --raw returns all tabs).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper 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:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:data-lossThis issue is about lost, corrupted, or silently dropped user/session/config data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions