docs: add 2026-06-13 audit/changelog for files new-file fix deploy gate.

This commit is contained in:
Nexus Agent
2026-06-13 09:09:01 +08:00
parent 72042598b0
commit feb776616f
2 changed files with 65 additions and 0 deletions
@@ -0,0 +1,35 @@
# 审计 — 文件管理「新建文件」修复
**Changelog**: `docs/changelog/2026-06-13-files-new-file-fix.md`
## 变更文件
| 文件 | 说明 |
|------|------|
| `frontend/src/composables/files/useFilesActions.ts` | `openNewFileDialog`、等待编辑器就绪 |
| `frontend/src/composables/files/useFilesEditor.ts` | 导出 `waitForEditorWorkbench` |
| `frontend/src/composables/files/useFilesPage.ts` | 透传 helper |
| `frontend/src/components/files/FilesToolbar.vue` | 未选服务器时提示 |
| `server/infrastructure/ssh/asyncssh_pool.py` | SFTP 写前确保父目录 |
## Step 3(规则扫描)
| 规则 | 结论 | 说明 |
|------|------|------|
| 鉴权 | PASS | 仍走 `/sync/write-file` + admin JWT |
| 路径 | PASS | `validatePathSegment` 不变 |
| 静默失败 | PASS | 编辑器未就绪有 warning snackbar |
| SSH | PASS | `mkdir -p` 仅父目录 |
## Closure
| 文件 | 结论 |
|------|------|
| `useFilesActions.ts` | SAFE — snackbar 错误提示 |
| `asyncssh_pool.py` | SAFE — 复用 `_ensure_remote_parent_dir` |
## DoD
- [x] changelog + 本审计
- [x] frontend type-check
- [ ] 生产验证新建文件
@@ -0,0 +1,30 @@
# 2026-06-13 — 文件管理「新建文件」修复
## 摘要
修复文件页「新建文件」点击无反馈或创建后编辑器不弹出的问题。
## 动机
- 未选服务器时按钮被禁用,用户以为功能坏了
- 创建成功后未等待 `FileEditorWorkbench` 就绪即 `openFile`,编辑器静默不打开
- SFTP 写入前未确保父目录存在(部分路径下 write-file 失败)
## 涉及文件
- `frontend/src/composables/files/useFilesActions.ts``openNewFileDialog``waitForEditorWorkbench`
- `frontend/src/composables/files/useFilesEditor.ts` — 导出 `waitForEditorWorkbench`
- `frontend/src/composables/files/useFilesPage.ts` — 透传 helper
- `frontend/src/components/files/FilesToolbar.vue` — 未选服务器时提示而非禁用
- `server/infrastructure/ssh/asyncssh_pool.py` — SFTP 写前 `mkdir -p` 父目录
## 迁移/重启
- 需重启 nexus 容器 + 同步前端
## 验证
```bash
cd frontend && npm run type-check
# 生产:文件管理 → 选服务器 → 新建文件 → 应创建并打开编辑器
```