Skip to content

feat(doc-skill): document upload-then-move workflow for inserting images into container blocks#970

Closed
fangshuyu-768 wants to merge 1 commit into
mainfrom
feat/media-insert-container-block-v2
Closed

feat(doc-skill): document upload-then-move workflow for inserting images into container blocks#970
fangshuyu-768 wants to merge 1 commit into
mainfrom
feat/media-insert-container-block-v2

Conversation

@fangshuyu-768

@fangshuyu-768 fangshuyu-768 commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

docs +media-insert currently only inserts images at the document top level (end of document or near a top-level block matched by --selection-with-ellipsis). It cannot place images inside container blocks like table cells, callouts, or grid columns. This PR documents the "upload then move" two-step workflow that enables inserting local images into container blocks using block_move_after, which supports cross-parent moves.

Changes

  • skills/lark-doc/references/lark-doc-media-insert.md: Updated title and description to reflect broader capability; added new "插入图片到容器 block" section documenting the upload-then-move workflow with step-by-step instructions, examples (table cell, callout, grid column), and caveats
  • skills/lark-doc/SKILL.md: Updated +media-insert shortcut description to mention the upload-then-move workflow for container blocks

Test Plan

  • Manual verification: created a test document with a table, inserted an image via +media-insert, then used block_move_after to move it into a <td> — confirmed the image appeared inside the table cell
  • Verified that block_move_after supports cross-parent moves (from document root into container block)
  • Skill documentation review: confirmed both files are consistent and accurate

Related Issues

Summary by CodeRabbit

  • Documentation
    • Clarified default media insertion behavior and added workflow for inserting media into container blocks (table cells, callouts, grid columns).
    • Added two-step insertion guide: upload media, then move using a separate operation.
    • Expanded reference documentation with examples and troubleshooting notes for container insertion.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 19, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR documents how to insert images into container blocks using a two-step workflow: first uploading the image via +media-insert to capture its block ID, then moving it into the target container using docs +update block_move_after. The changes update the introduction, add a detailed procedures section with examples, and clarify the shortcuts reference.

Changes

Container Block Media Insertion Workflow

Layer / File(s) Summary
Container block insertion workflow documentation
skills/lark-doc/references/lark-doc-media-insert.md
Intro reframed to describe default insertion at top-level (near selection) rather than strictly document end, with pointer to separate container workflow. New "插入图片到容器 block" section documents the two-step +media-insert (upload) then docs +update block_move_after (move) procedure, including container anchor block_id fetching via docs +fetch --detail with-ids, complete table-cell example, non-atomic behavior notes, and preservation of size/alignment/caption properties.
Shortcuts reference update
skills/lark-doc/SKILL.md
+media-insert shortcuts entry expanded to clarify end-append default and document container-block workflow using block_move_after.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • liujinkun2025
  • zkh-bytedance

Poem

🐰 A rabbit hops through docs with care,
Two-step moves through container air,
Upload, then shift—the images dance,
Into tables, callouts—give them a chance!
Block IDs captured, blocks gracefully placed,
Container flows now documented with grace. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: documenting the upload-then-move workflow for inserting images into container blocks, which aligns with the primary purpose of this PR.
Description check ✅ Passed The description follows the required template with all key sections completed: Summary explains the problem, Changes lists specific file modifications, Test Plan documents manual verification steps, and Related Issues references the closed issue.
Linked Issues check ✅ Passed The PR addresses issue #503 by documenting how to insert images into container blocks (table cells, callouts, grid columns) using the upload-then-move workflow with block_move_after, fulfilling the requirement to control image placement.
Out of Scope Changes check ✅ Passed All changes are scoped to documenting the image insertion workflow for container blocks; no unrelated modifications to code or documentation are present.
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/media-insert-container-block-v2

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 May 19, 2026

@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)
skills/lark-doc/references/lark-doc-media-insert.md (1)

117-120: 💤 Low value

Add language specifier to fenced code block.

The code block lacks a language specifier, which triggers a markdownlint warning. Since this represents a workflow pseudocode, consider using text or bash as the language identifier.

