feat: apply gui semantic risk colors
This commit is contained in:
+14
@@ -932,3 +932,17 @@
|
||||
- CDP:`app/editor.py` 只给 `apply_task()` 增加可选 `on_step` 回调,用于上报 `open_product/change_title/replace_cover/click_update`,不改选择器、上传方式、确认框点击或提交逻辑。
|
||||
- 安全:DB 业务日志和本地 `logs/cmshopee.log` 均通过现有脱敏工具处理,不记录 Cookie、密码、API Key、token;异常路径本地日志保留脱敏 traceback。
|
||||
- 测试:新增/更新 `tests/test_gui.py` 覆盖 import/write_back/apply/chrome_launch/login_check/ai_model_test 运行日志和本地日志脱敏;`python -m py_compile app\gui.py app\editor.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p test_gui.py` 通过(63 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(151 tests);`git diff --check` 无空白错误,仅 LF/CRLF 提示。
|
||||
## 【2026-07-01】T-511 完成 · 语义色板与任务状态列上色
|
||||
|
||||
- 范围:按 `docs/ui-color-design.md` 落地第一步状态列上色,只改 GUI 展示层,不改 CDP、Shopee 提交流程、DB schema 或业务状态流转。
|
||||
- 代码:`app/gui.py` 顶部新增统一语义色板常量(success/danger/info/pending/muted/warning/danger-bg),`TaskTableModel`、`GenerateTaskTableModel`、`ApplyTaskTableModel` 在状态相关列响应 `Qt.ForegroundRole`,按内部 `stage/status` 返回 `QColor`;完成态用 success、失败用 danger、略过/取消用 muted、待处理用 pending、进行中用 info,不按中文显示文案硬匹配,不给普通行刷底色。
|
||||
- 测试:`tests/test_gui.py` 新增状态列前景色断言,覆盖①待采集/未匹配、②待生成/已生成/失败、③待更新/失败/已更新。
|
||||
- 验证:`python -m py_compile app\gui.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p "test_gui.py"` 通过(63 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(151 tests)。测试输出仍有 PySide6 字体目录提示,不影响结果。
|
||||
- 下一步:T-512「③高风险按钮上色 + ①导入校验数字标红」。
|
||||
## 【2026-07-01】T-512 完成 · 高风险按钮与导入校验数字标红
|
||||
|
||||
- 范围:按 `docs/ui-color-design.md` 落地第二步颜色优化,只改 GUI 样式层,不改 Tab 名、不改 CDP、Shopee 提交流程、DB schema 或业务状态流转。
|
||||
- 代码:③「开始更新」按钮使用 warning `#bc4c00` 文字和描边,保留「停止」中性;①导入汇总使用 rich text 将无效行数 >0、未匹配数 >0 标为 danger `#cf222e`;未匹配按钮 >0 时同样使用 danger 描边/文字并保持可点击筛出,=0 时清空样式并禁用;无效行仅标红提示,不新增筛表入口。
|
||||
- 测试:`tests/test_gui.py` 新增开始更新按钮 warning 样式、未匹配按钮 danger 样式、无效行 rich text danger 标记断言。
|
||||
- 验证:`python -m py_compile app\gui.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p "test_gui.py"` 通过(63 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(151 tests)。测试输出仍有 PySide6 字体目录提示,不影响结果。
|
||||
- 下一步:T-513「登录点 / ③Tab危险标识 / 破坏性按钮上色」。
|
||||
|
||||
Reference in New Issue
Block a user