feat: the terminal, project knowledge, and downloads that can be cancelled
- lib/api/terminal.dart: the PTY protocol (create/resize/restart/close, and the /api/terminal/ws binary control frames) with a reconnecting socket that replays the server snapshot at the size it was drawn for. - lib/terminal_state.dart: an xterm model plus that socket, kept per workspace on AppState, so closing the panel or switching tabs keeps the shell; the app reattaches when it returns from the background. - lib/screens/terminal_panel.dart: TerminalView, a status bar (keyboard, restart, clear, close) and a Termux-style key bar whose CTRL/ALT/SHIFT modifiers also apply to what the phone keyboard types. - lib/screens/knowledge_panel.dart: notes, todos and plans from /api/project-context, searchable, with a full page for a plan's Markdown and its raw editor. - Downloads stream with a progress dialog (bytes, total, percent) and a cancel that aborts the request; the save dialog only opens on success. The request asks for `accept-encoding: identity` so Content-Length exists. - MarkdownView renders task lists as ✅/⬜ instead of material_ui's Checkbox, which wants a material_ui Material ancestor the app lacks. - Dialogs own their TextEditingControllers, so closing one no longer trips a framework assertion in debug builds. - 0.3.11 (311).
This commit is contained in:
1 parent
60d02083d3
commit
5f95e2da97
14 files changed
+2347
-57
No files matched your search
@@ -5,6 +5,20 @@
|
||||
|
||||
---
|
||||
|
||||
## 0.3.11 终端、项目知识与下载进度(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
| --- | --- |
|
||||
| 终端 | 右侧栏「终端」页:`POST /api/terminal/create` 建 PTY(cwd = 会话目录),`/api/terminal/ws` 走二进制控制帧(`0x01` + JSON:hello/attach/write/ping,snapshot/output/restart/exit/error)。渲染用 **xterm 4.0.0**(`Terminal` 模型 + `TerminalView`),断线按 500ms 起指数退避重连、重连后按服务端快照重放(先 `resize` 到快照尺寸再写历史);`/api/terminal/:id/resize` 做 250ms 去抖;App 回前台时自动重连 |
|
||||
| 底栏 | 仿 Termux 的按键条(横向滚动):CTRL / ALT / SHIFT 修饰键,ESC、TAB、方向键、HOME/END/PGUP/PGDN/DEL,以及 `/ - \| ~ * $ # _ = + : ; " ' ( ) [ ] { } < > ? ! & \ ^ % @`;修饰键对**手机输入法**输入的字符同样生效(在 `onOutput` 里把下一个可打印字符映射成控制字符/ESC 前缀),按一次即清除 |
|
||||
| 状态 | 状态条显示「运行中 / 正在连接 / 已退出(退出码)/ 连接失败」,并提供键盘、重启、清屏、关闭终端;终端会话按目录保存在 `AppState.terminals`,关面板不断 shell,切换服务器时显式关闭 |
|
||||
| 项目知识 | 右侧栏「项目知识」页:`/api/project-context/:projectId`(projectId = `path_` + 目录 base64url);笔记(新建/编辑/置顶/删除)、待办(勾选、新建、删除,完成项沉底)、计划(新建、置顶、删除、打开全文);搜索框跨三种记录即时过滤;计划详情是全屏页(Markdown 渲染 + 编辑原文 + 保存) |
|
||||
| 下载进度 | `/api/fs/raw` 改为流式:`downloadFile` 带 `onProgress` 与 `CancelToken`,请求头 `accept-encoding: identity` 以拿到 `Content-Length`(gzip 会让响应变成 chunked,进度只能是不确定态);下载中弹「正在下载」对话框显示已下载/总量/百分比,取消即中止连接并丢弃结果;完成后才弹保存对话框 |
|
||||
| 修复 | `MarkdownView` 里的任务列表不再用 `material_ui` 的 Checkbox(它会找 `material_ui` 的 Material 祖先,应用里没有),改为 `✅`/`⬜` 文本;对话框里的 `TextEditingController` 改由对话框自身持有,避免关闭动画期间 dispose 触发框架断言 |
|
||||
| 版本 | **0.3.11(code 311)** |
|
||||
|
||||
---
|
||||
|
||||
## 0.3.10 Transport 层、历史图片、原生表单与左右分栏(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
|
||||
Reference in new issue
Block a user