diff --git a/.gitignore b/.gitignore
index 1c9ea24..7cf5bb5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,11 @@ data/t2i_templates/base.html
.sisyphus/
data/plugin_data/astrbot_plugin_qq_group_daily_analysis/cache/avatars/123456789_40.jpg
data/plugin_data/astrbot_plugin_qq_group_daily_analysis/cache/avatars/987654321_40.jpg
+debug_format.html
+debug_hack.html
+debug_retro.html
+debug_scrapbook.html
+debug_simple.html
+debug_spring_festival.html
+debug_spring.html
+data/debug_data/avatar/cache.db
diff --git a/README.md b/README.md
index a98f24a..fa49aaf 100644
--- a/README.md
+++ b/README.md
@@ -336,6 +336,16 @@ python scripts/debug_render.py -t retro_futurism -o my_output.html
python scripts/debug_render.py -h
```
+```
+uv run scripts\debug_render.py -t scrapbook -o debug_scrapbook.html
+uv run scripts\debug_render.py -t hack -o debug_hack.html
+uv run scripts\debug_render.py -t retro_futurism -o debug_retro.html
+uv run scripts\debug_render.py -t format -o debug_format.html
+uv run scripts\debug_render.py -t simple -o debug_simple.html
+uv run scripts\debug_render.py -t spring_festival -o debug_spring.html
+```
+
+
**工具特性:**
- 使用 Mock 数据模拟真实的群聊分析结果
diff --git a/scripts/debug_render.py b/scripts/debug_render.py
index 8e682a6..b6f4e82 100644
--- a/scripts/debug_render.py
+++ b/scripts/debug_render.py
@@ -317,14 +317,15 @@ async def debug_render(
}
# 3. Initialize Generator
- generator = ReportGenerator(config_manager)
-
- # Override internal methods to facilitate debugging without real dependencies
- generator._get_user_avatar_data = mock_get_user_avatar
+ data_dir = Path("data/debug_data")
+ data_dir.mkdir(parents=True, exist_ok=True)
+ generator = ReportGenerator(config_manager, data_dir)
# 4. Prepare Render Data
# Note: _prepare_render_data handles converting Entities to template-friendly dicts
- render_payload = await generator._prepare_render_data(analysis_result)
+ render_payload = await generator._prepare_render_data(
+ analysis_result, avatar_url_getter=mock_get_user_avatar
+ )
# Use Jinja2 renderer
final_html = generator.html_templates.render_template(
diff --git a/src/infrastructure/reporting/templates/format/chat_quality_item.html b/src/infrastructure/reporting/templates/format/chat_quality_item.html
index f7768b6..9ff985a 100644
--- a/src/infrastructure/reporting/templates/format/chat_quality_item.html
+++ b/src/infrastructure/reporting/templates/format/chat_quality_item.html
@@ -1,25 +1,130 @@
-
-
-
{{ title }}
- {% if subtitle %}
{{ subtitle }}{% endif %}
+
+
+
-
+
@@ -364,21 +364,21 @@
activity.log
- {{hourly_chart_html}}
+ {{hourly_chart_html | safe}}
-
+
- {{titles_html}}
+ {{titles_html | safe}}
-
+
- {{quotes_html}}
+ {{quotes_html | safe}}
diff --git a/src/infrastructure/reporting/templates/retro_futurism/chat_quality_item.html b/src/infrastructure/reporting/templates/retro_futurism/chat_quality_item.html
index 227049e..6faf065 100644
--- a/src/infrastructure/reporting/templates/retro_futurism/chat_quality_item.html
+++ b/src/infrastructure/reporting/templates/retro_futurism/chat_quality_item.html
@@ -148,7 +148,7 @@
style="width: {{ dim.percentage }}%; background-color: {{ bg_colors[loop.index0 % bg_colors|length] }}; color: {{ txt_colors[loop.index0 % txt_colors|length] }};"
title="{{ dim.comment }}">
- {{ dim.name }} {{ dim.percentage }}%
+ {{ dim.name }}
{% endif %}
@@ -161,6 +161,7 @@
{% if dim.percentage > 0 %}
{% endif %}
diff --git a/src/infrastructure/reporting/templates/scrapbook/chat_quality_item.html b/src/infrastructure/reporting/templates/scrapbook/chat_quality_item.html
index ac6645f..fe19ab2 100644
--- a/src/infrastructure/reporting/templates/scrapbook/chat_quality_item.html
+++ b/src/infrastructure/reporting/templates/scrapbook/chat_quality_item.html
@@ -270,9 +270,9 @@
{% set tape_rot = loop.cycle('2deg', '-1deg', '3deg', '-2deg', '1deg', '-3deg') %}
-
-
{{ dim.name }}
-
{{ '%.1f'|format(safe_percentage) }}%
+
+ {{ dim.name }}
+ {{ '%.1f'|format(safe_percentage) }}%
{{ dim.comment }}
diff --git a/src/infrastructure/reporting/templates/simple/chat_quality_item.html b/src/infrastructure/reporting/templates/simple/chat_quality_item.html
index 6b07fa1..2620d3e 100644
--- a/src/infrastructure/reporting/templates/simple/chat_quality_item.html
+++ b/src/infrastructure/reporting/templates/simple/chat_quality_item.html
@@ -1,21 +1,120 @@
-
-
{{ title }}
- {% if subtitle %}
{{ subtitle }}
{% endif %}
-
- {% for dimension in dimensions %}
-
-
- {{ dimension.name }}
- {{ dimension.percentage }}%
-
-
-
{{ dimension.comment }}
+
+
+
+
- {% endfor %}
-
-
- {{ summary }}
+
+
+ {% set colors = ['#4dabf7', '#ff922b', '#51cf66', '#f06595', '#845ef7', '#339af0'] %}
+
+ {% for dim in dimensions %}
+ {% if dim.percentage > 0 %}
+
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
+ Summary
+ {{ summary }}
+
diff --git a/src/infrastructure/reporting/templates/simple/image_template.html b/src/infrastructure/reporting/templates/simple/image_template.html
index 077d3a0..3453944 100644
--- a/src/infrastructure/reporting/templates/simple/image_template.html
+++ b/src/infrastructure/reporting/templates/simple/image_template.html
@@ -37,21 +37,21 @@
活跃度图表
- {{hourly_chart_html}}
+ {{hourly_chart_html | safe}}
-
+
{% if chat_quality_html %}
群聊质量分析
- {{ chat_quality_html }}
+ {{ chat_quality_html | safe }}
{% endif %}
-
- {{topics_html}}
-
- {{titles_html}}
-
- {{quotes_html}}
+
+ {{topics_html | safe}}
+
+ {{titles_html | safe}}
+
+ {{quotes_html | safe}}