Skip to content

fix(base): pass through table-list response and sort help#393

Merged
kongenpei merged 1 commit intolarksuite:mainfrom
kongenpei:fix-table-shortcut
Apr 10, 2026
Merged

fix(base): pass through table-list response and sort help#393
kongenpei merged 1 commit intolarksuite:mainfrom
kongenpei:fix-table-shortcut

Conversation

@kongenpei
Copy link
Copy Markdown
Collaborator

@kongenpei kongenpei commented Apr 10, 2026

Summary

+table-list was reshaping API output into synthetic fields instead of passing through the raw table payload. +view-set-sort help also still suggested the raw array form, so this change keeps the response raw and clarifies the CLI help toward sort_config usage.

Changes

  • Return raw tables data from base +table-list without adding items, offset, limit, or count
  • Update base +view-set-sort Go help/example to show sort_config object usage
  • Adjust base shortcut tests to cover the raw list output

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark xxx command works as expected
  • make unit-test
  • go mod tidy (no changes to go.mod / go.sum)
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main failed locally due Go VCS stamping in this worktree (error obtaining VCS status)
  • GOFLAGS=-buildvcs=false go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main

Related Issues

  • None

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Simplified table list API response structure to return cleaner output with essential fields only.
  • Documentation

    • Corrected the sort command JSON format documentation to accurately reflect the expected input structure.
  • Tests

    • Updated test assertions to validate the correct table list response format.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

📝 Walkthrough

Walkthrough

The pull request simplifies the Base table list API response format from a paginated structure with items, offset, limit, and count fields to a streamlined format containing only tables and total. Corresponding test assertions and documentation examples are updated to reflect this change.

Changes

Cohort / File(s) Summary
Table List Response Format
shortcuts/base/table_ops.go, shortcuts/base/base_execute_test.go
Modified executeTableList to return {"tables": tables, "total": total} instead of {"items": items, "offset": offset, "limit": limit, "count": count, "total": total}. Updated test assertions to verify the new response shape and absence of pagination-related fields.
View Set Sort Documentation
shortcuts/base/view_set_sort.go
Updated --json flag description from "sort JSON object/array" to "sort_config JSON object" and changed example from bare array ([...]) to object with sort_config field ({"sort_config":[...]}). Functional behavior remains unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • zgz2048

Poem

🐰 Tables now speak clear and clean,
No pagination fluff between,
Just tables and totals, a simpler way,
The docs now match what the API will say!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: fixing the table-list response passthrough and updating sort help documentation.
Description check ✅ Passed The pull request description covers all required template sections: Summary explains the motivation clearly, Changes lists specific modifications, Test Plan documents verification steps with command details, and Related Issues is addressed.

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

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

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

@github-actions github-actions Bot added domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact labels Apr 10, 2026
@kongenpei kongenpei marked this pull request as ready for review April 10, 2026 08:11
@kongenpei kongenpei changed the title fix(base): return raw table list response and clarify sort help fix(base): pass through table-list response and sort help Apr 10, 2026
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@kongenpei kongenpei requested a review from zgz2048 April 10, 2026 08:13
@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add kongenpei/lark-cli#fix-table-shortcut -y -g

@kongenpei kongenpei merged commit 353c473 into larksuite:main Apr 10, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain 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