OoO
b5a2b09445
fix(ppt): matplotlib CJK fallback covers container Noto CJK JP variant
...
CD Pipeline / deploy (push) Successful in 2m19s
實戰驗證在 188 容器內發現:matplotlib font_manager 從 fonts-noto-cjk
ttc 檔只載入 'Noto Sans CJK JP' / 'Noto Serif CJK JP' 兩個變體(TC/SC/HK/KR
名稱未列入 ttflist),導致原本 fallback 清單比對失敗 → font.family 退到
'sans-serif'(DejaVu Sans)→ 中文 glyph 全部缺失印出 UserWarning。
修正:
- _mpl_setup() fallback 清單加入 'Noto Sans CJK JP' / 'Noto Serif CJK JP'
- 最終 fallback 加 substring match(涵蓋未列入但名稱含 CJK/PingFang/
JhengHei/YaHei/Source Han/WenQuanYi/Hiragino 的字型)
- _mpl_horiz_bar_png 內重複的 cjk_candidates 邏輯移除,改呼叫 _mpl_setup
避免兩處清單漂移
註:Noto Sans CJK JP ttc 檔本身含完整 CJK Unified Ideographs,可正常
渲染中文(漢字共用),只是字型名稱叫 JP 而已。
bump 模板版本(舊圖表中文方塊版本快取應失效重生):
- daily v3.0 → v3.0.1
- weekly v3.0 → v3.0.1
- monthly v3.1 → v3.1.1
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 23:38:51 +08:00
OoO
1c81866541
fix(ppt): final critic cleanup — Medium-1 OOXML order + Info-1/2 docs
...
CD Pipeline / deploy (push) Successful in 2m29s
清掉剩餘 critic finding(Medium-1 + Info-1 + Info-2):
Medium-1: _set_run_fonts 違反 OOXML CT_TextCharacterProperties 子元素順序
- 抽出 _insert_rpr_child(rPr, tag) helper:依 ECMA-376 §21.1.2.3 規定
的順序表(_RPR_CHILD_ORDER)找正確位置插入
- 找第一個排在 target 之後的子元素 → insert 前面;否則 append
- 當前 from-scratch 場景安全;未來改讀模板 .pptx 時也不會踩雷
- 驗證:產生 monthly v3.1,399 個 rPr 全部符合 schema 順序,0 違反
Info-1: cleanup_expired_ppt_cache docstring 補語意說明
- 明確說明 dry_run=True/False 時 deleted_files / deleted_rows / freed_bytes
欄位語意分別為「將刪除」預估值 vs「已實刪」實際值
Info-2: TEMPLATE_VERSIONS 標記退役 type
- growth / vendor / bcg 三個 type 從未實際落地(依 ADR-014 校正 2026-04-28)
- 加 DEPRECATED 註解,避免後人誤以為已支援
Info-3 SKIP(評估後不做):
- get_template_version import 改放模組頂部會 trigger ppt_generator 模組級
REPORTS_DIR.mkdir() 副作用,read-only filesystem 環境會掛
- 保留延遲 import 是 graceful degradation 的 intentional 設計
至此 critic 38967ce 審查清單全綠:
- 0 critical, 2 HIGH (3b0b4b3 ), 4 medium (52c06f6 + 本 commit), 3 info
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 17:39:27 +08:00
OoO
3b0b4b3d42
fix(ppt): address critic findings on commit 38967ce (HIGH-1, HIGH-2, Medium-4)
...
CD Pipeline / deploy (push) Successful in 2m27s
Critic 審查 38967ce 找出 2 HIGH + 4 medium,本 commit 修最緊急三項:
HIGH-2: cleanup_expired_ppt_cache 預設 dry_run=False 危險
- 函式 default 改 dry_run=True(呼叫方需明確傳 False 才實刪)
- launchd 排程腳本改用 DRY_RUN 環境變數,預設 false→實刪,
但測試時可 DRY_RUN=true 安全跑
- /cache cleanup Telegram 指令預設乾跑,需加 confirm 才實刪
- /cache cleanup days<1 強制乾跑(防呆)
HIGH-1: matplotlib 三個 helper 缺 try/finally → 渲染失敗洩漏 figure
- _mpl_horiz_bar_png / _mpl_line_chart_png / _mpl_pareto_chart_png
全部用 try/except/finally 包住,例外時 plt.close() 仍執行
- 同時讓渲染失敗回 None(呼叫端自然 fallback 到原生 chart)
Medium-4: scripts/ppt_cleanup.sh PROJECT_DIR 寫死
- 改用相對路徑解析(cd $SCRIPT_DIR/..),手動執行不再需要設環境變數
- VENV_PY 找不到時 fallback 到系統 python3(容器友善)
- 新增 DRY_RUN 環境變數開關(預設 false)
煙霧測試:
- syntax OK (services/ppt_generator.py + routes/openclaw_bot_routes.py)
- monthly v3.1 重生 10 頁 290KB
- cleanup_expired_ppt_cache dry_run default = True ✓
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 17:23:02 +08:00
OoO
38967ceea3
feat(ppt): redesign all 6 reports to professional standard + cache versioning
...
CD Pipeline / deploy (push) Successful in 13m18s
PPT 模板全面升版至市場專業標準(McKinsey / BCG 月報級別):
Monthly v3.1(10 頁)
- 暖紙感封面(去黑底)+ elevator pitch(亮點/警訊/動能徽章)
- KPI 卡含 △% vs 上月 + 紅綠燈、YoY 同期對比帶
- matplotlib 業績趨勢折線(本月+上月+日均線+高低點)
- 品類分析雙視圖:橫條 + 帕雷托累計(80% 主力線)
- TOP 50 商品(自動分頁)+ vs 上月 △ 排名變化 / 🆕 新進榜
- MCP 情報 4 卡片結構化、AI 行動結構化分區、附錄頁
Daily / Weekly / Strategy / Promo / Competitor v3.0
- 統一暖紙封面、AI 頁去黑底改暖紙 + 焦糖橘色條
- 日週改 matplotlib 折線(含日均線、高低點)
- 全部加附錄頁(資料來源 / 計算口徑 / 模板版本)
Cache 版本控制
- TEMPLATE_VERSIONS 字典自動注入 cache key (tpl_ver)
- 模板升版舊快取自動 miss → 重生
- 新增 _invalidate_ppt_cache() 與 cleanup_expired_ppt_cache() helper
- 新增 /cache status / flush / cleanup Telegram 指令
字型系統
- _set_run_fonts() 用 lxml 直寫 a:latin/a:ea,中英分軌
- 中文走 Microsoft JhengHei,數字/英文走 Consolas(點陣等寬)
- Dockerfile 加 fonts-noto-cjk + fonts-noto-cjk-extra
部署排程
- scripts/install_ppt_cleanup.sh 一鍵安裝 launchd(每日 03:15)
- scripts/ppt_cleanup.sh 清 7 天前過期 PPT 檔 + DB row
資料層
- routes monthly: query_monthly_summary LIMIT 10 → 50,補 orders 欄位
- routes monthly: 拉 prev_month / prev_year 比較資料供 KPI △ 與商品 △ 計算
煙霧測試 6/6 全綠:
- 日報 v3.0 (5 頁) / 週報 v3.0 (6 頁) / 月報 v3.1 (10 頁)
- 策略 v3.0 (6 頁) / 促銷 v3.0 (6 頁) / 競品 v3.0 (5 頁)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-02 16:26:27 +08:00
OoO
76304602b1
fix(ppt): footer→bottom, font spec (Courier New/Microsoft JhengHei), 50-item paginated table, remove old single-page remnant
CD Pipeline / deploy (push) Successful in 2m41s
2026-05-02 15:32:54 +08:00
OoO
0b82350745
style(ppt): comprehensive warm-tone redesign - caramel KPI cards, warm paper MCP/AI pages, revenue ratio bars in product table, chart→caramel orange, cover with warm decorative bands
2026-05-02 15:20:02 +08:00
OoO
4c6e4ca5fb
style(ppt): align PPT palette perfectly with MOMO Pro v2 design tokens (Beige, Warm Ink, Caramel Orange) as per frontend upgrade roadmap
2026-05-02 15:01:55 +08:00
OoO
934adc957c
style(ppt): redesign ppt layouts, align palette with frontend, and add dedicated MCP RAG slide
2026-05-02 14:59:45 +08:00
OoO
d88dcc8f75
fix(devops): 清理舊端口與危險 compose 操作
CD Pipeline / deploy (push) Successful in 1m45s
2026-04-30 14:24:53 +08:00
ogt
48804553cd
feat: PPT 簡報系統 V2 — 新增 growth/vendor/bcg 三種報告 + 原生圖表升級
...
CD Pipeline / deploy (push) Successful in 1m15s
- ppt_generator.py: 新增 generate_growth_ppt(6頁)、generate_vendor_ppt(5頁)、generate_bcg_ppt(5頁)
- openclaw_bot_routes.py: 新增 query_growth_data()、query_vendor_bcg_data()、_generate_ppt_cmd 三路分支、_submenu_reports 4顆新按鈕、type_labels、await:date_ppt_vendor 流程
- ADR-014: 記錄 V2 完整架構(9種報告類型、圖表技術方案、callback_data 格式)
- CLAUDE.md: 新增 PPT 簡報系統索引表
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 20:26:47 +08:00
ogt
34620b7b04
feat: upgrade ppt_generator to v2 with native charts
...
CD Pipeline / deploy (push) Successful in 1m16s
- daily: 3→4頁,新增 P3 近7日業績柱狀圖
- weekly: 2→5頁,新增 KPI摘要、7日走勢圖、TOP10商品表
- monthly: 2→5頁,新增 KPI卡、品類橫條圖、TOP10商品表
- strategy: 3→5頁,新增策略矩陣柱狀圖+行動清單(含策略標籤)
- promo: 2→5頁,新增促銷vs對比期KPI、業績雙柱圖、TOP商品表
- competitor: 維持4頁,架構不變
- 新增 _add_column_chart / _add_horiz_chart 原生圖表 helper
- 新增 _product_table_slide 通用商品表格元件
圖表來源對照:daily_sales trendChart、monthly_summary_analysis、
growth_analysis revenueChart/momChart
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-20 20:08:18 +08:00
ogt
4c8edecd12
feat: rewrite ppt_generator.py with premium dark-theme design
...
CD Pipeline / deploy (push) Successful in 1m22s
Previous version was an emergency stub (緊急復原版) using plain white
PowerPoint default layouts. This commit restores the full premium design
visible in the product screenshot.
Design system:
- 16:9 canvas (33.87 × 19.05 cm)
- Cover: deep navy bg #0D1B2A + orange brand stripe #FF5722
- Header bar: orange #FF5722 on all content slides
- KPI cards: blue #1565C0 / green #2E7D32 / orange #E65100
- Horizontal bar chart for competitor distribution
- Striped data table with red/green price-diff coloring
- Footer: ♥ Powered by OpenClaw on every slide
Slides per report type:
competitor_ppt: Cover → KPI+BarChart → ProductTable → AI Insight
daily_ppt: Cover → KPI+TOP5 → AI Insight
strategy_ppt: Cover → KPI+TOP5 → AI Insight
weekly/monthly/promo: Cover → AI Insight
2026-04-20 06:56:14 +08:00
ogt
1b4f3a7bbe
feat: EwoooC 初始化 — 完整專案推版至 Gitea
...
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-04-19 01:21:13 +08:00