補業績圖表 runtime QA
All checks were successful
CD Pipeline / deploy (push) Successful in 1m6s

This commit is contained in:
OoO
2026-05-19 10:40:22 +08:00
parent ac1bdb7812
commit ac5d1a2d81
6 changed files with 372 additions and 6 deletions

View File

@@ -22,6 +22,7 @@ OBSERVABILITY_QA_SUITE="$PROJECT_ROOT/scripts/check_observability_suite.sh"
OBSERVABILITY_CSS_SYNC="$PROJECT_ROOT/scripts/sync_observability_css.py"
OBSERVABILITY_VISUAL_CONTRACT="$PROJECT_ROOT/scripts/check_observability_visual_contract.sh"
RESPONSIVE_OVERFLOW_GUARD="$PROJECT_ROOT/scripts/check_responsive_overflow.sh"
SALES_CHARTS_GUARD="$PROJECT_ROOT/scripts/check_sales_charts_runtime.sh"
REVIEW_REPORT_HINT=0
# 顯示標題
@@ -109,6 +110,16 @@ run_responsive_overflow_guard() {
bash "$RESPONSIVE_OVERFLOW_GUARD" "$@"
}
run_sales_charts_guard() {
if [ ! -f "$SALES_CHARTS_GUARD" ]; then
echo -e "${RED}❌ 業績圖表 runtime guard 不存在: $SALES_CHARTS_GUARD${NC}"
exit 1
fi
echo -e "${GREEN}📈 開始業績分析圖表 runtime 檢查...${NC}"
bash "$SALES_CHARTS_GUARD" "$@"
}
# 非互動入口給部署腳本、CI、或 Codex session 直接呼叫。
if [ $# -gt 0 ]; then
case "$1" in
@@ -147,6 +158,11 @@ if [ $# -gt 0 ]; then
run_responsive_overflow_guard "$@"
exit $?
;;
--sales-charts)
shift
run_sales_charts_guard "$@"
exit $?
;;
--observability-help)
cat <<'EOF'
AI observability quick-review flags:
@@ -164,6 +180,8 @@ AI observability quick-review flags:
Run rendered typography, surface, radius, contrast, and mobile density checks.
--responsive-overflow [--base-url URL] [--route PATH ...]
Run desktop/tablet/mobile body horizontal overflow checks for Flask routes.
--sales-charts [--base-url URL] [--timeout SEC]
Run Chart.js runtime and nonblank canvas checks for /daily_sales and /growth_analysis.
EOF
exit 0
;;
@@ -184,8 +202,9 @@ if [ $# -eq 0 ]; then
echo "9) 同步 AI觀測台 CSS static mirror"
echo "10) 全頁 responsive overflow 檢查"
echo "11) AI觀測台渲染後視覺契約檢查"
echo "12) 業績分析圖表 runtime 檢查"
echo ""
read -p "請輸入選項 (1-11): " choice
read -p "請輸入選項 (1-12): " choice
case $choice in
1)
@@ -238,6 +257,9 @@ if [ $# -eq 0 ]; then
11)
run_observability_visual_contract
;;
12)
run_sales_charts_guard
;;
*)
echo -e "${RED}❌ 無效選項${NC}"
exit 1