feat: dsh-style composer and model chip

Follow dsh-Go's input bar (MIT, referenced rather than copied):

- one rounded capsule holding a leading 36px attach key, a borderless
  auto-growing field, the context usage ring and a trailing 36px key that
  sends, or becomes the stop button while a turn runs (the hint says
  "still typing while generating")
- attachment chips show image thumbnails above the capsule
- the app bar shows the current model and agent as a chip that opens the
  model/agent picker, now a segmented control
- light haptic on send
This commit is contained in:
blumia committed 2026-11-18 20:48:12 +08:00
1 parent 885a27c6a9
commit 782ac2bd4d
3 files changed
+192 -77

No files matched your search

+1
View File
@@ -18,6 +18,7 @@
| 复用 | Go 客户端无法复用;`lib/api/` 按同一协议重写(HTTP/SOCKS5 代理、自签/pinning、SSE、part-shells);聊天 Markdown 直接采用 **dsh-Go 同款的 `gpt_markdown`**(BSD-3,流式、代码高亮/复制、表格、LaTeX、任务列表) |
| 踩坑 | SSE 的 `types` 是重复 query 参数,Dart 的 `Map` 会把它压成最后一个 → 只订阅到一种事件、聊天不更新;改为手动拼 query 后实时流恢复 |
| 可继续复用 | dsh-Go 的 `app/lib/ui/chat/render/`(markdown_body、code_block、markdown_blocks 等)文件头多为 MIT,可保留 SPDX 头后搬运,但依赖其 Riverpod/DSH 协议类型;`scrollable_positioned_list`、`xterm` 等 pub 包也可直接用 |
| 输入区(参考 dsh-Go) | 圆角胶囊 + 左侧 36 圆附件键 + 无边框自动增高输入 + 上下文占用环 + 右侧 36 圆发送/停止键(运行中变为停止、hint 变「生成中,仍可输入…」);附件以缩略图 chip 展开在胶囊上方;顶栏模型 chip(点击打开模型/智能体分段选择) |
| 最低 Android | **24(7.0)** |
| 明文 HTTP | Dart `HttpClient` 直接建 socket,release 连 `http://` 无需 cleartext 开关(已实测) |
| 模拟器实测 | 服务器列表→添加/连接(无密码自动跳过)→会话列表(运行点/模型·时间)→聊天:流式 Markdown(gpt_markdown,代码块/表格实测)、思考/工具行、页脚、上下文占用环、输入与实时回复(SSE) |