chore: rebrand display name for T-537
@@ -4,7 +4,7 @@
|
||||
|
||||
## 项目定位
|
||||
|
||||
cmshopee 是一个 **Windows 本地桌面自动化工具**:管理多个 Shopee 卖家账号,用 CDP 驱动 Chrome 自动改商品标题、换商品封面。当前单账号流程已验证,正在扩展多账号管理与 GUI。
|
||||
蝦皮圈優化助手(代号 cmshopee)是一个 **Windows 本地桌面自动化工具**:管理多个 Shopee 卖家账号,用 CDP 驱动 Chrome 自动改商品标题、换商品封面。当前单账号流程已验证,正在扩展多账号管理与 GUI。
|
||||
|
||||
## 文档位置
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# 蝦皮圈優化助手
|
||||
|
||||
蝦皮圈優化助手(代号 cmshopee)是一个 Windows 本地桌面自动化工具,用于管理多个 Shopee 卖家账号,并用 CDP 驱动 Chrome 自动改商品标题、换商品封面。
|
||||
@@ -32,7 +32,7 @@ if QT_IMPORT_ERROR is None:
|
||||
else:
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
raise RuntimeError("PySide6 未安装,无法启动 GUI")
|
||||
raise RuntimeError("蝦皮圈優化助手 GUI 无法启动:当前 Python 环境未安装 PySide6。")
|
||||
|
||||
|
||||
def _ensure_offscreen_for_headless_tests():
|
||||
@@ -42,7 +42,7 @@ def _ensure_offscreen_for_headless_tests():
|
||||
|
||||
def main() -> int:
|
||||
if QT_IMPORT_ERROR is not None:
|
||||
print("cmshopee GUI 无法启动:当前 Python 环境未安装 PySide6。")
|
||||
print("蝦皮圈優化助手 GUI 无法启动:当前 Python 环境未安装 PySide6。")
|
||||
return 1
|
||||
_ensure_offscreen_for_headless_tests()
|
||||
app = QApplication.instance() or QApplication(sys.argv)
|
||||
|
||||
@@ -25,7 +25,7 @@ class MainWindow(QMainWindow):
|
||||
or self.config.get("ai_models_path")
|
||||
or appconfig.AI_MODELS_PATH
|
||||
)
|
||||
self.setWindowTitle("cmshopee")
|
||||
self.setWindowTitle("蝦皮圈優化助手")
|
||||
self.resize(1180, 760)
|
||||
self.setStyleSheet(BUTTON_BASE_STYLE)
|
||||
self._settings_tab_index = TAB_TITLES.index("⑤ 设置")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
## 一句话定位
|
||||
|
||||
cmshopee 是一个 Windows 本地桌面自动化工具(PySide6,5 Tab),让运营管理多个 Shopee 账号,并用 CDP 驱动 Chrome + AI 批量改商品标题、换商品封面。
|
||||
蝦皮圈優化助手(代号 cmshopee)是一个 Windows 本地桌面自动化工具(PySide6,5 Tab),让运营管理多个 Shopee 账号,并用 CDP 驱动 Chrome + AI 批量改商品标题、换商品封面。
|
||||
|
||||
5 Tab 流水线(工作流优先顺序):
|
||||
**① 导入采集 → ② AI生成 → ③ 更新shopee → ④ 账号管理 → ⑤ 设置**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## 一、核心目标
|
||||
|
||||
cmshopee 要解决:**运营要在多个 Shopee 卖家账号下,逐个商品手动改标题、换封面,效率低、易出错、来回切换登录痛苦**。
|
||||
蝦皮圈優化助手(代号 cmshopee)要解决:**运营要在多个 Shopee 卖家账号下,逐个商品手动改标题、换封面,效率低、易出错、来回切换登录痛苦**。
|
||||
|
||||
> 让**电商运营**能够在一个工具里集中管理多个 Shopee 账号,并自动完成商品标题修改和封面图替换,无需反复登录、手动逐项操作。
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
| ID | 任务 | 依赖 | 验收要点 | 状态 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| T-525 | 引入 ruff(lint + format)+ 可选 pre-commit | T-006 | 依据 `docs/engineering-review.md` P1。加 `ruff` 配置(lint + format),先以现状为基线不做大规模风格重排,只开启安全规则(未用 import/变量、明显错误);可选 `.pre-commit-config.yaml`;不改业务逻辑;CI(T-522)可串入 ruff 检查。数据模型渐进上 mypy 作为后续可选。当前因业务优先级调整顺延到 T-526~T-528 之后 | TODO |
|
||||
| T-537 | 品牌名「蝦皮圈優化助手」(显示层中文品牌,cmshopee 保留为代号/标识符) | T-523 | 需求:项目/软件正式定名「蝦皮圈優化助手」。**原则**:产品**显示/品牌名** = 「蝦皮圈優化助手」;`cmshopee` 保留为**代码库/仓库/技术代号**,一切**标识符不改**——遵项目「文档与 UI 文案用中文、标识符用英文」规则,且避免非 ASCII 文件名破坏现有用户数据。**改(显示/品牌层)**:① `app/gui/main_window.py` 窗口标题 `setWindowTitle("cmshopee")` → `"蝦皮圈優化助手"`(任务栏/标题栏显示中文品牌);② 文档产品名散文 `docs/00-ai-start-here.md`、`docs/README.md`、`AGENTS.md`(及 vision/brief 若有)把「cmshopee 是一个…」改为「蝦皮圈優化助手(代号 cmshopee)是一个…」,明确品牌名并保留代号;③ 空的 `README.md` 补品牌标题行;④ 可选:`app/gui/__init__.py` PySide6 缺失启动失败提示带上品牌名。**不改(技术标识符,保留 cmshopee)**:`app` 包名、`cmshopee.exe` 打包产物名、`cmshopee.db`(+`-wal/-shm`)/`db_path` 默认值、`cmshopee.spec`、`cmshopee.log`、`config.json`/`config/*.json` 文件名、slug/`chrome_user_data_dir`、仓库目录;`app/editor.py` 注入页面的 JS 全局 `window.__cmshopee_*`(JS 标识符须 ASCII)、`app/ai.py` multipart boundary `----cmshopee-*`、`app/workers.py` `thread._cmshopee_worker`、`app/chrome.py` 快捷方式内部前缀 `cmshopee-`。**决策点**:`app/excel.py` 回写文件名后缀 `_cmshopee回写` 为用户可见产物名——本任务**默认保留**(改动会影响已生成副本命名习惯),如需改「_優化助手回写」另行确认。**影响**:不改 db/exe/spec/包名 → 打包、更新流程、现有用户数据零影响。验收:窗口标题栏/任务栏/README/相关文档显示「蝦皮圈優化助手」;`cmshopee.db`/exe/包名不变;GUI 单测若断言窗口标题须同步更新;`python -m compileall app main.py` + `python -m unittest discover -s tests` 全绿。边界:纯显示/文档层,不改任何文件名、schema、流程、CDP/Shopee 逻辑 | TODO |
|
||||
| T-537 | 品牌名「蝦皮圈優化助手」(显示层中文品牌,cmshopee 保留为代号/标识符) | T-523 | 需求:项目/软件正式定名「蝦皮圈優化助手」。**原则**:产品**显示/品牌名** = 「蝦皮圈優化助手」;`cmshopee` 保留为**代码库/仓库/技术代号**,一切**标识符不改**——遵项目「文档与 UI 文案用中文、标识符用英文」规则,且避免非 ASCII 文件名破坏现有用户数据。**改(显示/品牌层)**:① `app/gui/main_window.py` 窗口标题 `setWindowTitle("cmshopee")` → `"蝦皮圈優化助手"`(任务栏/标题栏显示中文品牌);② 文档产品名散文 `docs/00-ai-start-here.md`、`docs/README.md`、`AGENTS.md`(及 vision/brief 若有)把「cmshopee 是一个…」改为「蝦皮圈優化助手(代号 cmshopee)是一个…」,明确品牌名并保留代号;③ 空的 `README.md` 补品牌标题行;④ 可选:`app/gui/__init__.py` PySide6 缺失启动失败提示带上品牌名。**不改(技术标识符,保留 cmshopee)**:`app` 包名、`cmshopee.exe` 打包产物名、`cmshopee.db`(+`-wal/-shm`)/`db_path` 默认值、`cmshopee.spec`、`cmshopee.log`、`config.json`/`config/*.json` 文件名、slug/`chrome_user_data_dir`、仓库目录;`app/editor.py` 注入页面的 JS 全局 `window.__cmshopee_*`(JS 标识符须 ASCII)、`app/ai.py` multipart boundary `----cmshopee-*`、`app/workers.py` `thread._cmshopee_worker`、`app/chrome.py` 快捷方式内部前缀 `cmshopee-`。**决策点**:`app/excel.py` 回写文件名后缀 `_cmshopee回写` 为用户可见产物名——本任务**默认保留**(改动会影响已生成副本命名习惯),如需改「_優化助手回写」另行确认。**影响**:不改 db/exe/spec/包名 → 打包、更新流程、现有用户数据零影响。验收:窗口标题栏/任务栏/README/相关文档显示「蝦皮圈優化助手」;`cmshopee.db`/exe/包名不变;GUI 单测若断言窗口标题须同步更新;`python -m compileall app main.py` + `python -m unittest discover -s tests` 全绿。边界:纯显示/文档层,不改任何文件名、schema、流程、CDP/Shopee 逻辑 | DONE |
|
||||
| T-538 | 打包产物用户数据收进 `data/` 子文件夹(便携方案 1) | T-524 | 问题:当前 onedir 产物把用户数据(`config.json`、`config/ai_models.json`、`config/cmhub.json`、`cmshopee.db(+-wal/-shm)`、`chrome_user_data_dir/`、`images/`、`logs/`、`prompts/`、`title_prompt.txt`)生成在 exe 顶层,和程序文件(`cmshopee.exe`+`_internal/`)混放:更新易误删数据、放进 Program Files 只读目录会写失败/被 VirtualStore 重定向、程序与数据关注点混杂。方案(保持便携):① **统一数据根**——所有用户数据落到 exe 同级的单个 `data/` 子文件夹;`app/appconfig.py` 用显式 `data_dir`(默认 `<exe目录>/data`,源码运行时可为项目根/`data`)解析并返回绝对路径,**替代现在 `main.py` 的 chdir**(chdir 影响全进程相对路径/文件对话框默认目录,脆弱);文件名保持不变(仍是 `cmshopee.db` 等),只是移入 `data/`。② **旧布局迁移**——新版首次运行若在 exe 顶层发现旧的 `config.json`/`cmshopee.db` 等,自动迁移进 `data/`(或明确提示手动迁移),不得对老用户生成空 `data/` 丢失原数据。③ **可写性检测**——启动时若 `data_dir` 不可写(如放在 Program Files),弹清晰错误「请把程序放到可写目录,勿放 Program Files」并优雅退出,不静默失败。④ **发布只含程序**——`cmshopee.spec`/`scripts/build_exe.ps1` 产物仅 `cmshopee.exe`+`_internal/`,构建检查确保不打包 `data/` 或任何用户数据;发布 zip 不含 `data/`,从而「整包解压覆盖」也安全(只覆盖程序、不碰 `data/`)。⑤ **更新流程前提**——原地更新=换程序留 `data/`,依赖:DB 迁移幂等且只向前(现 `init_db`+`ALTER TABLE ADD COLUMN`)、`config` 向前兼容(`load_config` 补默认值)、`_internal/` 整体替换不合并。同步更新 `docs/packaging.md`(目录结构、首次运行数据位置、§5 更新步骤简化为「覆盖 exe+_internal,`data/` 不动」)。测试:`test_appconfig` 断言各路径解析进 `data_dir`、可写性检测行为、旧布局迁移;`test_packaging` 断言产物不含 `data/`/用户数据。边界:只改路径解析层(`appconfig` 路径 + `main.py` 数据根 + 迁移/可写检测)、spec/构建脚本、打包文档;不改文件名、DB schema、业务逻辑、AI/Excel、CDP/Shopee 流程 | TODO |
|
||||
|
||||
## 里程碑
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# 项目文档导航
|
||||
|
||||
> cmshopee 的 harness coding 文档集合。agent 开始编程前从 [`00-ai-start-here.md`](00-ai-start-here.md) 进入。
|
||||
> 蝦皮圈優化助手(代号 cmshopee)的 harness coding 文档集合。agent 开始编程前从 [`00-ai-start-here.md`](00-ai-start-here.md) 进入。
|
||||
|
||||
## 一句话定位
|
||||
|
||||
cmshopee 是一个给**电商运营**使用的 Windows PySide6 桌面自动化工具,用于**管理多个 Shopee 卖家账号、并用 CDP 驱动 Chrome 批量修改商品标题、替换商品封面图**。V0 已验证单账号「改标题 + 换封面」闭环;当前 V1 目标是 5 Tab 流水线:导入采集 → AI 生成 → 点击「开始更新」并确认后批量提交 → 回写结果。
|
||||
蝦皮圈優化助手(代号 cmshopee)是一个给**电商运营**使用的 Windows PySide6 桌面自动化工具,用于**管理多个 Shopee 卖家账号、并用 CDP 驱动 Chrome 批量修改商品标题、替换商品封面图**。V0 已验证单账号「改标题 + 换封面」闭环;当前 V1 目标是 5 Tab 流水线:导入采集 → AI 生成 → 点击「开始更新」并确认后批量提交 → 回写结果。
|
||||
|
||||
## 文档导航
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# UI 效果图(SVG 线框)
|
||||
|
||||
cmshopee 5 Tab 桌面应用的界面效果图。SVG 可用浏览器直接打开查看。
|
||||
蝦皮圈優化助手 5 Tab 桌面应用的界面效果图。SVG 可用浏览器直接打开查看。
|
||||
|
||||
| 文件 | 内容 |
|
||||
| --- | --- |
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</style>
|
||||
</defs>
|
||||
<rect class="bg" x="0.5" y="0.5" width="939" height="419" rx="10"/>
|
||||
<text class="h1" x="24" y="40">cmshopee · 5 Tab 流水线总览</text>
|
||||
<text class="h1" x="24" y="40">蝦皮圈優化助手 · 5 Tab 流水线总览</text>
|
||||
<text class="sub" x="24" y="60">工作流优先顺序 · 对象是 Excel 里的每一行任务 · 状态字段 stage 贯穿全程</text>
|
||||
|
||||
<!-- stage chips row (无 confirmed、无常驻提交开关;③ 开始更新需批量确认) -->
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
@@ -25,7 +25,7 @@
|
||||
<rect class="win" x="0.5" y="0.5" width="939" height="619" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="0.5" width="939" height="40" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="20" width="939" height="21"/>
|
||||
<text class="title" x="18" y="26">cmshopee · Shopee 商品批量改标题换封面</text>
|
||||
<text class="title" x="18" y="26">蝦皮圈優化助手 · Shopee 商品批量改标题换封面</text>
|
||||
<circle cx="888" cy="20" r="6" fill="#f5bf4f"/><circle cx="910" cy="20" r="6" fill="#5ac26a"/><circle cx="866" cy="20" r="6" fill="#e0e4ea"/>
|
||||
|
||||
<!-- tab strip -->
|
||||
|
||||
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.5 KiB |
@@ -12,7 +12,7 @@
|
||||
</defs>
|
||||
<rect class="win" x="0.5" y="0.5" width="939" height="619" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="0.5" width="939" height="40" rx="8"/><rect class="hd" x="0.5" y="20" width="939" height="21"/>
|
||||
<text class="title" x="18" y="26">cmshopee · Shopee 商品批量改标题换封面</text>
|
||||
<text class="title" x="18" y="26">蝦皮圈優化助手 · Shopee 商品批量改标题换封面</text>
|
||||
<circle cx="888" cy="20" r="6" fill="#f5bf4f"/><circle cx="910" cy="20" r="6" fill="#5ac26a"/><circle cx="866" cy="20" r="6" fill="#e0e4ea"/>
|
||||
|
||||
<rect class="tab" x="0.5" y="41" width="939" height="38"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
@@ -9,7 +9,7 @@
|
||||
</style></defs>
|
||||
<rect class="win" x="0.5" y="0.5" width="939" height="619" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="0.5" width="939" height="40" rx="8"/><rect class="hd" x="0.5" y="20" width="939" height="21"/>
|
||||
<text class="title" x="18" y="26">cmshopee · Shopee 商品批量改标题换封面</text>
|
||||
<text class="title" x="18" y="26">蝦皮圈優化助手 · Shopee 商品批量改标题换封面</text>
|
||||
<circle cx="888" cy="20" r="6" fill="#f5bf4f"/><circle cx="910" cy="20" r="6" fill="#5ac26a"/><circle cx="866" cy="20" r="6" fill="#e0e4ea"/>
|
||||
|
||||
<rect class="tab" x="0.5" y="41" width="939" height="38"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
@@ -9,7 +9,7 @@
|
||||
</style></defs>
|
||||
<rect class="win" x="0.5" y="0.5" width="939" height="619" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="0.5" width="939" height="40" rx="8"/><rect class="hd" x="0.5" y="20" width="939" height="21"/>
|
||||
<text class="title" x="18" y="26">cmshopee · Shopee 商品批量改标题换封面</text>
|
||||
<text class="title" x="18" y="26">蝦皮圈優化助手 · Shopee 商品批量改标题换封面</text>
|
||||
<circle cx="888" cy="20" r="6" fill="#f5bf4f"/><circle cx="910" cy="20" r="6" fill="#5ac26a"/><circle cx="866" cy="20" r="6" fill="#e0e4ea"/>
|
||||
|
||||
<rect class="tab" x="0.5" y="41" width="939" height="38"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -9,7 +9,7 @@
|
||||
</style></defs>
|
||||
<rect class="win" x="0.5" y="0.5" width="939" height="619" rx="8"/>
|
||||
<rect class="hd" x="0.5" y="0.5" width="939" height="40" rx="8"/><rect class="hd" x="0.5" y="20" width="939" height="21"/>
|
||||
<text class="title" x="18" y="26">cmshopee · Shopee 商品批量改标题换封面</text>
|
||||
<text class="title" x="18" y="26">蝦皮圈優化助手 · Shopee 商品批量改标题换封面</text>
|
||||
<circle cx="888" cy="20" r="6" fill="#f5bf4f"/><circle cx="910" cy="20" r="6" fill="#5ac26a"/><circle cx="866" cy="20" r="6" fill="#e0e4ea"/>
|
||||
|
||||
<rect class="tab" x="0.5" y="41" width="939" height="38"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -1263,3 +1263,11 @@
|
||||
- 边界:只改 GUI 样式层;未改按钮行为、启用/禁用逻辑、DB、Excel、Shopee/CDP 或 AI 流程。
|
||||
- 测试:`tests/test_gui.py` 补充全局 `QPushButton` 基础样式断言,并确认 warning/danger 按钮保留语义色但不再各自硬写 `border-radius`/`padding`。
|
||||
- 验证:`python -m py_compile app\gui\widgets.py app\gui\main_window.py app\gui\tabs\apply.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p test_gui.py` 通过(95 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过(212 tests)。
|
||||
|
||||
## 【2026-07-07】T-537 完成 · 品牌名显示为蝦皮圈優化助手
|
||||
|
||||
- 状态:DONE
|
||||
- 文档:`docs/06-tasks.md` 将 T-537 标记为 DONE;`README.md` 新增中文品牌入口;`AGENTS.md`、`docs/00-ai-start-here.md`、`docs/README.md`、`docs/01-vision.md`、`docs/ui/` 线框图和 `docs/current-state.md` 已把产品显示名更新为「蝦皮圈優化助手(代号 cmshopee)」。
|
||||
- 代码:`app/gui/main_window.py` 主窗口标题改为「蝦皮圈優化助手」;`app/gui/__init__.py` 的 PySide6 缺失启动提示带上中文品牌名;`tests/test_gui.py` 补充窗口标题断言。
|
||||
- 边界:只改显示层和文档层;`cmshopee` 继续作为仓库、包名、exe、数据库、日志、配置、回写后缀和兼容标识符保留;未改任何文件名、schema、AI、Excel、DB、CDP 或 Shopee 更新流程。
|
||||
- 验证:`python -m py_compile app\gui\main_window.py app\gui\__init__.py tests\test_gui.py` 通过;`python -m unittest discover -s tests -p test_gui.py` 通过(95 tests);`python -m compileall app main.py` 通过;`python -m unittest discover -s tests` 通过;`git diff --check` 通过。
|
||||
|
||||
@@ -156,6 +156,7 @@ class GuiTests(TempDirMixin, unittest.TestCase):
|
||||
window = MainWindow(config=self.make_config(temp_dir))
|
||||
self.addCleanup(window.close)
|
||||
|
||||
self.assertEqual("蝦皮圈優化助手", window.windowTitle())
|
||||
self.assertEqual(5, window.tabs.count())
|
||||
self.assertEqual(
|
||||
TAB_TITLES,
|
||||
|
||||