feat: a new-session draft and a sidebar grouped by project
- Starting a session opens NewSessionScreen instead of a title sheet: a project chip (GET /api/project, one row per canonical), a model/agent chip, attachments and the composer. Nothing is created on the server until the first send, which posts the session with its directory, model and agent and then sends that message. - The draft lives in AppState (memory only): leaving it keeps it; the sidebar shows a draft row with its first line and a discard button; a failed create stays on the draft with its text. - The session list groups by project (chat folders under 聊天), dates the rows (今天/昨天/本周早些时候/更早), pins through session.metadata.openchamber.pinned, archives on demand, pages with "载入更多", and swipes to pin/archive/delete (flutter_slidable). - Child sessions are hidden; a parent's row shows its children's activity. - The chat app bar follows the live session list, so the title the server generates from the first message appears at once. - Attachments and the model picker move to shared widgets, used by the chat and the draft. - 0.3.13 (313).
This commit is contained in:
1 parent
5a371e4faf
commit
fff6562cbc
14 files changed
+1775
-366
No files matched your search
@@ -5,6 +5,21 @@
|
||||
|
||||
---
|
||||
|
||||
## 0.3.13 草稿会话与分组侧栏(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
| --- | --- |
|
||||
| 新会话 = 草稿 | 左侧栏 `+` 不再弹「标题」底部框,而是进入 `NewSessionScreen`:大标题「我们今天要做什么?」、项目 chip(`GET /api/project`,按 canonical 去重)、模型/智能体 chip(与聊天共用新的 `lib/widgets/model_picker.dart`)、附件与输入框。**发送前不创建会话**:第一次发送才 `POST /api/session`(带 `location.directory`、`model`、`agent`),随后 `openChat` 并发出这条消息 |
|
||||
| 草稿生命周期 | 草稿只存内存(`AppState.draft` + `draftOpen`):未发送就离开时保留,侧栏顶部出现「草稿 · 项目名」一行(笔图标、首行、× 丢弃),点它回到草稿;发送成功即清空,创建失败留在草稿并显示错误。第二期接服务端 `/api/session-drafts`(已记入项目待办) |
|
||||
| 侧栏分组 | 会话按 `location.directory` 分组(`.openchamber/chats` 归为「聊天」),组头是项目名 + 路径 + 折叠 + 「在此项目新会话」;组内按 `updated` 倒序并插「今天 / 昨天 / 本周早些时候 / 更早」小标题;默认过滤子会话(`parentID`),父会话的运行点会带上子会话的活动 |
|
||||
| 置顶 | 写进 `session.metadata.openchamber.pinned`(`PATCH /api/session/:id {metadata}`,合并原有 metadata),跨客户端可见;置顶的会话收进顶部「已置顶」区,不再重复出现在项目组里 |
|
||||
| 归档 | 主列表请求 `archived=false`;底部「显示已归档」按需拉 `archived=true`,展开后可取消归档(事件 `session.archived/unarchived` 同步) |
|
||||
| 行操作 | 左滑(`flutter_slidable`,DrawerMotion)露出置顶 / 归档 / 删除;`⋮` 菜单有重命名、置顶、归档、删除、复制会话 ID;选中行有底色与加粗 |
|
||||
| 其它 | 会话列表支持「载入更多」(cursor 分页);聊天页标题改为跟随 `AppState.sessions`,服务端根据首条消息生成的标题会即时显示;附件选择与缩略图抽到 `lib/widgets/composer_attachment.dart`,与草稿页共用 |
|
||||
| 版本 | **0.3.13(code 313)** |
|
||||
|
||||
---
|
||||
|
||||
## 0.3.12 侧栏头部、Termux 按键栏、键盘避让与记忆(分支 `flutter`)
|
||||
|
||||
| 项 | 结果 |
|
||||
|
||||
Reference in new issue
Block a user