Skip to content

fix(copy): rewrite the remaining UI copy in a written register - #36

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

fylorn merged 1 commit into
devfrom
fix/written-copy

Conversation

@fylorn

@fylorn fylorn commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Why

#35 rewrote the upstream page as product copy. The rest of the app still read like someone talking: 「没绑路由的密钥走这条」, 「并发上限要是一个 1 以上的整数」, 「第一个请求进来时,它会出现在这里」, 「像密钥的内容都打了码」. Next to the upstream page that is inconsistent, and in a tool people use to read costs and debug traffic it reads as unreliable.

What changes

Every .tsx outside src/upstreams/ now follows the rules the upstream page uses:

Rule Example (before → after)
Statements, not asides or questions 没找到可以绑的网卡。插着网线或连着 Wi-Fi 吗? → 未找到可绑定的网卡,请检查网线或 Wi-Fi 连接。
No first or second person 你加了 2 条,停用了 1 条内置的。 → 已添加 2 条自定义规则,停用 1 条内置规则。
Amounts are 费用; nothing is 不花钱 这些探测一分钱没花 → 这些探测未产生费用 · 净增成本 → 净增费用
An upstream is 上游, not 这家/一家 前 1 家失败,自动换到了下一家 → 前 1 个上游失败,已自动切换至下一个上游
Written verbs and negation 删掉 / 建 / 加上 / 换密钥 / 还没有 / 连不上 → 删除 / 创建 / 添加 / 更换密钥 / 尚无 / 无法连接
No internal mechanics Tooltips that only justified a design choice keep the fact a user acts on and drop the reasoning (custom scan rules are appended, a replay is byte-identical, baselines need 20 samples).

Covered: traffic and request details, overview, sessions, findings, guard, keys, routing (routes and strategy groups), gateway (listen, probes, limits), clients, settings (autostart, diagnostics, uninstall), the config file editor, the connection screen and the update window.

Two strings were wrong, not just informal:

  • Adopt shadcn, rebuild the overview, and stop polling #15 replaced 全部 with 不限 across the app, leaving 不限还原, 请求不限失败, 展开不限, 拖垮不限 and 不限网卡. They read 全部 / 所有 again, and the traffic filters are 全部客户端 / 全部上游.
  • Core 0.2 reports trust as a slug, so Guard showed official / untrusted; redaction categories were always slugs. Both now use the labels the upstream dialog defines.

copy.test.ts rejects the spoken markers removed here (要是, 马上, 多半, 还没, 没法, 为什么, 连不上, 起不来, 写好了, 拿到, 删掉, 这家 / 那家 / 一家 / 每家, 知道了, 吗?, 你 and more). 就好了, 怎么办 and 稍等一下 are widened to 就好, 怎么 and 稍等, and the synonym check rejects 成本 next to 花费.

Not in this PR. Strategy names (手动选, 轮流, 选最快, 选最便宜), the disk status (磁盘快满了,只记摘要不存请求体) and the scan rule summary (其中 N 条是你加的) are strings core sends, so they change in core. The menu bar, uninstall log and error strings in src-tauri were outside this sweep.

Verification

  • pnpm typecheck, pnpm test (78), cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (76).
  • A probe .tsx containing 要是 / 知道了 / 吗? / 连不上 makes the copy test fail, so the new markers are live.
  • Walked every changed surface in an isolated preview with mocked IPC (no gateway involved) at the default 1100×720 window: the rejected-config, rotated-credential and lost-connection banners; traffic filters, empty state and all request detail tabs including a replay quote; overview; sessions and a session's turns; findings with new alerts and baseline drift; guard; keys (validation toast, delete dialog); routing with the new-rule form and strategy groups; gateway with an exposed listener; clients (restore all, adopt plan and result, diagnosis); settings (diagnostics, uninstall); the safe-mode connection screen; the update window.

🤖 Generated with Claude Code

The upstream page was rewritten in #35, but the rest of the app still
talked to the user the way a chat would: "没绑路由的密钥走这条", "并发上限
要是一个 1 以上的整数", "第一个请求进来时,它会出现在这里", "像密钥的内容都
打了码". In a tool people use to read costs and debug traffic that tone
reads as unreliable, and it no longer matched the page next to it.

Every other page now uses the upstream page's register: statements
rather than asides or questions, no first or second person, 费用 for
amounts, 尚无/未/无法 rather than 还没/没/…不了, and an upstream is 上游
rather than 这家/一家. Tooltips that only justified a design choice (why
custom scan rules are appended, why a replay is byte-identical, why
small samples are not compared) keep the fact a user acts on and drop
the reasoning, which belongs in comments.

Two strings were wrong on screen, not just informal:

- A global 全部 -> 不限 replace in #15 left 不限还原, 请求不限失败, 展开不限,
  拖垮不限 and 不限网卡. They read 全部/所有 again, and the traffic filters
  say 全部客户端/全部上游, as that commit message described them.
- Core 0.2 reports trust as a slug, so the Guard page showed "official"
  and "untrusted"; redaction categories were always slugs. Both now use
  the labels the upstream dialog already defines.

The copy test rejects the spoken markers removed here (要是, 还没, 删掉,
拿到, 这家, 只计到, 知道了, 吗?, 你 and others) so they cannot return one
string at a time. 就好了, 怎么办 and 稍等一下 are widened to 就好, 怎么 and
稍等, and 成本 joins 花费 as a synonym to reject.

Not changed here: strategy names (手动选, 轮流, 选最快, 选最便宜), the disk
status line and the scan rule summary are strings core sends, so they
have to change in core.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fylorn added a commit that referenced this pull request Sep 17, 2026
#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 added a commit that referenced this pull request Sep 17, 2026
…ter (#37)

#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 291e65f into dev Sep 17, 2026
2 checks passed
@fylorn
fylorn deleted the fix/written-copy branch September 17, 2026 14:21
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