Skip to content

docs(slides): sync chart gradient fields into slides xsd references#1916

Open
ethan-zhx wants to merge 1 commit into
mainfrom
feat/slides-chart-gradient-xsd
Open

docs(slides): sync chart gradient fields into slides xsd references#1916
ethan-zhx wants to merge 1 commit into
mainfrom
feat/slides-chart-gradient-xsd

Conversation

@ethan-zhx

@ethan-zhx ethan-zhx commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Mirror ai_xsd MR !56 (chart format fields) into the slides skill reference bundle so authoring guidance matches the shipping XSD: gradient fields must be attached at the series or single-element layer, not the unconsumed chartStyle global layer.

Changes

  • Add ChartGradientKindType / ChartGradientStopType / ChartGradientStopsType / ChartGradientType in references/slides_xml_schema_definition.xml, and split ChartLineType / ChartAreaType / ChartBarsType / ChartSectorsType into ChartGlobal* (chartStyle layer) vs ChartSeries* (chartSeries layer) so only series-level types carry fillGradient / strokeGradient.
  • Document the gradient contract in references/xml-format-guide.md: allowed mount points (series / single-element), disallowed mount point (chartStyle global layer), plus <stops> minOccurs=2, type enum, and radial vs linear coordinate attrs.
  • Note chartBackground default-value semantics (omit = renderer default, not white) and chartBorder "no border" equivalence (width="0" vs omit).

Test Plan

  • xmllint --noout --schema skills/lark-slides/references/slides_xml_schema_definition.xml <positives>.xml passes for series-level and single-element gradients (C1-C6, C10-A/B, C11-A/B).
  • xmllint rejects the three negative shapes: chartStyle > chartLines gradient, single-stop <stops>, and type="conic" (C7-C9).
  • Manual visual verification via lark-cli slides +create on 8 positive pages: series/single-bar/single-sector fill gradients render as expected; chartBackground omit ↔ transparent stay visually identical; chartBorder width=0 ↔ omit stay visually identical.
  • Follow-up (not in this PR): chartLine > strokeGradient did not render on line charts in manual verification, and the server-side create still accepts chartStyle > chartLines > strokeGradient (XSD-only rejection). Tracked separately.

Related Issues

  • Follows ai_xsd MR !56

Summary by CodeRabbit

  • New Features

    • Added gradient fills and (where supported) stroke gradients across chart series and data elements, including points, lines, areas, bars, and pie/ring sectors.
    • Enhanced chart styling flexibility by allowing optional chart background color (no preset default) and supporting “no border” via border width set to 0 (or omitting the border).
  • Documentation

    • Updated the XML format guide with gradient placement rules and minimal examples, including how gradients apply at series-level vs individual element-level.

@coderabbitai

coderabbitai Bot commented Jul 16, 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: ab24bf31-1aec-4dd7-b3c4-81d166d4404c

📥 Commits

Reviewing files that changed from the base of the PR and between a26a399 and f8d2ab1.

📒 Files selected for processing (2)
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/xml-format-guide.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • skills/lark-slides/references/xml-format-guide.md

📝 Walkthrough

Walkthrough

Chart XML schema declarations add gradient structures and styling support across chart elements, separate global and series line/area configuration, update background and border semantics, and document the resulting XML usage and constraints.

Changes

Chart styling schema

Layer / File(s) Summary
Gradient contracts and element-level styling
skills/lark-slides/references/slides_xml_schema_definition.xml, skills/lark-slides/references/xml-format-guide.md
Adds linear and radial gradient types with stops, extends point, bar, sector, and series styling with gradient elements, updates background and border semantics, and documents gradient placement and structure.
Global and series line-area styling
skills/lark-slides/references/slides_xml_schema_definition.xml
Splits line and area configuration into global and series types, adds series gradient support, and rewires chart series and plot declarations to use the new types.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: syncing chart gradient fields into the slides XSD references.
Description check ✅ Passed The description follows the required template and includes 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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/slides-chart-gradient-xsd

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.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Jul 16, 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.

Actionable comments posted: 2

🤖 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-slides/references/xml-format-guide.md`:
- Around line 329-335: The global styling guidance incorrectly references
chartStyle; update the documented global layer to chartPlot for chartLines,
chartAreas, chartBars, and chartPoints, while retaining the existing
series-level and single-element-level mounting guidance.
- Around line 326-334: The gradient placement documentation and schema
references must distinguish indexed elements from series-level entries: in
skills/lark-slides/references/xml-format-guide.md at lines 326-334, state that
indexed chartPoint and chartBar elements support only fillGradient, while
strokeGradient applies to series-level chartPoints and chartBars; update the
corresponding definitions in
skills/lark-slides/references/slides_xml_schema_definition.xml at lines
2524-2526 and 2675-2677 to enforce or document the same restriction.
🪄 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: adad7552-952e-4e63-97d1-ac073110d43f

📥 Commits

Reviewing files that changed from the base of the PR and between be1f362 and a26a399.

📒 Files selected for processing (2)
  • skills/lark-slides/references/slides_xml_schema_definition.xml
  • skills/lark-slides/references/xml-format-guide.md

Comment thread skills/lark-slides/references/xml-format-guide.md Outdated
Comment on lines +329 to +335
**只能挂在系列级或单元素级,不要挂在 `<chartStyle>` 全局层。** transform 链路不消费全局层的渐变(`<chartStyle>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`),写了没有效果。

可挂载位置:

- ✅ 系列级:`<chartSeries>` 下的 `<chartLine>` / `<chartArea>` / `<chartBars>` / `<chartPoints>` / `<chartSectors>`
- ✅ 单元素级:`<chartBar index="…">` / `<chartPoint index="…">` / `<chartSector index="…">`
- ❌ 全局级:`<chartStyle>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use <chartPlot>, not <chartStyle>, for the global styling layer.

The XSD declares chartLines, chartAreas, chartBars, and chartPoints beneath ChartPlotType (Lines 2981-2988). The current wording directs consumers toward schema-invalid XML.

Proposed correction
-**只能挂在系列级或单元素级,不要挂在 `<chartStyle>` 全局层。**
+**只能挂在系列级或单元素级,不要挂在 `<chartPlot>` 全局层。**

-- ❌ 全局级:`<chartStyle>` 下的 ...
+- ❌ 全局级:`<chartPlot>` 下的 ...

As per coding guidelines, output formats must be treated as machine-consumed interfaces.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**只能挂在系列级或单元素级,不要挂在 `<chartStyle>` 全局层。** transform 链路不消费全局层的渐变(`<chartStyle>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`),写了没有效果。
可挂载位置:
- ✅ 系列级:`<chartSeries>` 下的 `<chartLine>` / `<chartArea>` / `<chartBars>` / `<chartPoints>` / `<chartSectors>`
- ✅ 单元素级:`<chartBar index="…">` / `<chartPoint index="…">` / `<chartSector index="…">`
- ❌ 全局级:`<chartStyle>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`
**只能挂在系列级或单元素级,不要挂在 `<chartPlot>` 全局层。** transform 链路不消费全局层的渐变(`<chartStyle>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`),写了没有效果。
可挂载位置:
- ✅ 系列级:`<chartSeries>` 下的 `<chartLine>` / `<chartArea>` / `<chartBars>` / `<chartPoints>` / `<chartSectors>`
- ✅ 单元素级:`<chartBar index="…">` / `<chartPoint index="…">` / `<chartSector index="…">`
- ❌ 全局级:`<chartPlot>` 下的 `<chartLines>` / `<chartAreas>` / `<chartBars>` / `<chartPoints>`
🤖 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/xml-format-guide.md` around lines 329 - 335,
The global styling guidance incorrectly references chartStyle; update the
documented global layer to chartPlot for chartLines, chartAreas, chartBars, and
chartPoints, while retaining the existing series-level and single-element-level
mounting guidance.

Source: Coding guidelines

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#feat/slides-chart-gradient-xsd -y -g

R0bynZhu
R0bynZhu previously approved these changes Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.96%. Comparing base (65998a2) to head (f8d2ab1).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1916   +/-   ##
=======================================
  Coverage   74.95%   74.96%           
=======================================
  Files         892      892           
  Lines       94056    94058    +2     
=======================================
+ Hits        70502    70506    +4     
+ Misses      18140    18139    -1     
+ Partials     5414     5413    -1     

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

Mirror ai_xsd MR !56 (chart format fields) into the slides skill
reference bundle: add ChartGradient* types and split ChartLineType /
ChartAreaType into Global/Series variants in slides_xml_schema_definition.xml,
and document the series-only fillGradient/strokeGradient contract plus
chartBackground/chartBorder default-value adjustments in xml-format-guide.md
so authors do not attach gradients on the unconsumed chartStyle global layer.
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