Commit Graph

13 Commits

Author SHA1 Message Date
Frontend Developer
e554215335 finish sprint 1-3 frontend contract closure
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
2026-07-03 21:28:50 +08:00
Hermes Agent
0ec5bdfc19 fix(dashboard): 从URL参数自动读取token并加载数据
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
修复管理后台Web登录后dashboard仍提示缺JWT的问题:
- dashboard.js bootstrap() 新增 URL ?t= 参数读取逻辑
- 自动将token填入#token input并触发loadDashboard
- 登录后自动跳转→自动认证→自动加载数据,用户无感知

验证: 浏览器登录admin/Admin123! → dashboard自动加载'已连接·数据已加载'
2026-06-29 12:40:11 +08:00
Hermes Agent
3acda15527 fix(frontend): 视觉验收发现的问题逐条修复
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
P0 致命修复:
- 首页表单中段灰色不可见文字: hero-note(#e8edf7) 改为显式 #475569 可读色
- 首页上传区域空白虚线框: 补图标+说明+格式支持+CTA文案
- 结账页顶部裸 HTML class="wrap">: 缺少 <main 标签导致

P0 CTA层级:
- 首页双CTA: "直接做完整规划"从 btn-primary 改为 btn-secondary 形成层级

P1 信任感:
- 结账页补退款政策+支付方式+支付安全三栏
- 结账页删除 3 张冗余 trust-strip 卡片(原 6 张→2 张 form-proof)
- 结账页补"考试省份"必填星号

P1 定价页统一:
- CTA 文案统一: "选择付费审核"/"支付并启动方案生成"/"选择深度辅导"
- 价格单位统一: /次 /单 → 全部 /份

P1 导航对比度:
- global-nav-link 从 #b8c8e4 提亮到 #d8e4f8 (WCAG AA 4.5:1)

验证: pytest 1303 passed, ruff All checks passed
2026-06-27 23:16:26 +08:00
Hermes Agent
4202eba208 feat(frontend): 三阶段18项前端优化全部完成
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
第一阶段(致命缺陷修复):
- 复核结果页: 真分享(navigator.share+clipboard兜底)+保存草稿(localStorage), 删除假wxhelp外链
- 通用状态组件库: portal-ui.css新增state-loading/skeleton/empty/error/toast/sr-only
- my-orders/my-reports接入skeleton占位+state-empty

第二阶段(核心功能补齐):
- C方案鉴权: my-orders/my-reports/compare-reports删除find_by_phone手机号直查,
  改为portal token验证, 堵死P0-2越权漏洞
- 首页表单4字段即时校验(province/score/subjects/goal) + portal info 3字段校验
- cwb页面从固定文案升级为基于crowd_db的三档真实建议(冲刺+20/稳妥0/保底-20)

第三阶段(产品化提升):
- 新增/score-line-query分数线查询页(从crowd_db读本科线)
- 新增/rank-estimator位次估算页(基于benchmarks插值)
- /data-query扩展为4入口(分数线/位次/政策/同分段)
- 报告资产页补复制链接+系统分享
- 全局导航移除my-orders/my-reports(C方案)
- 从所有导航删除越权入口

验证: pytest 1306 passed, ruff All checks passed, 浏览器逐页验证通过
2026-06-27 13:23:08 +08:00
Hermes Agent
8d0ef0b842 frontend: 第三阶段补齐 - 数据查询+报告对比+focus-visible
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
新增功能:
1. /data-query 数据查询入口页:政策中心+同分段参考两个查询入口
2. /compare-reports 报告对比入口页:输入手机号选择多份报告对比
3. focus-visible CSS:所有可交互元素获得键盘焦点时显示蓝色轮廓
4. 所有新页面包含全局导航栏+返回首页+role=main

验证结果(重启服务后curl真实确认):
- /data-query: HTTP 200 
- /compare-reports: HTTP 200 
- focus-visible CSS: 5处 
- 分享/PDF/性能: 全部 
- 测试: 60 passed
2026-06-26 22:00:00 +08:00
Hermes Agent
ed61f6e306 fix(frontend): 全局导航栏覆盖所有6个关键页面
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
修复内容:
1. portal-ui.css 新增全局导航栏CSS(所有引用该文件的页面共享)
2. 定价页/结账页/我的订单/我的报告/复核结果页 均加入全局导航栏HTML
3. 复核结果页通过_render_placeholder_shell自动获得导航栏
4. 我的订单/我的报告增加返回首页按钮

严格验证结果(重启服务后curl真实确认):
- 全局导航栏: 6/6页面全部有 
- 返回首页: 5/5非首页页面全部有 

测试: 60 passed
2026-06-26 21:36:26 +08:00
hermes
6eafe1fc9b feat(ops 6/20 v2.1.3): 生产加固 + L-A 送审前修复 + crowd_db 质量契约
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
## 实现内容 (6 项改动)

1. **admin /health 端点增强** — 主键契约 status:ok 保持 + checks 子对象
   - db_writable: connect + CREATE TEMP TABLE + INSERT + SELECT + DROP
   - disk_writable: 在 ops_alert_log_path 目录创建临时文件 + 删除
   - settings_valid: 复用 is_jwt_secret_secure 判断
2. **_enforce_jwt_secret_policy** — prod env 使用 dev 默认 JWT / 长度<32 → fail-closed
3. **_enforce_default_admin_password_policy** — prod env 用 admin123 / 长度<10 / 字符类<3 → fail-closed
4. **L-A R7: admin UI footer** — dashboard.html (592 行) + ui.py 内联 admin/orders/new
   模板加 footer 隐私政策 + 数据删除 + 服务说明链接, 与 portal _render_footer_links() 同口径
5. **L-A R1+R4: LEGAL_PRIVACY_BASELINE 文档同步**
   - §6 移除孤儿 'admin' consent_channel 值 (代码侧从未实际产生)
   - §7 已具备/尚缺 重写, 显式归到 6/20 增量
6. **Q-A: tests/test_crowd_db_data_quality.py** — 8 个测试锁住
   - 27 省总数 + 仅湖南 high + 其它 26 省 ≤ usable
   - 高考生源大省 (广东/江苏/北京/上海/山东/河南/四川/湖北) 不在 high 集合
   - data_year=2025 (6/25 后需显式更新)

## 测试

- 4/4 RED → GREEN (admin/tests/test_health.py: JWT/admin password 拒绝 dev 默认值)
- 8/8 GREEN (data/crowd_db/tests/test_crowd_db_data_quality.py: 数据质量契约)
- 3 回归修复 (test_app.py + test_routes.py + test_health.py 适配新 /health checks 字段)
- 31/31 GREEN (admin/tests/test_app.py + test_routes.py + test_health.py)

## 报告

- reports/LA_LEGAL_PRIVACY_PRE_AUDIT_2026-06-20.md (363 行, 9 风险 0 阻塞)
- reports/QA_CROWD_DB_NON_HUNAN_DENSITY_AUDIT.md (45 行, CRITICAL 文档失真已规避)

## 文件

M CHANGELOG.md (v2.1.3)
M admin/config.py (2 个 _enforce_*_policy + load_settings post-load)
M admin/routes/health.py (3 个 _check_* + checks 子对象)
M admin/routes/ui.py (admin/orders/new 模板加 footer)
M admin/static/dashboard.html (footer 块)
M admin/tests/test_app.py (适配 checks 字段 + regex 兼容)
M admin/tests/test_health.py (4 个新测试)
M admin/tests/test_routes.py (适配 checks 字段)
M docs/CURRENT_STATE.md (0.3-0.5 增量段)
M docs/LEGAL_PRIVACY_BASELINE.md (§6 清理 + §7 重写)
+ data/crowd_db/tests/test_crowd_db_data_quality.py (8 tests)
+ reports/LA_LEGAL_PRIVACY_PRE_AUDIT_2026-06-20.md
+ reports/QA_CROWD_DB_NON_HUNAN_DENSITY_AUDIT.md
2026-06-20 18:36:23 +08:00
Hermes Agent
25a84c426b feat(admin): add hidden dashboard seed-order tools
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
- add hidden dev-only seed endpoint /api/admin/orders/dev-seed
  - overdue_pending_once: create one 2-day-old pending order with draft intake
  - cleanup_demo_seed: delete demo-tagged seeded orders
- restrict hidden seed route to non-prod env
- avoid decrypting all orders during cleanup; query ids/tags directly from SQL
- dashboard hidden entry:
  - title id=dashboard-title
  - dev-seed-panel hidden by default
  - opens via 5 title clicks or ?seed-tools=1
  - buttons: 补 1 笔超时待办 / 清理演示造数
- dashboard JS:
  - postDevSeed()
  - panel show/hide
  - refresh dashboard after seed/cleanup
- tests:
  - route auth + create/cleanup flow
  - dashboard HTML/JS structure assertions
  - admin UI page exposes hidden entry markup
- verification:
  - pytest 69 passed
  - browser: ?seed-tools=1 展开面板, 补造后 pending=8 overdue=1 missing=8, 清理后恢复 pending=7 overdue hidden
2026-06-17 10:42:14 +08:00
Hermes Agent
fd7174a70e feat(stats+dashboard): expand pending_orders into 3 actionable dimensions
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
## 后端 admin/stats.py
- compute_summary 在单条聚合 SQL 中加两个新字段:
  - pending_overdue_24h: status='pending' AND created_at < (now - 24h)
    (超时未付,需主动催付)
  - pending_missing_intake: status='pending' AND
    (order_intakes 无记录 OR order_intakes.status='draft')
    (资料待补,需主动跟进)
- LEFT JOIN order_intakes AS i ON i.order_id = orders.id
- 关键 bug 修复: SQL ? 顺序与参数顺序必须匹配,
  (overdue_cutoff 在 IN 子句后) 之前误用 (overdue_cutoff, *_REVENUE_STATUSES)
  导致 overdue_cutoff datetime 字符串误入 IN 子句,
  'completed' 误入 created_at < ? 子句, 收入少算 30%。
  已修正为 (*_REVENUE_STATUSES, overdue_cutoff)
- 列名全部限定为 orders.status / orders.created_at,避免与 i.status 歧义

## 前端 admin/static/dashboard.html
- KPI 4 待处理订单卡加 .pending-breakdown 区域
- 两个 pill 标签: pending-tag-overdue(红色,超时) + pending-tag-missing(橙色,资料待补)
- 仅在对应字段 > 0 时才显示
- CSS .pending-tag[hidden] { display: none; } 确保 hidden 属性生效

## 前端 admin/static/dashboard.js
- renderSummary 新增 pending_overdue_24h / pending_missing_intake 渲染
- 至少一个非零才展开 breakdown 区域

## 测试
- conftest.py orders_db fixture 同时建 order_intakes 表,避免 LEFT JOIN 缺表
- test_routes_stats_dashboard.py:
  - test_dashboard_empty_db_shape 锁住 summary 必须含 12 字段
  - test_dashboard_summary_pending_orders 更新 revenue 期望 (paid + serving 计入)
  - 新增 test_dashboard_summary_pending_overdue_24h (2天前 vs 12h前)
  - 新增 test_dashboard_summary_pending_intake (submitted/draft/无 intake 4 种组合)
- test_app.py 加 pending-breakdown 结构断言
- pytest 52 passed

## 真实环境验证
- admin/test-pass-123 登录后:
  pending=7 overdue=0 missing_intake=7
- 视觉验证: KPI 4 显示 '7' 主值 + '资料待补 7' 橙色 pill
  '超时' pill 因 overdue=0 自动隐藏
- 数据一致性: by_status.pending=7 与 summary.pending_orders=7 一致
2026-06-16 21:48:18 +08:00
Hermes Agent
1111bec32a feat(frontend): overhaul /dashboard layout, status badge, and empty states
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
- /dashboard 顶部加 system-status 徽章:尚未连接 / 已连接 / 异常 三态,背景渐变 + 圆点 + 元数据
- 顶部右侧加 quick-refresh / quick-logout 两个语义化动作
- 头部把原 3 个内嵌链接改成 quick-links pill 行,更专业
- 登录区加 id=login-form 与 aria-label,登录成功后自动折叠
- KPI 4 卡:订单数/收入/后台可登录用户/待处理订单
  - 每张卡片有 pill 标签与 data-card 钩子
  - 订单/收入两张卡加 spark 骨架线,登录后变 loaded
  - 空状态文案统一为「登录后查看 · 」
- 趋势图与 3 个分布图统一加 chart-empty 组件,未加载/无数据时显示占位
- JS:
  - 加 setStatus / setChartEmpty / markCardsLoading / markCardsEmpty
  - 失败或登出时统一清空所有图表并重置为占位
  - renderBarChart 在 dataMap 全为 0 时自动走空状态
  - 保留 sessionStorage,保留 localStorage 黑名单
  - 修复 pending_orders 的算式 bug
- 测试:test_app.py 加 system-status / quick-links / data-card / chart-empty / spark 等新结构断言,锁住产品化文案
2026-06-16 20:33:06 +08:00
Hermes Agent
40ee7f4dc0 feat(frontend): complete local UI remediation for web, portal, and dashboard
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
2026-06-16 15:02:01 +08:00
Hermes Agent
9d239fe2c3 feat(t12): harden public checkout and add admin manual order page
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
2026-06-16 12:16:45 +08:00
Hermes Agent
3f46811e49 release: cut v2.1
Some checks failed
CI / pytest (Python 3.10) (push) Has been cancelled
CI / pytest (Python 3.11) (push) Has been cancelled
CI / pytest (Python 3.12) (push) Has been cancelled
2026-06-13 14:49:58 +08:00