Skip to content

docs: add drive comment location guidance#1258

Merged
fangshuyu-768 merged 1 commit into
mainfrom
docs/drive-comment-location-skill
Jun 9, 2026
Merged

docs: add drive comment location guidance#1258
fangshuyu-768 merged 1 commit into
mainfrom
docs/drive-comment-location-skill

Conversation

@wittam-01

@wittam-01 wittam-01 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds guidance for locating document comments using need_relation=true, relation block IDs, and embedded resource parent metadata.

Changes

  • Link the lark-drive skill to a new comment location reference for review/comment mapping workflows.
  • Document relation parsing, positionInfo.blockID matching, parent_type / parent_token handling, and accuracy levels.
  • Add follow-up guidance for Sheet, Base/Bitable, and Whiteboard internal comments.

Test Plan

  • git diff --check HEAD~1..HEAD
  • Unit tests pass — not run; documentation-only Skill change.
  • Manual local verification confirms the lark-cli <domain> <command> flow works as expected — not run; guidance-only Skill change.

Related Issues

  • None

Summary by CodeRabbit

  • Documentation
    • Added guidance for a new “快速决策” rule and requiring need_relation=true to return comment-based locations for DOCX documents.
    • Documented how comment relation data maps to document positions, including JSON parsing and matching by block ID.
    • Described workflows for locating comments in embedded content via parent-type/token and fallback/ambiguity handling.

@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: f2c0a029-ef6b-4163-b404-53c4c323ea19

📥 Commits

Reviewing files that changed from the base of the PR and between dbe35be and ca24906.

📒 Files selected for processing (2)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-comment-location.md
✅ Files skipped from review due to trivial changes (2)
  • skills/lark-drive/SKILL.md
  • skills/lark-drive/references/lark-drive-comment-location.md

📝 Walkthrough

Walkthrough

SKILL.md requires need_relation=true for comment-to-body positioning on docx and points to a new reference. The reference documents field semantics (relation, parent_type, parent_token), shows parsing of relation.relation to get block IDs via docs +fetch --detail with-ids, and prescribes a priority flow for embedded resources and quote fallback.

Changes

Lark Drive comment-location positioning

Layer / File(s) Summary
SKILL.md routing to comment-location reference
skills/lark-drive/SKILL.md
Adds quick-decision rule and comment-positioning-fields guidance that require need_relation=true and direct readers to the new reference.
Comment-location reference: objectives, usage, and field semantics
skills/lark-drive/references/lark-drive-comment-location.md
Documents applicability (docx-only need_relation), how to set need_relation for paged/batched queries, the need to fetch docs with --detail with-ids, and defines relation/parent_type/parent_token with an accuracy classification.
Comment-location reference: parsing examples and end-to-end flow
skills/lark-drive/references/lark-drive-comment-location.md
Examples show parsing relation.relation JSON to extract positionInfo.blockID, matching blocks in fetched docs, and the ordered workflow: relation → parent-embedding → quote fallback.
Comment-location reference: embedded resources guidance and usage principles
skills/lark-drive/references/lark-drive-comment-location.md
Per-embed guidance for Sheets, Bitable/Base, and Whiteboard on locating internal units via parent_token/coords and verification; emphasizes preferring block-id and avoiding reliance solely on quote.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

domain/ccm

Suggested reviewers

  • fangshuyu-768

Poem

🐰 I hop where comments point and trace,
Block IDs first, then parent place,
If embeds hide, I drill and seek,
Only quotes when paths are weak,
I nibble clues and leave a tidy lace 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adding documentation guidance for comment location handling in the lark-drive skill.
Description check ✅ Passed The description covers all required template sections with appropriate detail for a documentation-only change, including summary, changes, test plan, and related issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
  • Commit unit tests in branch docs/drive-comment-location-skill

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 the size/M Single-domain feat or fix with limited business impact label 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 71.58%. Comparing base (b216363) to head (ca24906).
⚠️ Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1258      +/-   ##
==========================================
+ Coverage   69.19%   71.58%   +2.38%     
==========================================
  Files         634      689      +55     
  Lines       59482    65521    +6039     
==========================================
+ Hits        41161    46901    +5740     
+ Misses      15007    14972      -35     
- Partials     3314     3648     +334     

☔ 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@ca24906a5188992098b8a339b99c911b14959bc8

🧩 Skill update

npx skills add larksuite/cli#docs/drive-comment-location-skill -y -g

@wittam-01
wittam-01 force-pushed the docs/drive-comment-location-skill branch from ef3e9c0 to dbe35be Compare June 5, 2026 08:29
kyalpha313 added a commit to kyalpha313/lark-cli that referenced this pull request Jun 8, 2026
…#1258

Replaces the client-side quote/text-matching orphan detection with the
server-supplied anchor identifiers from `need_relation=true`, following
the field design documented in larksuite#1258.

Behavior:
- list comments with `need_relation=true` to obtain `relation.relation`
  (containing `positionInfo.blockID`) and `content_deleted`
- fetch docs XML with `export_block_id=true`; build a block-id index
  for stable anchor ordering (replaces the prior text-position
  projection that broke on multi-occurrence and tag-broken anchors)
- use `content_deleted` as the orphan signal (resolves the prior
  "short anchor multi-occurrence" false-positive limitation)
- use `parent_type` / `parent_token` to place embedded-resource
  comments (Sheet / Base / Whiteboard); intentionally downgrade these
  to `parent_resource_exact` rather than claiming exact internal
  ordering, since docs XML only identifies the embedding block

Output contract additions:
- `anchor_block_id`: per-comment anchor (from positionInfo.blockID)
- `location_accuracy`: relation_exact | parent_resource_exact |
  weak_inferred | content_deleted | whole_document
- `content_deleted`: server-side orphan signal

Tests:
- unit: relation parsing, malformed-JSON fallback, content-deleted
  orphan classification, relation-exact / parent-resource-exact
  anchoring, embedded-relation downgrade, sorted output, dry-run
  request shape, httpmock E2E
- dry-run E2E (`tests/cli_e2e/drive/drive_list_comments_dryrun_test.go`):
  asserts `need_relation=true`, `need_reaction=true`, `is_solved=false`,
  and fetch body `format=xml` with `export_block_id=true`
- opt-in live E2E
  (`tests/cli_e2e/drive/drive_list_comments_workflow_test.go`):
  gated by `LARK_DRIVE_LIST_COMMENTS_E2E=1`; user identity; creates
  a docx, adds a block comment, lists, asserts relation metadata,
  cleans up
- coverage doc updated to 11 / 32 = 34.4%

Live validation against a real docx: composition now matches the
Lark UI side panel for 21 of 22 originally observed comments (the
prior algorithm had a 2-item swap error from text-matching false
positives); `[Sticky note]` and embedded `<callout>` comments now
land at their correct positions.
Change-Id: I7cfdfd5a456658cca89fc974ef7a85dc20c2c395
@wittam-01
wittam-01 force-pushed the docs/drive-comment-location-skill branch from dbe35be to ca24906 Compare June 9, 2026 07:13
@fangshuyu-768
fangshuyu-768 merged commit 944cd55 into main Jun 9, 2026
46 of 52 checks passed
@fangshuyu-768
fangshuyu-768 deleted the docs/drive-comment-location-skill branch June 9, 2026 09:00
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