Skip to content

feat(sheets): add value format documentation for formula and special types - #456

Merged
fangshuyu-768 merged 1 commit into
mainfrom
feat/value_format
Apr 13, 2026
Merged

feat(sheets): add value format documentation for formula and special types #456
fangshuyu-768 merged 1 commit into
mainfrom
feat/value_format

Conversation

@caojie0621

@caojie0621 caojie0621 commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

The --values parameter in sheets shortcuts (+write, +append, +create)
requires an object format for formulas and special types, but this was not
documented. This PR adds a cell data type reference table and usage examples
to both SKILL.md and the skill template.

Changes

  • Add cell data type table covering string, number, date, URL, email, formula,
    mention, and dropdown list formats
  • Add correct vs incorrect formula writing examples
  • Document limitations (no IMPORTRANGE, @mention caps, dropdown constraints)
  • Update both skills/lark-sheets/SKILL.md and skill-template/domains/sheets.md

Test Plan

  • Manually verified all documented data types write correctly via
    lark-cli sheets +write (string, number, formula, URL with text, plain URL, email)
  • Verified formula computation with +read --value-render-option FormattedValue
  • Verified +append with mixed types (string + number + formula + URL)
  • Verified +replace find-and-replace works on written data
  • Verified +export for both xlsx and csv formats

Related Issues

N/A

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guide on supported cell data types for sheet write/create operations, including strings, numbers, dates, URLs, formulas, mentions, and dropdowns
    • Clarified which types must be provided as structured objects versus plain strings, with correct vs incorrect examples
    • Documented operational constraints: no cross-sheet IMPORTRANGE formulas, @mention tenant limit (50 per call), and dropdowns require prior setup and disallow commas in option strings

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Apr 13, 2026
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added documentation to two files describing supported cell data types for sheet write operations, type-to-format mappings, object-vs-string formatting rules for rich cell kinds, usage examples, and operational constraints (formula, mentions, dropdown limits).

Changes

Cohort / File(s) Summary
Cell data types & write semantics
skill-template/domains/sheets.md, skills/lark-sheets/SKILL.md
Added a "单元格数据类型" section documenting 2D-array --values/--data formats, type→write-format mappings (string, number, date, URL, email, formula, mentions, dropdown/multiValue), rules requiring object form for formulas/URL-with-text/@mentions/dropdown, a correct-vs-incorrect formula example, and constraints (no IMPORTRANGE cross-sheet formulas, @mention tenant cap ~50 per op, dropdowns must be preconfigured and no commas in options).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

domain/ccm

Suggested reviewers

  • fangshuyu-768

Poem

🐰 I hopped through docs with nibbling glee,
Cells and formulas lined up for me.
Mentions, dates, and dropdown tunes—
I scribble types beneath the moon,
Hooray for clear sheets, hop-hop, whee!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding documentation for value formats (formulas and special types) in the sheets skill.
Description check ✅ Passed The description follows the template structure with Summary, Changes, Test Plan, and Related Issues sections all completed with substantive details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/value_format

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skill-template/domains/sheets.md (1)

144-144: Consider clarifying the pipe character representation.

In the @人 row's "写入格式" column, the format shows email\|openId\|unionId with backslash escaping. While this is technically correct Markdown (pipes in table cells must be escaped), it may confuse users who might think the backslash is part of the actual JSON value for textType.

Consider using an alternative representation to improve clarity, such as:

  • Using <code> tags with HTML entity &#124;
  • Noting in parentheses that | means "or"
  • Listing the three options on separate lines
Alternative representation for clarity
-| `@人` | `{"type":"mention","text":"标识","textType":"email\|openId\|unionId","notify":true}` | `{"type":"mention","text":"user@example.com","textType":"email","notify":true}` |
+| `@人` | `{"type":"mention","text":"标识","textType":"email 或 openId 或 unionId","notify":true}` | `{"type":"mention","text":"user@example.com","textType":"email","notify":true}` |

Or add a note after the table explaining that \| in the format column means "or" (one of the listed values).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skill-template/domains/sheets.md` at line 144, The table row for "@人"
currently shows the "写入格式" value as `email\|openId\|unionId`, which may confuse
readers into thinking the backslash is part of the JSON value; update the cell
so the three options are clearly shown (e.g., use HTML entity for pipe like
`email&#124;openId&#124;unionId`, or list each option on separate lines, or
append "(| means OR)" in parentheses) and ensure the example JSON
`{"type":"mention","text":"标识","textType":"email|openId|unionId","notify":true}`
is shown without backslashes so it's clear the actual `textType` value uses
plain `|`; target the "@人" table row and the "写入格式" cell when making this
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skill-template/domains/sheets.md`:
- Line 144: The table row for "@人" currently shows the "写入格式" value as
`email\|openId\|unionId`, which may confuse readers into thinking the backslash
is part of the JSON value; update the cell so the three options are clearly
shown (e.g., use HTML entity for pipe like `email&#124;openId&#124;unionId`, or
list each option on separate lines, or append "(| means OR)" in parentheses) and
ensure the example JSON
`{"type":"mention","text":"标识","textType":"email|openId|unionId","notify":true}`
is shown without backslashes so it's clear the actual `textType` value uses
plain `|`; target the "@人" table row and the "写入格式" cell when making this
change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0651d589-3c42-4568-94fb-7c74328d74e1

📥 Commits

Reviewing files that changed from the base of the PR and between 06e7ae2 and 83b6bf2.

