feat: support whiteboard file inputs in docs XML#1784
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a whiteboard file-input inlining feature to Docs V2 write content preparation: ChangesWhiteboard inlining feature
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant prepareDocsV2WriteInput
participant prepareWhiteboardWriteContent
participant cmdutil
Caller->>prepareDocsV2WriteInput: submit doc content
prepareDocsV2WriteInput->>prepareWhiteboardWriteContent: rewrite whiteboard tags
prepareWhiteboardWriteContent->>prepareWhiteboardWriteContent: parse tag, validate path/body/type
prepareWhiteboardWriteContent->>cmdutil: ReadInputFile(path)
cmdutil-->>prepareWhiteboardWriteContent: file contents
prepareWhiteboardWriteContent-->>prepareDocsV2WriteInput: inlined content
prepareDocsV2WriteInput-->>Caller: rewritten content
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1784 +/- ##
==========================================
- Coverage 74.46% 74.39% -0.08%
==========================================
Files 855 857 +2
Lines 88568 89185 +617
==========================================
+ Hits 65954 66350 +396
- Misses 17543 17712 +169
- Partials 5071 5123 +52 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@shortcuts/doc/html5_block_resources_test.go`:
- Around line 465-492: The test
TestDocsCreateV2WhiteboardFileInputReportsAllMissingPaths only asserts
substrings from err.Error(), but it should verify the typed problem metadata
instead. Update it to use errs.ProblemOf on the aggregated whiteboard-path error
returned by runDocsCreateShortcut, and assert the correct category, subtype, and
param values for each missing whiteboard path while also checking the underlying
cause is preserved. Confirm the exact metadata used by the production whiteboard
error path so the assertions match the real aggregated error shape.
In `@shortcuts/doc/html5_block_resources.go`:
- Around line 262-276: The segment handling in applyOutsideCodeFences currently
stops processing later markdown segments after the first rewrite error, so only
the first missing-whiteboard group is reported. Update the logic around the
rewrite callback to keep scanning every outside-code-fence segment, collect any
rewriteErr values instead of returning early, and aggregate or combine them
after applyOutsideCodeFences finishes in html5_block_resources.go.
In `@skills/lark-doc/references/lark-doc-whiteboard.md`:
- Around line 61-62: The whiteboard docs currently mention only the SVG
file-based path form in the <whiteboard> examples, but they should also document
the new body form for local SVG files. Update the examples around the existing
whiteboard SVG/PlantUML guidance to include the <whiteboard
type="svg">`@diagram.svg`</whiteboard> usage alongside the existing <whiteboard
type="svg" path="`@diagram.svg`"></whiteboard> and related PlantUML examples, so
the entry point is fully covered.
🪄 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: 8dadf75d-a56c-4cde-8511-2aba419af67c
📒 Files selected for processing (4)
shortcuts/doc/html5_block_resources.goshortcuts/doc/html5_block_resources_test.goskills/lark-doc/references/lark-doc-whiteboard.mdskills/lark-doc/references/lark-doc-xml.md
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@b1327981cc5eec4c2f3ee296f1ffa8eace78e0c7🧩 Skill updatenpx skills add larksuite/cli#sun/whiteboard-at-file-inputs -y -g |
Summary
Adds local file expansion for docs XML whiteboard blocks so agents can reference SVG, Mermaid, and PlantUML files with @ paths before sending content to Docs AI.
Changes
Test Plan
skills/lark-doc/SKILL.mdfrontmatterversion; PR intentionally leavesSKILL.mdunchanged)E2E Result
REQ_ID=lark-cli-whiteboard-at-files-pr1784recorded aspassed./Users/bytedance/.ccm-harness/worktrees/lark-cli-whiteboard-at-files/larksuite_cli/.lark-cli-e2e-test/reports/pr-1784-whiteboard-at-files/report.md/Users/bytedance/.ccm-harness/worktrees/lark-cli-whiteboard-at-files/larksuite_cli/.lark-cli-e2e-test/reports/pr-1784-whiteboard-at-files/report.html/Users/bytedance/.ccm-harness/worktrees/lark-cli-whiteboard-at-files/larksuite_cli/.lark-cli-e2e-test/reports/pr-1784-whiteboard-at-files/result.jsonRelated Issues
Summary by CodeRabbit
New Features
Bug Fixes
Documentation