🔧 Proposed fix
-```
+```text
 Step 1: +media-insert 上传图片到文档末尾 → 得到 img block_id
 Step 2: +update block_move_after 将图片移入目标容器

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @skills/lark-doc/references/lark-doc-media-insert.md around lines 117 - 120,
The fenced code block that shows the two-step workflow (the block containing
"Step 1: +media-insert 上传图片到文档末尾 → 得到 img block_id" and "Step 2: +update
block_move_after 将图片移入目标容器") is missing a language specifier and triggers
markdownlint; update that fence to include a language identifier such as text
(e.g., ```text) or bash to silence the linter and preserve formatting so the
snippet is parsed as a code block.


</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>🤖 Prompt for all review comments with AI agents</summary>

Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @skills/lark-doc/references/lark-doc-media-insert.md:

  • Around line 117-120: The fenced code block that shows the two-step workflow
    (the block containing "Step 1: +media-insert 上传图片到文档末尾 → 得到 img block_id" and
    "Step 2: +update block_move_after 将图片移入目标容器") is missing a language specifier
    and triggers markdownlint; update that fence to include a language identifier
    such as text (e.g., ```text) or bash to silence the linter and preserve
    formatting so the snippet is parsed as a code block.

</details>

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

**Run ID**: `61dac60d-de75-40df-ac48-a0cbb59b022e`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between a4c5ec99c8a0f4d218f9314e382532313c612b3c and 3666bfb59c2a7fe384ff4144aadf8e5fcf5ee900.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `skills/lark-doc/SKILL.md`
* `skills/lark-doc/references/lark-doc-media-insert.md`
* `skills/lark-doc/references/lark-doc-xml.md`

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.39%. Comparing base (a4c5ec9) to head (a41ffdc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #970   +/-   ##
=======================================
  Coverage   67.39%   67.39%           
=======================================
  Files         572      572           
  Lines       53659    53659           
=======================================
  Hits        36165    36165           
  Misses      14486    14486           
  Partials     3008     3008           

☔ 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.

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/media-insert-container-block-v2 -y -g

…ges into container blocks

The +media-insert command only inserts images at the document top level.
This PR documents the two-step "upload then move" workflow that enables
inserting local images into container blocks (table cells, callouts,
grid columns) using block_move_after, which supports cross-parent moves.

Closes #503
@fangshuyu-768
fangshuyu-768 force-pushed the feat/media-insert-container-block-v2 branch from e8e2cde to a41ffdc Compare May 19, 2026 10:48

@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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
skills/lark-doc/references/lark-doc-media-insert.md (1)

117-120: ⚡ Quick win

为 fenced code block 增加语言标识。

该代码块缺少语言标识(markdownlint MD040);可改成 text(或 bash,如果你想当命令示意)。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-doc/references/lark-doc-media-insert.md` around lines 117 - 120,
The fenced code block containing the two-step example ("Step 1: +media-insert
上传图片到文档末尾 → 得到 img block_id" and "Step 2: +update block_move_after 将图片移入目标容器")
is missing a language identifier; update that opening backtick fence to include
a language tag (e.g., change ``` to ```text or ```bash) so markdownlint MD040 is
satisfied and the block is properly marked.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/lark-doc/references/lark-doc-media-insert.md`:
- Line 6: The documentation contains conflicting default-insertion descriptions:
one sentence says "默认追加到文档末尾" while another says "默认是文档顶层(可能在
`--selection-with-ellipsis` 附近)"; locate the three occurrences (the opening
summary sentence that starts with 把"创建空 block → 上传文件 → 设置 token"..., the Step 1
description mentioning insertion location, and the later note that references
`--selection-with-ellipsis`) and make them consistent by choosing one canonical
wording (e.g., "默认插入到文档顶层;默认位置可能在 `--selection-with-ellipsis` 附近,如需追加到末尾请说明")
and update all three places to that exact phrasing so users get the same
default-insertion behavior across the doc.

---

Nitpick comments:
In `@skills/lark-doc/references/lark-doc-media-insert.md`:
- Around line 117-120: The fenced code block containing the two-step example
("Step 1: +media-insert 上传图片到文档末尾 → 得到 img block_id" and "Step 2: +update
block_move_after 将图片移入目标容器") is missing a language identifier; update that
opening backtick fence to include a language tag (e.g., change ``` to ```text or
```bash) so markdownlint MD040 is satisfied and the block is properly marked.
🪄 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: 73cd3302-8c6a-4f08-a207-d8274e33085c

📥 Commits

Reviewing files that changed from the base of the PR and between 3666bfb and a41ffdc.

📒 Files selected for processing (2)
  • skills/lark-doc/SKILL.md
  • skills/lark-doc/references/lark-doc-media-insert.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-doc/SKILL.md

> **前置条件:** 先阅读 [`../lark-shared/SKILL.md`](../../lark-shared/SKILL.md) 了解认证、全局参数和安全规则。

把"创建空 block → 上传文件 → 设置 token"三步合并成一个命令,在**文档末尾**插入本地图片或文件
把"创建空 block → 上传文件 → 设置 token"三步合并成一个命令,在文档中插入本地图片或文件。默认追加到文档末尾;如需插入到表格单元格、callout 等容器 block 内部,使用[上传后移动](#插入图片到容器-block)工作流

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

统一默认插入位置描述,避免前后冲突。

Line 6/Line 118 写的是“默认到文档末尾”,但 Line 113 已说明默认是文档顶层(可能在 --selection-with-ellipsis 附近)。建议三处统一成同一口径,否则用户会误判 Step 1 的实际落点。

Also applies to: 113-113, 118-118

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/lark-doc/references/lark-doc-media-insert.md` at line 6, The
documentation contains conflicting default-insertion descriptions: one sentence
says "默认追加到文档末尾" while another says "默认是文档顶层(可能在 `--selection-with-ellipsis`
附近)"; locate the three occurrences (the opening summary sentence that starts
with 把"创建空 block → 上传文件 → 设置 token"..., the Step 1 description mentioning
insertion location, and the later note that references
`--selection-with-ellipsis`) and make them consistent by choosing one canonical
wording (e.g., "默认插入到文档顶层;默认位置可能在 `--selection-with-ellipsis` 附近,如需追加到末尾请说明")
and update all three places to that exact phrasing so users get the same
default-insertion behavior across the doc.

@liangshuo-1
liangshuo-1 deleted the feat/media-insert-container-block-v2 branch June 3, 2026 06:16
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.

cli 处理云文档图片和画板的能力需要增强

1 participant