📒 Files selected for processing (2)
  • skill-template/domains/sheets.md
  • skills/lark-sheets/SKILL.md

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@319b51b1f3e76e69f223a2d68e6e5d7a2b2c0fb3

🧩 Skill update

npx skills add larksuite/cli#feat/value_format -y -g

@greptile-apps

greptile-apps Bot commented Apr 13, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a ### 单元格数据类型 section to both skills/lark-sheets/SKILL.md and skill-template/domains/sheets.md, documenting the object vs. plain-string write formats for formulas, URLs, mentions, and dropdowns, along with correct/incorrect formula examples and operational limits. Previous concerns (attributing --values to +create, hard-coding notify:true) have been resolved in this version.

Confidence Score: 5/5

Safe to merge — documentation-only change with accurate content and prior P1 concerns resolved.

All remaining findings are P2 style suggestions. The two previously flagged P1 issues (+create --values mis-attribution and notify:true default) are correctly addressed in this version. The table content and examples have been manually verified per the PR description.

No files require special attention.

Important Files Changed

Filename Overview
skills/lark-sheets/SKILL.md Adds ### 单元格数据类型 section with a complete type table, formula examples, and limitation notes; +create correctly attributed to --data, notify defaults to false — one minor P2 clarity issue with pipe-OR notation inside a JSON string value.
skill-template/domains/sheets.md Mirrors the same ### 单元格数据类型 section added to SKILL.md; content is identical and carries the same minor P2 textType notation ambiguity.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Write cell value] --> B{Value type?}
    B -->|Plain text / email / bare URL| C[Pass as plain string]
    B -->|Number / Date serial| D[Pass as number]
    B -->|Formula| E[Object: type=formula]
    B -->|URL with display text| F[Object: type=url]
    B -->|Mention user| G[Object: type=mention + textType]
    B -->|Mention document| H[Object: type=mention + textType=fileToken]
    B -->|Dropdown| I[Object: type=multipleValue]
    C --> J[API write call]
    D --> J
    E --> J
    F --> J
    G --> J
    H --> J
    I --> J
Loading

Reviews (2): Last reviewed commit: "feat(sheets): add value format documenta..." | Re-trigger Greptile

Comment thread skills/lark-sheets/SKILL.md Outdated
Comment thread skill-template/domains/sheets.md Outdated
Comment thread skills/lark-sheets/SKILL.md Outdated
fangshuyu-768
fangshuyu-768 previously approved these changes Apr 13, 2026
…types

Document the correct object format for writing formulas, URLs with
text, mentions, and dropdown lists via --values parameter. Add
examples contrasting correct object format vs incorrect plain string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
skill-template/domains/sheets.md (1)

144-144: Clarify textType as enum choices, not a literal value.

Line 144 currently shows textType:"email\|openId\|unionId" inside JSON, which is easy to copy as a single invalid literal. Prefer documenting it as “one of email / openId / unionId” outside the JSON example.

Suggested doc tweak
-| `@人` | `{"type":"mention","text":"标识","textType":"email\|openId\|unionId","notify":false}` | `{"type":"mention","text":"user@example.com","textType":"email","notify":false}`(notify 可选,默认 false;仅在用户明确要求通知时设为 true) |
+| `@人` | `{"type":"mention","text":"标识","textType":"email","notify":false}` | `{"type":"mention","text":"user@example.com","textType":"email","notify":false}`(`textType` 取值为 `email` / `openId` / `unionId`;`notify` 可选,默认 false;仅在用户明确要求通知时设为 true) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skill-template/domains/sheets.md` at line 144, The JSON example for the `@人`
mention uses textType:"email\|openId\|unionId" which can be mis-copied as a
single invalid literal; update the documentation so the JSON example shows a
single valid value (e.g., "textType":"email") and move the allowed choices
description outboard as “textType — one of email / openId / unionId”
(referencing the `@人` mention example and the textType field) so readers see a
concrete example plus the enum choices separately.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@skill-template/domains/sheets.md`:
- Line 144: The JSON example for the `@人` mention uses
textType:"email\|openId\|unionId" which can be mis-copied as a single invalid
literal; update the documentation so the JSON example shows a single valid value
(e.g., "textType":"email") and move the allowed choices description outboard as
“textType — one of email / openId / unionId” (referencing the `@人` mention example
and the textType field) so readers see a concrete example plus the enum choices
separately.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f5e353d4-fc0b-4c14-92e0-039fc061932b

📥 Commits

Reviewing files that changed from the base of the PR and between 83b6bf2 and 319b51b.

📒 Files selected for processing (2)
  • skill-template/domains/sheets.md
  • skills/lark-sheets/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-sheets/SKILL.md

@fangshuyu-768
fangshuyu-768 merged commit 2910cde into main Apr 13, 2026
12 checks passed
@fangshuyu-768
fangshuyu-768 deleted the feat/value_format branch April 13, 2026 16:07
yxzhaao pushed a commit to yxzhaao/cli that referenced this pull request Apr 14, 2026
…types (larksuite#456)

Document the correct object format for writing formulas, URLs with
text, mentions, and dropdown lists via --values parameter. Add
examples contrasting correct object format vs incorrect plain string.
tuxedomm pushed a commit to zhumiaoxin/cli that referenced this pull request Jun 6, 2026
…types (larksuite#456)

Document the correct object format for writing formulas, URLs with
text, mentions, and dropdown lists via --values parameter. Add
examples contrasting correct object format vs incorrect plain string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants