37 lines
1.2 KiB
Markdown
37 lines
1.2 KiB
Markdown
# 推送页 B5 后增强 — 实施计划
|
|
|
|
**日期**: 2026-06-02
|
|
**设计**: `docs/design/specs/2026-06-02-push-post-b5-enhancements-design.md`
|
|
|
|
## 涉及文件
|
|
|
|
| 文件 | 变更 |
|
|
|------|------|
|
|
| `server/api/websocket.py` | `/ws/sync`、`nexus:sync`、`_dispatch_sync_message` |
|
|
| `server/background/upload_staging_cleanup.py` | 新建 |
|
|
| `server/main.py` | 注册清理任务、shutdown sync_manager |
|
|
| `frontend/src/composables/push/usePushProgress.ts` | WS URL |
|
|
| `frontend/src/composables/push/usePushPreview.ts` | 全量预览 |
|
|
| `frontend/src/components/push/PushPreviewDialog.vue` | 进度 UI |
|
|
| `tests/test_sync_websocket.py` | 新建 |
|
|
| `tests/test_upload_staging_cleanup.py` | 新建 |
|
|
|
|
## 步骤
|
|
|
|
1. 后端拆分 sync 广播与 Redis 频道
|
|
2. 注册 hourly cleanup 后台任务
|
|
3. 前端改 WS + 预览 UX
|
|
4. `ruff check` + `pytest` + `npm run build-only`
|
|
|
|
## 回滚
|
|
|
|
- Revert 上述文件;旧前端仍连 `/ws/alerts` 时推送进度不再更新(需同步回滚前后端)
|
|
|
|
## 验证
|
|
|
|
```bash
|
|
ruff check server/api/websocket.py server/background/upload_staging_cleanup.py server/main.py
|
|
pytest tests/test_sync_websocket.py tests/test_upload_staging_cleanup.py -q
|
|
cd frontend && npm run build-only
|
|
```
|