Add a scaffold script that replaces the bq prefix with the new project name.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
bql
2026-10-27 22:46:06 +08:00
commit bc84c95a89
128 changed files with 9700 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
# 撤销与重做
## 目录
- [业务定义](#业务定义)
- [时序](#时序)
## 业务定义
编辑器请求 `Project` 后退或前进一份文档,并把聚合保存。快照由 `Project` 持有。
本事件使用 `EditorViewModel` 的 `undo`、`redo`。
## 时序
```mermaid
sequenceDiagram
participant EditorPage
participant EditorViewModel
participant Project
participant ProjectApplication
EditorPage->>EditorViewModel: undo()
EditorViewModel->>Project: undo()
EditorViewModel->>ProjectApplication: save(store, project)
EditorPage->>EditorViewModel: redo()
EditorViewModel->>Project: redo()
EditorViewModel->>ProjectApplication: save(store, project)
```
`Project.undo` 没有更早的快照时返回失败,页面不调用 `save`。成功时聚合把当前文档换回上一份快照。`Project.redo` 没有更新的快照时同样不保存。成功时聚合恢复下一份快照。两次成功之后都按 `store` 调用 `ProjectApplication.save`。