docs(slides): add whiteboard element documentation and improve slide guidance#1029
docs(slides): add whiteboard element documentation and improve slide guidance#1029Huangwenbo-wb wants to merge 6 commits into
Conversation
- Add lark-slides-whiteboard.md covering SVG and Mermaid modes, routing rules, layout examples, known issues, and self-check checklist - Register <whiteboard> in slides_xml_schema_definition.xml; remove it from the undefined element type list - Update SKILL.md quick-reference table and按需再读 section to point to the new whiteboard reference - Update xml-schema-quick-ref.md with <whiteboard> syntax examples - Update slide create/get/replace references to include whiteboard as a valid <data> child element - Tighten fallback_if_missing descriptions in planning-layer.md and asset-planning.md: replace "shapes" wording with neutral intent language and add "whiteboard diagrams" to the fallback tool lists Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Restructure doc: common attributes and prerequisites moved to top - Move design quality rules under SVG mode section - Add z-order inline note to full-screen layout example - Replace JS coordinate script with Python, broaden scope to decorative elements - Delete redundant Mermaid examples (keep one complete whiteboard+flowchart) - Add prerequisite link and references section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- lark-slides-whiteboard: add chart vs whiteboard decision table at top; fix intro and SVG use-case list to remove bar/line (those belong to <chart>) - SKILL.md: split whiteboard quick-ref row into chart row + whiteboard row; fix sidebar link label to match actual scope - asset-planning: correct chart asset type — remove funnel/scatter (unsupported by <chart> XSD) and note they fall back to <whiteboard> SVG - visual-planning: add one-line whiteboard preference hint to architecture-diagram and process-flow layout types - validation-checklist: add Whiteboard Elements section noting slide.get does not return SVG/Mermaid content; content correctness requires manual visual sign-off Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add two design rules to SVG quality requirements: check background luminance before writing SVG (dark bg requires higher contrast), and use non-linear brightness jumps (e.g. 0.10→0.40→0.70→1.0) instead of linear opacity stacking (0.04→0.08→0.12) which produces near-identical layers on dark backgrounds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- content area is determined by child element bounding box union, not svg width/height/viewBox/xmlns - viewBox only purpose: provide reference for percentage-based attribute values; omit when using absolute coords - remove redundant attributes from all svg examples, use bare <svg> tags - drop positive/negative coordinate guidance; rendering rule simplified to bounding-box auto-scale Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
📝 WalkthroughWalkthroughThis PR introduces comprehensive support for a new ChangesWhiteboard Element Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1029 +/- ##
==========================================
+ Coverage 66.80% 67.75% +0.95%
==========================================
Files 564 590 +26
Lines 52465 55188 +2723
==========================================
+ Hits 35048 37392 +2344
- Misses 14516 14684 +168
- Partials 2901 3112 +211 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@c8076663722ce7d423def6a0f97c2546ab4f4da3🧩 Skill updatenpx skills add larksuite/cli#feat/slides-whiteboard -y -g |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
skills/lark-slides/references/validation-checklist.md (1)
79-86: 💤 Low valueConsider adding guidance for coordinate validation failure handling.
The coordinate boundary validation rules are clear and correct (
topLeftX + width ≤ 960,topLeftY + height ≤ 540), but the section doesn't specify what to do when these checks fail. Consider adding a brief note about the expected remediation, for example:"If coordinates exceed boundaries, regenerate the whiteboard element with corrected dimensions before delivery."
This would align with the pattern in lines 35-45 where error codes are paired with handling guidance.
🤖 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-slides/references/validation-checklist.md` around lines 79 - 86, Add a short remediation note for failed coordinate validation in the Whiteboard Elements section: when `slide.get` returns a `<whiteboard>` whose `topLeftX + width > 960` or `topLeftY + height > 540`, instruct to regenerate or adjust the whiteboard element with corrected `topLeftX`/`topLeftY`/`width`/`height` before delivery and record an error code plus the remediation action in the validation log (matching the handling guidance pattern used around lines 35-45).skills/lark-slides/references/asset-planning.md (1)
46-46: ⚡ Quick winConsider making the chart vs whiteboard distinction more prominent.
The inline note clarifying that funnel and scatter must map to
<whiteboard>SVG is critical guidance but could be easily missed when scanning the list. This creates a conceptual gap: developers planasset_type: "chart"but must generate<whiteboard>XML.Consider one of these improvements:
- Add a separate bullet or subsection before line 40 titled "Chart vs Whiteboard Selection"
- Reference a decision table (mentioned in PR objectives) if it exists elsewhere
- Split the list to show "Chart element supports: line, bar, pie, radar, area, combo" and "Whiteboard element required for: funnel, scatter, architecture diagrams, flow diagrams"
🤖 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-slides/references/asset-planning.md` at line 46, The note about mapping funnel and scatter to <whiteboard> is easy to miss in the `chart` list; update the document to make the "Chart vs Whiteboard" distinction explicit by either adding a short subsection titled "Chart vs Whiteboard Selection" immediately before the `chart` bullet, or by splitting the existing list into two bullets: one listing supported `chart` types (line, bar, pie, radar, area, combo) and a second listing types that must use `<whiteboard>` (funnel, scatter, architecture diagrams, flow diagrams), and optionally add a cross-reference to the decision table if it exists; ensure you mention `asset_type: "chart"` vs `asset_type: "whiteboard"` so implementers know which XML element to generate.
🤖 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.
Nitpick comments:
In `@skills/lark-slides/references/asset-planning.md`:
- Line 46: The note about mapping funnel and scatter to <whiteboard> is easy to
miss in the `chart` list; update the document to make the "Chart vs Whiteboard"
distinction explicit by either adding a short subsection titled "Chart vs
Whiteboard Selection" immediately before the `chart` bullet, or by splitting the
existing list into two bullets: one listing supported `chart` types (line, bar,
pie, radar, area, combo) and a second listing types that must use `<whiteboard>`
(funnel, scatter, architecture diagrams, flow diagrams), and optionally add a
cross-reference to the decision table if it exists; ensure you mention
`asset_type: "chart"` vs `asset_type: "whiteboard"` so implementers know which
XML element to generate.
In `@skills/lark-slides/references/validation-checklist.md`:
- Around line 79-86: Add a short remediation note for failed coordinate
validation in the Whiteboard Elements section: when `slide.get` returns a
`<whiteboard>` whose `topLeftX + width > 960` or `topLeftY + height > 540`,
instruct to regenerate or adjust the whiteboard element with corrected
`topLeftX`/`topLeftY`/`width`/`height` before delivery and record an error code
plus the remediation action in the validation log (matching the handling
guidance pattern used around lines 35-45).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 900593dc-b8a4-476a-8c32-0ec700c4b5e8
📒 Files selected for processing (12)
skills/lark-slides/SKILL.mdskills/lark-slides/references/asset-planning.mdskills/lark-slides/references/lark-slides-replace-slide.mdskills/lark-slides/references/lark-slides-whiteboard.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-create.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-get.mdskills/lark-slides/references/lark-slides-xml-presentation-slide-replace.mdskills/lark-slides/references/planning-layer.mdskills/lark-slides/references/slides_xml_schema_definition.xmlskills/lark-slides/references/validation-checklist.mdskills/lark-slides/references/visual-planning.mdskills/lark-slides/references/xml-schema-quick-ref.md
Summary
lark-slides-whiteboard.mdreference covering SVG and Mermaid modes, renderingrules, element support, coordinate calculation, and quality checklist
<chart>vs<whiteboard>selection across SKILL.md, asset-planning.md, andxml-schema-quick-ref.md
<whiteboard>preference hints to visual-planning.md for architecture-diagram and process-flowlayouts
width/height/viewBoxdo not affect rendering;xmlnsrequired for XML namespace parsing;viewBoxonly needed for percentage-based attribute values
linearGradientsupport status (supported;radialGradientis not)Test plan
<chart>vs<whiteboard>decision table covers common scenariosconsistent
Summary by CodeRabbit
New Features
Documentation