Skip to content

feat(sheets): add gridline show/hide shortcuts#1264

Merged
zhengzhijiej-tech merged 1 commit into
larksuite:feat/lark-sheets-developfrom
zhengzhijiej-tech:feat/sheet-gridline
Jun 4, 2026
Merged

feat(sheets): add gridline show/hide shortcuts#1264
zhengzhijiej-tech merged 1 commit into
larksuite:feat/lark-sheets-developfrom
zhengzhijiej-tech:feat/sheet-gridline

Conversation

@zhengzhijiej-tech

@zhengzhijiej-tech zhengzhijiej-tech commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

What

Add two worksheet-level shortcuts to toggle gridline visibility:

  • +sheet-show-gridline
  • +sheet-hide-gridline

Both target the modify_workbook_structure tool via the show_gridline / hide_gridline operations. This mirrors the existing +sheet-hide / +sheet-unhide two-state pattern — the show/hide intent lives in the operation enum, so no --visible flag is needed.

Changes

  • shortcuts/sheets/lark_sheet_workbook.go: sheetGridlineInput + newSheetGridlineShortcut factory + the two shortcuts
  • shortcuts/sheets/shortcuts.go: registration
  • shortcuts/sheets/batch_op_dispatch.go: two +batch-update sub-op mappings (reusing sheetGridlineInput)
  • shortcuts/sheets/data/flag-defs.json + flag_defs_gen.go: flag definitions (four locator flags each, no own flag — same set as +sheet-hide)

Testing

  • go test ./shortcuts/sheets/... passes; the data-driven batch contract tests (TestBatchOp_*) automatically cover the new shortcuts.
  • Dry-run confirms the emitted body: modify_workbook_structure with operation: show_gridline / hide_gridline and the sheet selector.

Server-side tool support is delivered separately; the flag-defs / reference docs are normally synced from the spec source.

Summary by CodeRabbit

  • New Features

    • Added two sheet shortcuts to toggle gridline visibility: show and hide; accepts spreadsheet locators (URL or token) and sheet identifiers (ID or name).
    • Supports a dry-run mode to preview changes before applying.
  • Documentation

    • Updated docs with flag descriptions and examples for both gridline commands.
  • Tests

    • Added unit tests and dry-run contract checks covering both new shortcuts.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5a68c001-bea8-45cd-a38f-cb301956569c

📥 Commits

Reviewing files that changed from the base of the PR and between 4a5b80e and 6e067f2.

📒 Files selected for processing (8)
  • shortcuts/sheets/batch_op_contract_test.go
  • shortcuts/sheets/batch_op_dispatch.go
  • shortcuts/sheets/data/flag-defs.json
  • shortcuts/sheets/flag_defs_gen.go
  • shortcuts/sheets/lark_sheet_workbook.go
  • shortcuts/sheets/lark_sheet_workbook_test.go
  • shortcuts/sheets/shortcuts.go
  • skills/lark-sheets/references/lark-sheets-workbook.md
✅ Files skipped from review due to trivial changes (3)
  • shortcuts/sheets/batch_op_contract_test.go
  • skills/lark-sheets/references/lark-sheets-workbook.md
  • shortcuts/sheets/flag_defs_gen.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • shortcuts/sheets/batch_op_dispatch.go
  • shortcuts/sheets/shortcuts.go
  • shortcuts/sheets/data/flag-defs.json

📝 Walkthrough

Walkthrough

Adds two sheet-level CLI shortcuts, +sheet-show-gridline and +sheet-hide-gridline, which accept spreadsheet and sheet locators, build show/hide gridline payloads, and invoke the existing modify_workbook_structure tool. Includes flag definitions, implementation, batch dispatch wiring, tests, registration, and docs.

Changes

Sheet Gridline Toggle Shortcuts

Layer / File(s) Summary
CLI flag schemas and contracts
shortcuts/sheets/data/flag-defs.json, shortcuts/sheets/flag_defs_gen.go
New +sheet-show-gridline and +sheet-hide-gridline shortcuts are defined with write risk, standard spreadsheet locator flags (--url XOR --spreadsheet-token), sheet locator flags (--sheet-id XOR --sheet-name), and optional --dry-run. Generated flag definitions mirror these contracts.
Shortcut implementation
shortcuts/sheets/lark_sheet_workbook.go
Adds exported SheetShowGridline and SheetHideGridline shortcuts configured via newSheetVisibilityShortcut with show_gridline / hide_gridline operation discriminators.
Batch dispatch and registration
shortcuts/sheets/batch_op_dispatch.go, shortcuts/sheets/shortcuts.go
Wires the new shortcuts into batchOpDispatch for +batch-update and registers them in shortcutList() for CLI discovery and execution.
Tests
shortcuts/sheets/batch_op_contract_test.go, shortcuts/sheets/lark_sheet_workbook_test.go
Adds dry-run and batch-op contract tests asserting the shortcuts dispatch to modify_workbook_structure with the correct operation and sheet/excel identifiers.
Docs and examples
skills/lark-sheets/references/lark-sheets-workbook.md
Reference docs updated with entries, flag descriptions, and example usage for +sheet-show-gridline and +sheet-hide-gridline.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

size/M

Suggested reviewers

  • fangshuyu-768

Poem

🐰 I hop across spreadsheets, nimble and spry,
Toggling gridlines with a cheerful sigh,
Show one moment, hide the next,
Neat rows return, no more text hex,
A rabbit's wink—your sheet looks spry.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(sheets): add gridline show/hide shortcuts' clearly and concisely describes the main change: adding two new sheet-level shortcuts for toggling gridline visibility.
Description check ✅ Passed The PR description provides a clear summary, detailed changes across all modified files, and comprehensive testing information that matches the required template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added domain/ccm PR touches the ccm domain size/M Single-domain feat or fix with limited business impact labels Jun 4, 2026
@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.64%. Comparing base (7a0dbe0) to head (6e067f2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1264   +/-   ##
=======================================
  Coverage   69.64%   69.64%           
=======================================
  Files         666      666           
  Lines       64413    64421    +8     
=======================================
+ Hits        44861    44869    +8     
  Misses      15943    15943           
  Partials     3609     3609           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@6e067f2180dd506de70e333a6f0625b055b6c51a

🧩 Skill update

npx skills add zhengzhijiej-tech/cli#feat/sheet-gridline -y -g

@github-actions github-actions Bot added size/L Large or sensitive change across domains or core paths and removed size/M Single-domain feat or fix with limited business impact labels Jun 4, 2026
@zhengzhijiej-tech
zhengzhijiej-tech changed the base branch from main to feat/lark-sheets-develop June 4, 2026 09:14
@zhengzhijiej-tech
zhengzhijiej-tech merged commit 0ff7f04 into larksuite:feat/lark-sheets-develop Jun 4, 2026
20 checks passed
xiongyuanwen-byted pushed a commit that referenced this pull request Jun 22, 2026
feat(sheets): add gridline show/hide shortcuts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants