Skip to content

fix(whiteboard): register +media-upload shortcut and add whiteboard parent type#571

Merged
zl-bytedance merged 1 commit intolarksuite:mainfrom
zl-bytedance:fix/whiteboard-media-upload-shortcut
Apr 21, 2026
Merged

fix(whiteboard): register +media-upload shortcut and add whiteboard parent type#571
zl-bytedance merged 1 commit intolarksuite:mainfrom
zl-bytedance:fix/whiteboard-media-upload-shortcut

Conversation

@zl-bytedance
Copy link
Copy Markdown
Collaborator

@zl-bytedance zl-bytedance commented Apr 20, 2026

…arent type

  • Register DocMediaUpload in doc/shortcuts.go (was defined but never registered, so lark-cli docs +media-upload was unavailable)
  • Rename MediaUpload to DocMediaUpload for consistency with DocMediaInsert/DocMediaPreview/DocMediaDownload
  • Add whiteboard to --parent-type flag description
  • Update --parent-node description to mention board_token for whiteboard

Drive +upload (parent_type=explorer) produces file tokens that the whiteboard API does not recognize (500 error). The correct approach is docs +media-upload with parent_type=whiteboard.

Summary

Changes

  • Change 1
  • Change 2

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark xxx command works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Document media uploads now support whiteboard as an additional parent type alongside existing docx image and docx file targets.
  • Documentation

    • Clarified flag descriptions to explain which identifier to provide for each parent type (e.g., block ID for docx parents, board token for whiteboard).
    • Improved overall parent-type and parent-node guidance.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 20, 2026

CLA assistant check
All committers have signed the CLA.

@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 Apr 20, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86874396-8e64-4370-aea9-e73fa0d932f3

📥 Commits

Reviewing files that changed from the base of the PR and between f6beef0 and b18cd04.

📒 Files selected for processing (3)
  • shortcuts/doc/doc_media_test.go
  • shortcuts/doc/doc_media_upload.go
  • shortcuts/doc/shortcuts.go
✅ Files skipped from review due to trivial changes (1)
  • shortcuts/doc/shortcuts.go

📝 Walkthrough

Walkthrough

Renamed exported shortcut MediaUploadDocMediaUpload, updated its flag descriptions to include whiteboard as a parent type and clarify expected parent-node values, and registered the renamed shortcut in the doc shortcuts list. Tests updated to reference the new name.

Changes

Cohort / File(s) Summary
Shortcut implementation & docs
shortcuts/doc/doc_media_upload.go
Renamed exported variable MediaUploadDocMediaUpload; updated parent-type and parent-node flag descriptions to document whiteboard support and clarify node identifier semantics.
Shortcut registration
shortcuts/doc/shortcuts.go
Added DocMediaUpload to the Shortcuts() return slice to register the renamed shortcut.
Tests
shortcuts/doc/doc_media_test.go
Updated test call sites to use DocMediaUpload.DryRun(...) instead of MediaUpload.DryRun(...); test assertions unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

size/L

Suggested reviewers

  • liujinkun2025
  • fangshuyu-768

Poem

🐰 A tiny rename, a hop, a tweak,
DocMediaUpload now plays hide-and-seek,
Whiteboards welcomed, flags clear and neat,
I nibble carrots and ship the feat! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly addresses the main changes: registering the media-upload shortcut and adding whiteboard parent type support.
Description check ✅ Passed The description provides clear motivation, specific changes made, and follows most of the template structure. Test plan checkboxes are present, indicating planned verification.

✏️ 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shortcuts/doc/doc_media_upload.go`:
- Line 16: The test still references the old symbol MediaUpload which was
renamed to DocMediaUpload causing a compile error; update the test to replace
references to MediaUpload with DocMediaUpload (e.g., in
shortcuts/doc/doc_media_test.go where MediaUpload is used) so it imports/uses
the correct shortcut symbol and rebuilds successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79ef2e39-b224-4053-96ea-cc28e261657b

📥 Commits

Reviewing files that changed from the base of the PR and between 9acd121 and f6beef0.

📒 Files selected for processing (2)
  • shortcuts/doc/doc_media_upload.go
  • shortcuts/doc/shortcuts.go

Comment thread shortcuts/doc/doc_media_upload.go
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 20, 2026

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add zl-bytedance/cli#fix/whiteboard-media-upload-shortcut -y -g

…arent type

- Register DocMediaUpload in doc/shortcuts.go (was defined but never
  registered, so lark-cli docs +media-upload was unavailable)
- Rename MediaUpload to DocMediaUpload for consistency with
  DocMediaInsert/DocMediaPreview/DocMediaDownload
- Add whiteboard to --parent-type flag description
- Update --parent-node description to mention board_token for whiteboard

Drive +upload (parent_type=explorer) produces file tokens that the
whiteboard API does not recognize (500 error). The correct approach
is docs +media-upload with parent_type=whiteboard.
@zl-bytedance zl-bytedance force-pushed the fix/whiteboard-media-upload-shortcut branch from f6beef0 to b18cd04 Compare April 20, 2026 10:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 60.19%. Comparing base (5a0e1d3) to head (b18cd04).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/doc/shortcuts.go 0.00% 1 Missing ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   59.91%   60.19%   +0.28%     
==========================================
  Files         388      390       +2     
  Lines       33147    33434     +287     
==========================================
+ Hits        19859    20125     +266     
- Misses      11420    11427       +7     
- Partials     1868     1882      +14     

☔ View full report in Codecov by Sentry.
📢 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.

@zl-bytedance zl-bytedance merged commit 24e0bb3 into larksuite:main Apr 21, 2026
17 of 18 checks passed
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/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants