Skip to content

fix(report): render ECharts fence aliases in HTML - #578

Open
March-77 wants to merge 2 commits into
spring-ai-alibaba:mainfrom
March-77:agent/issue-416-html-report-echarts-fences
Open

fix(report): render ECharts fence aliases in HTML#578
March-77 wants to merge 2 commits into
spring-ai-alibaba:mainfrom
March-77:agent/issue-416-html-report-echarts-fences

Conversation

@March-77

Copy link
Copy Markdown
Contributor

Describe what this PR does / why we need it

HTML report exports only recognize ECharts options fenced as echarts or json. Models also commonly emit the same option as javascript or js; those blocks are currently rendered as raw code, leaving chart configuration text in the exported report.

Does this pull request fix one issue?

Fixes #416

Describe how you did it

  • Normalize fence languages before dispatching code blocks.
  • Treat javascript and js as ECharts aliases alongside echarts and json.
  • Keep the backend download template and frontend HTML preview template consistent.
  • Add backend and frontend regression tests.

Describe how to verify it

JAVA_HOME=<jdk17> ./mvnw -pl data-agent-management -Dtest=ReportTemplateUtilTest test
JAVA_HOME=<jdk17> ./mvnw -pl data-agent-management test
cd data-agent-frontend-nuxt
pnpm exec vitest run app/utils/report-html-template.test.ts
pnpm build

Results: backend template tests 5/5 passed; full management module 1630/1630 passed; frontend test passed; Nuxt production build passed; Checkstyle reported 0 violations.

Special notes for reviews

The report prompt still requests the canonical echarts language. This change only makes HTML rendering tolerant of common model output aliases.

@March-77

Copy link
Copy Markdown
Contributor Author

用同一份 javascript fence 的 ECharts 配置做了对比。main(7a4d03a)会把配置作为代码显示;308cafe 会识别该别名并渲染图表。前端回归测试 1/1 通过。

Before:
PR #578 Before

After:
PR #578 After

…erge

# Conflicts:
#	data-agent-frontend-nuxt/app/utils/report-html-template.test.ts
#	data-agent-management/src/test/java/com/alibaba/cloud/ai/dataagent/util/ReportTemplateUtilTest.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 导出html报告格式不对,多了markdown标记

1 participant