Files
notebook-snapshot-extension/TODO.md
T
tao.chenandClaude 5ae9f94023 docs: add TODO.md (pending items, prioritized by user value)
Captures the open work items raised across earlier sessions:
- S3 consistency fix (return list in commit response — the real
  workaround behind the 'refresh button' shim)
- POST /notebook-version/restore endpoint (deferred in design.md)
- Settings schema (schema/plugin.json is currently empty)
- jest + pnpm linker incompatibility (blocks jlpm test)
- Frontend diff.ts unit tests (blocked on the jest fix)
- ui-tests (Playwright + Galata)
- CI pytest step
- v0.0.1 tag + PyPI release

Each item is labeled with trigger conditions (what real user need
would justify doing it) so we don't gold-plate features.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-21 18:44:03 +08:00

75 lines
3.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# TODO
待办项,**按用户需求驱动**——别凭空虚构。完成一项后:勾选 + 改 CHANGELOG + 在 commit message 引用本节。
> 用户视角(配置 / 安装)见 [README.md](README.md)。设计目标见 [design.md](design.md)。工程手册见 [DEVELOPER.md](DEVELOPER.md)。
## 后端
- [ ] **`POST /notebook-version/restore` 端点**design.md 里标"暂缓"
- 现状:restore 走纯前端 `model.fromJSON()` + `context.save()`,只能恢复**当前打开的** notebook
- 端点能力:脚本/CLI 调 API 恢复任意路径的 notebook;删了的 notebook 从 S3 拉回
- 必须走 `ContentsManager.write`(不能直接写文件),要处理权限 / 文件锁 / 并发
- 估计:~50 行 Python + ~30 行测试
- 触发条件:团队有 CI 灾备 / 批量恢复需求
- [ ] **修复 S3 提交后 list 偶发返回旧 manifest**
- 根因:commit 写 manifest 后前端独立发 list;某些 S3 兼容服务(MinIO / Ceph RGW / 阿里云 OSS 等)实现各异,强一致性不保证
- 方案:把 list 塞进 commit 响应(commit 写完立刻在同进程内 list 一定是最新),省掉独立 GET
- 估计:~30 行(改 commit 响应 + 前端 `setVersions` 直写 + 测试)
- 临时缓解:侧边栏「刷新」按钮(已加)
## 前端
- [ ] **`schema/plugin.json` settings schema**
- 现状:空 schema,插件激活时只 `console.log` settings,无任何可配置项
- 候选配置:`confirmRestore` / `defaultDescription` / `maxVersionsToShow` / `commitShortcut` / `skipDuplicate`
- 估计:~100 行(schema.json + 前端读 settings + 一个真用上的配置项)
- 触发条件:真有用户想调参再加
- [ ] **修复 jest 在 pnpm 链接器下跑不起来**
- 根因:`.yarnrc.yml``yarnLinker: pnpm`,虚拟存储把 `ts-jest``jest-util` 隔开
- 当前绕过:`jlpm build`tsc 严格 + rspack)验证前端
- 方案 A:改 `.yarnrc.yml``nodeLinker: node-modules`(影响整个 monorepo 解析)
- 方案 B:完全重写 `jest.config.js` 不依赖 `@jupyterlab/testing` 的 baseConfig
- 估计:A 1 行;B 半日
- [ ] **前端 diff 逻辑单测**
- `src/diff.ts` 是纯函数,最值得测;目前没有单测跑(受上面 jest 故障牵连)
- 估计:跟 jest 修复一起做,~50 行测试
## 测试 / CI
- [ ] **ui-testsPlaywright + Galata)跑通**
- 当前:`ui-tests/` 目录有但 README 里有 yarn.lock 是空的,从未跑过
- 前置:先把 jest 修通,CI 工作流 `.github/workflows/build.yml` 跑通
- 估计:跟 CI 一起做,~2-3 天
- [ ] **CI 流水线加后端 pytest**
- 当前 `.github/workflows/build.yml` 没看到 pytest 步骤
- 估计:~10 行 yaml
## 发布
- [ ] **v0.0.1 tag + 推送到 origin**
```bash
git tag v0.0.1
git push origin main --tags
```
- [ ] **v0.0.1 wheel 发布到 PyPI**(如需)
- `python -m build` 出 wheelhatch 自动嵌前端)
- `twine upload dist/*`
- 触发条件:要让别人 `pip install snapshot` 装上
## 优先级
按"真实价值"排:
1. 修 S3 一致性(用户已报告的 bug 根因)
2. v0.0.1 tag(当前未发版)
3. jest 修复 + 前端单测(解锁 `jlpm test` 工作流)
4. CI 加 pytest
5. settings schema / restore 端点(按需)
6. ui-tests(锦上添花)