Skip to content

fix(copy): rewrite the strings the Rust side shows in a written register - #37

Merged
fylorn merged 1 commit into
devfrom
fix/rust-written-copy
Sep 17, 2026
Merged

fylorn merged 1 commit into
devfrom
fix/rust-written-copy

Conversation

@fylorn

@fylorn fylorn commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Why

#36 rewrote the .tsx copy and left the strings src-tauri produces for a separate pass. Those strings reach the same screens: command errors shown as toasts, the connection screen, the uninstall log in Settings, the update window, tool-call notifications and the menu bar menu. They still read like someone talking: 「连不上控制面 …。core 可能还没起来,或者已经挂了。」, 「设置存不下来」, 「ThinkWatch ○ 没在跑」, 「可以把应用拖进废纸篓了。」.

What changes

The same rules as #36: statements, no first or second person, 无法 / 未能 / 尚未 instead of 连不上 / 没 / …不了, 此 instead of 这个 / 这一份, and no internal mechanics. Terms match what the frontend already shows: 开机启动 (the Settings section title), 已是最新版本 (the update section), 取消开机启动 (the uninstall steps after #36).

Where Before → after
Any command, core unreachable 连不上控制面 {socket}。core 可能还没起来,或者已经挂了。 → 无法连接控制面 {socket},core 可能尚未启动或已退出
Any command, protocol mismatch (dev) 控制面协议版本对不上:core 是 {a},界面认的是 {b}。两边版本不一致,请重新构建。 → 控制面协议版本不一致:core 为 {a},界面为 {b}。请重新构建。
重新启动 on the connection screen core 现在是 {state:?},没在跑,不用重启 → core 正在启动,请稍后再试 · core 未运行,无法重启
Connection screen and About, core missing 安装包里缺少 twcore 组件。请重新下载安装一次。 → 安装包缺少 twcore 组件,请重新下载并安装。
Same, dev build 找不到 twcore。找过这些位置(以及 PATH):… 用 THINKWATCH_CORE_BIN 指一个绝对路径,或者在 core 仓库里跑一次 cargo build -p twcore。 → 未找到 twcore。已查找以下位置及 PATH:… 可通过 THINKWATCH_CORE_BIN 指定绝对路径,或在 core 仓库中执行 cargo build -p twcore。
Diagnostics, autostart 建不了 {dir}:{e} · 写不了 {file}:{e} → 无法创建目录 {dir}:{e} · 无法写入文件 {file}:{e}
Autostart switch (dev) 开发构建里不注册开机自启 —— 它会把 target/debug 下的二进制写进 plist → 开发构建不支持开机启动
Update switch and check 设置存不下来:{e} → 无法保存设置:{e} · cask 里读不出版本号 → 无法从 Homebrew cask 中读取版本号
Update window 这一份由 Homebrew 管理,请执行:… → 此应用由 Homebrew 管理,请在终端中执行:… · 更新已经在进行中 → 更新正在进行中 · 已经是最新版本 → 已是最新版本
Uninstall log Claude Code — 已还原 → Claude Code:已还原 · 开机自启已注销 → 已取消开机启动 · 开机自启没注销掉(去系统设置里删):{e} → 未能取消开机启动({e})。请在「系统设置 › 通用 › 登录项」中关闭 ThinkWatch Lite。 · 数据目录没删掉:{dir}({e}) → 未能删除数据目录:{dir}({e}) · 数据留着没动:{dir} → 数据目录已保留:{dir} · 可以把应用拖进废纸篓了。 → 现可将应用移到废纸篓。
Tool-call notification {provider} 返回了一个可疑的 {tool} 调用 → {provider} 返回了可疑的 {tool} 调用 · 这个上游标记为不受信任,响应流已切断。 → 此上游标记为不受信任,响应流已切断。 · 建议拒绝这个调用。 → 建议拒绝此调用。
Menu bar menu ThinkWatch ○ 没在跑 → ThinkWatch ○ 未运行

Four changes go beyond word choice:

  • The dev-build autostart error no longer explains the plist. The reason (it would register target/debug) is already in the doc comments of autostart_enabled and autostart::allowed_in_this_build.
  • Restarting a core that is not running printed the supervisor's Debug output, e.g. 「core 现在是 Restarting { attempt: 2, in_ms: 4000 },没在跑,不用重启」. It now says whether core is still starting or not running.
  • The dev-only "twcore not found" message had nine spaces before its last line, left by a lost line continuation. The connection screen renders it with pre-wrap, so they showed.
  • The control-plane connection error drops its closing 「。」. Commands format errors with {:#}, which appends : <os error> to the context, so it rendered as 「…或者已经挂了。: Connection refused (os error 61)」.

Checked and left as they are, since they already read as written copy: 已还原, 数据目录已删除, 下载失败 / 安装失败, 开发构建不执行自动更新 (the update window says the same), 已更新到 {version}, 软件更新, 运行中, 额度 已用 N%, 今日 $N, 撤销上一次配置修改, 打开主界面, 退出 ThinkWatch Lite…, and 已重置 in the menu bar icon.

Not in this PR. tracing lines and errors that only reach the log (the heartbeat timeout in ControlClient::ping, Supervisor::report_wedged); the --measure-memory output, which is a developer measurement printed to stderr; and text core sends, which passes through unchanged (strategy names, the why and excerpt of a flagged tool call, and error bodies from the control plane). copy.test.ts only scans .tsx, so nothing mechanical guards these strings yet.

Verification

  • pnpm typecheck, pnpm test (78), cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (76).
  • Read each string where the frontend displays it: Update.tsx prefixes check errors with 「检查更新失败:」, the uninstall log renders as a list under 「卸载完成」, and the core-missing text sits under 「未找到 core 程序」 on the connection screen. No frontend code matches on any of the changed strings.
  • Not exercised in a running app: tauri dev would drive the real gateway, and the isolated preview mocks IPC, so the Rust side does not run there.

🤖 Generated with Claude Code

#36 rewrote the .tsx copy as statements without first or second person,
but part of what users read never passes through a .tsx file: command
errors shown as toasts, the menu bar menu, tool-call notifications, the
uninstall log in Settings and the update window. Those strings still
used the spoken tone #36 removed ("连不上控制面 …。core 可能还没起来,
或者已经挂了。", "设置存不下来", "ThinkWatch ○ 没在跑", "可以把应用拖进
废纸篓了。"), so one screen could mix both registers.

They now follow the same rules: 无法/未能/尚未 instead of 连不上/没/
…不了, 此 instead of 这个/这一份, 开机启动 as the Settings page names it,
and 已是最新版本 as the update section already says.

A few changes go beyond word choice:

- The dev-build autostart error explained that registering would write
  target/debug into the plist. The doc comments already say that; the
  toast now only says dev builds do not support autostart.
- Restarting a core that is not running showed the supervisor's Debug
  output ("core 现在是 Restarting { attempt: 2, in_ms: 4000 },…").
  It now says whether core is still starting or not running.
- The dev-only "twcore not found" message had nine spaces before its
  last line, left by a lost line continuation.
- Uninstall log lines join client and result with 「:」, as #36 does on
  the clients page, instead of an em dash.
- The control-plane connection error loses its closing 「。」. Commands
  format errors with {:#}, which appends ": <os error>" after it.

Left as they are: tracing lines, errors that only reach a log (the
heartbeat timeout, report_wedged), the --measure-memory output, and the
strategy names core sends.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fylorn
fylorn merged commit d0f0a87 into dev Sep 17, 2026
2 checks passed
@fylorn
fylorn deleted the fix/rust-written-copy branch September 17, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant