fix: full chat history, picked model/agent, usage sheet, image previews

- The chat loaded only one page of history: a desc page's older side is
  cursor.next, not previous, and the server rejects a cursor combined
  with order (InvalidCursorError). The first page stores `next`, later
  pages pass only `cursor`. tool/history_probe.dart walks a 1698-message
  session down to the oldest message with no gaps.
- The message list is now reversed (newest at offset 0), so older pages
  grow above and the viewport stays put; near the top it loads by itself
  and a "load earlier" row remains as a fallback.
- The agent picker filtered only on mode, so Compaction/Title/Summary
  (primary but hidden) showed up. Filter `hidden` too, and mark the
  current model or agent with a check.
- The usage ring's sheet was guarded by a flag nothing ever set; the
  ring now opens the context detail sheet.
- Tool image previews use a self-loading dialog and Image.memory: no
  temp file and no path_provider, whose Android implementation throws
  ClassNotFoundException: Landroid/content/Context; on the emulator.
- "Add server" in the connected server sheet now opens the form and
  returns to the session list once connected.
- Add a Linux desktop target for fast local UI checks, plus the probe
  that pages history.
- Version 0.3.2 (code 302).
This commit is contained in:
blumia committed 2026-11-19 12:34:25 +08:00
1 parent 2f5aad3814
commit 61977d2b14
24 files changed
+834 -130

No files matched your search

+15
View File
@@ -27,6 +27,21 @@
---
## 0.3.2 修复(分支 `flutter`)
| 项 | 结果 |
| --- | --- |
| 会话历史只加载一段 | 两个原因:`order=desc` 的“更早”方向是 `cursor.next`(此前用了 `previous`,取到 0 条),以及服务端拒绝 `cursor` 与 `order` 同时出现(`InvalidCursorError`)。现在首次加载记下 `next`,后续只带 `cursor`。`tool/history_probe.dart` 对 1698 条的会话验证 30 条/页翻到最早一条,无缺口 |
| 加载时视图跳动 | 消息列表改为 `reverse: true`(最新在底部,偏移 0),更早的页追加在上方,视口自然保持不动;接近顶部自动加载,并提供「载入更早的消息」按钮 |
| 智能体列表 | 过滤 `hidden`(Compaction/Title/Summary 是 `mode=primary` 但 `hidden=true`),只留 Build/Plan;模型与智能体列表用对勾标出当前选中项,切换后由 SSE 事件与本状态同步 |
| 用量环 | 点击打开「上下文占用」详情(模型、已用 tokens、上限、输出预留、百分比);此前被 `_usageOpen` 守卫拦掉 |
| 图片预览 | 对话框改为自加载的 StatefulWidget(此前预览流程在 widget 重建后失去状态);图片直接 `Image.memory(bytes)`,不再落盘。`path_provider_android 2.3.1` 在本机模拟器上抛 `ClassNotFoundException: Landroid/content/Context;`,因此移除 path_provider(附件缓存改用 `Directory.systemTemp`)。经 SOCKS5/HTTP 代理取 `/api/fs/raw` 均可预览 |
| 已连接时添加服务器 | 服务器面板的「添加服务器」此前只关闭面板;现在打开表单,连接成功后回到会话列表 |
| 版本 | **0.3.2(code 302)** |
| 测试环境 | 新增 Linux 桌面目标(`flutter create --platforms=linux`),本机 clang 从 `clang-17` 包解出、libsecret/jsoncpp 头文件解出,配合 Xvfb + xdotool/ffmpeg 截图自测,比模拟器快很多 |
---
## 0.3.1 修复(分支 `flutter`)
| 项 | 结果 |