Repository navigation
0.1.8-2 — 会话树对照 pi /tree 重做、工具卡折叠回退
·
171 commits
to main
since this release
核心更新
1. 会话树(/tree)对照 pi 重做
原来那套是自己拼的树;现在整块换成 pi 官方 TreeSelectorComponent 的逐项移植:
- 5 种过滤:默认 / 只看用户消息 / 只看带标签 / 去掉工具结果 / 全部。默认档隐藏设置类条目(标签、上下文编辑、模型切换、思考等级等);
usage在任何档位都不显示;只有工具调用、没有文字的助手消息也不显示(除非出错、被中止,或它就是当前位置)。 - 布局按"可见树"重算:被过滤掉的条目,它的孩子挂到最近的可见祖先上;缩进和连线按可见树算,所以单链永远在同一列,只有分叉点才多一级。
- 活动分支排在最前,其余按时间旧→新。
- 折叠:只有"有可见孩子、且是根或分叉点下一支的开头"的节点能折叠。
- 搜索:空白分词、全部命中;搜索时自动清空折叠。
- 显示与复制:工具结果显示成
[read: 路径]这样的调用,而不是"工具完成";路径按 pi 家目录缩成~/;复制按 pi 的规则取文字。 - 新设置
treeFilterMode:树打开时用哪一档过滤。 - 对照标准答案:210 个场景由 pi 官方组件真实生成并录成夹具,Kotlin 侧逐行比对 960 项,CI 里还有"标准答案是否过期"的检查。
2. 会话导航
- 已经在该节点时,给出提示而不是再跳一次;
- 回合进行中要跳转时,先停止当前回合并收回排队消息;
- 摘要被中止后回到树;
editorText只在输入框为空时填入,不覆盖用户正在写的内容。
3. 跨项目新会话:不再多出空会话
改用 SDK 公开的 switchSession(不存在的路径, {cwdOverride}) 开"懒落盘"的新会话,不再预写一个壳文件 —— 修的是"切项目后会话列表多出空会话"。
4. 工具卡的折叠回到 RPC 版
- bash:运行中不再自动露出输出尾部,失败不再自动露原因(都要点开);
- read / write / edit:失败时也要点开才看到正文/提示;
- diff:不再默认展开,回到默认折叠;
- 通用卡(扩展 / MCP 工具)的专属渲染保留不动。
其他改进
- 文件树:收起时给出提示行。
- 宿主:
session.navigate带回aborted,导航结果走真 SDK 并加了测试。 - CI:增加会话树标准答案的新鲜度检查。
版本说明
versionName0.1.8,versionCode8。- 上一个 Release 的包内部仍是
0.1.0;这个包是这一版源码真实构建的,内部版本号就是 0.1.8。两个包同名,因此本次用-2后缀区分。 - 架构未变:
arm64-v8a单 ABI,内含 proot / proroot / tawcroot 三套运行时。
English
Highlights
1. Session tree (/tree) rebuilt against pi
The previous tree was hand-assembled; it is now a rule-by-rule port of pi's official TreeSelectorComponent:
- Five filters: default / user-only / labeled-only / no-tools / all. The default one hides bookkeeping entries (labels, context edits, model changes, thinking-level changes);
usageentries never show; an assistant message with tool calls but no text never shows either (unless it errored, was aborted, or is the current position). - Layout recomputed over the visible tree: children of filtered-out entries attach to their nearest visible ancestor, so a single chain stays in one column and only a branch point adds a level.
- The active branch comes first, the rest in chronological order.
- Folding: only a node with visible children that is either the root or the head of a branch below a fork can fold.
- Search: whitespace-separated terms, all must match; folding is cleared while searching.
- Display and copy: tool results render as a call such as
[read: path]rather than "tool finished"; paths shorten to~/under pi's home; copy uses pi's text. - New setting
treeFilterMode: which filter the tree opens with. - Against a golden answer: 210 scenarios recorded from pi's real component, compared line by line in Kotlin (960 assertions), plus a CI check that the fixtures are still fresh.
2. Session navigation
- Navigating to where you already are reports it instead of moving;
- A jump during a running turn stops that turn first and reclaims queued messages;
- After a summarisation is aborted, the tree is shown again;
editorTextis filled only when the input box is empty.
3. Cross-project new session no longer leaves an empty session
Now uses the SDK's switchSession(nonexistent path, {cwdOverride}) to open a lazily-persisted session instead of pre-writing a shell file — this fixes the extra empty session that appeared after switching projects.
4. Tool-card collapsing is back to the RPC-era behaviour
- bash: no longer auto-reveals the output tail while running, nor the reason on failure (both require expanding);
- read / write / edit: failures also require expanding;
- diff: no longer expanded by default;
- The generic card (extension / MCP tools) keeps its custom rendering.
Other
- File tree: a hint line while collapsed.
- Host:
session.navigatereturnsaborted; navigation results are tested against the real SDK. - CI: a freshness check for the session-tree fixtures.
Version
versionName0.1.8,versionCode8.- The previous release shipped a binary that still reported
0.1.0; this one is built from this source and reports 0.1.8. Same version number, so this release is suffixed-2. - Architecture unchanged:
arm64-v8aonly, with proot / proroot / tawcroot bundled.