Skip to content

Read a paused friend chat's notice in the window's language (#3114) - #3241

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-paused-chat-zh
Nov 20, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-paused-chat-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev

Fixes #3238
Part of #3114

Owner: Dev
Reviewer: Reviewer

Docs-not-needed: user-visible zh copy only; no subsystem behaviour, API or ownership changed.

What changed

The quiet card a friend chat draws above the composer once Bot Social has paused that chat was bare English in a Chinese window: the title Chat paused, the note Bot Social paused the last chat with this Bot. (or … ({reason}).) and the follow-up Send your message again: it starts a new chat.. All three now go through the file's own tr(), with the note and the follow-up joined by {note} so the card keeps today's "one reason + one next step" layout in the same fs-draft. Four keys land in the main ZH dictionary in core/src/client/i18n.js, and Bot Social's own reason is still shown exactly as the server sent it, untranslated, inside the full-width parentheses. Behaviour, slots, classes and CSS are untouched.

Verification at the tip

Tip SHA: 574bc69

Ran:

  • node --test plugins/social/test/paused-chat-i18n.test.js — red first on main: 5 / 2 / 3; at this tip: 5 / 5 / 0.
  • cd plugins/social && DSH_HARNESS=… npm test — 757 / 757 / 0 (main: 752).
  • node --test core/test/i18n.test.js core/test/i18n-plugins.test.js core/test/i18n-missing-entries.test.js core/test/i18n-template-draws.test.js core/test/i18n-plugins-missing-zh.test.js — 39 / 39 / 0.
  • Eight social *-i18n.test.js files — 33 / 33 / 0.
  • npm run verify (repo root, TZ=UTC) — all suites green; core 3354 tests, 0 fail, 1 pre-existing skip.
  • (cd core && node scripts/build-client.mjs --check) rc 0; node scripts/ds-bot-patches.mjs check three ok; node scripts/ds-bot-patches.mjs canonical after the commit — generate is a no-op.
  • node .github/scripts/changelog.mjs check, node .github/scripts/check-mojibake.mjs --check, core/scripts/check-arch-docs.mjs — rc 0.
  • Baselines plugins / template / missing: 12 / 10 / 47 → 12 / 9 / 46 shrank by exactly the two pins of this card.

Not run: no release, no deploy, no ruleset change; the smoke test (no index.js or src/host/ change).

Checkpoint

{
  "pr": 3241,
  "claim": "Dev",
  "issue": 3238,
  "summary": "A friend chat that Bot Social paused drew its notice, its reason line and its 'send your message again' line as bare English in a Chinese window. All three now go through the plugin's own tr(), the note and the follow-up are joined with {note} in the same fs-draft, and four zh keys land in the main ZH dictionary. Bot Social's reason is still shown exactly as the server sent it, untranslated. Behaviour, slots, classes and CSS are untouched.",
  "files": ["plugins/social/client.js", "core/src/client/i18n.js", "plugins/social/test/paused-chat-i18n.test.js", "changelog.d/3114-paused-chat-zh.fixed.md"],
  "checks": { "ran": "npm run verify; cd plugins/social && npm test; node --test plugins/social/test/paused-chat-i18n.test.js", "result": "green", "at": "574bc690b2213a4cd7487cbc6b497762683e3f9b" },
  "next": "none — ready for review"
}

Fixes #3238
Part of #3114

Docs-not-needed: user-visible zh copy only; no subsystem behaviour, API or ownership changed.
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 574bc69
Written-by: Reviewer
Attestation: 574bc69 role=Reviewer

Ran at this tip:

$ node --test plugins/social/test/paused-chat-i18n.test.js
# tests 5  # pass 5  # fail 0
$ cd plugins/social && npm test
# tests 757  # pass 757  # fail 0
$ node --test plugins/social/test/*-i18n.test.js
# tests 45  # pass 45  # fail 0
$ node --test core/test/i18n.test.js core/test/i18n-plugins.test.js core/test/i18n-missing-entries.test.js core/test/i18n-template-draws.test.js core/test/i18n-plugins-missing-zh.test.js
# tests 39  # pass 39  # fail 0
$ node .github/scripts/risk-gate.mjs --repo ThinkFlowLab/FlyBot --pr 3241
# risk-tier: T2; 142 changed lines in 11 files; 5 generated file(s) not counted

Tier T2 (recomputed at this tip: plugin code + test paths; 142 lines / 11 files, 5 generated; whole diff 163 lines / 16 paths, inside 250/12). Red first: with only the new test kept and plugins/social/client.js + core/src/client/i18n.js restored to their base blobs, the suite is 5 / 2 / 3 — cases 1, 2 and 5 red; 3 and 4 are guards (drawn only for a paused friend chat; a host without a translator) and are green on base by design. With the tip sources: 5 / 5 / 0.

Deviations from the spec, judged independently:

  • a. new test 116 lines (spec +104): the extra 12 are the lines()/loadApp() helpers and the file's comments. The five case names and their assertions are A7–A11: zh title/note with reason, zh without reason, English fallback word for word, the draw guards (!handle || !paused null, data-flybot/role/fs-hold fs-chat-approval kept), and the two baselines + all four zh entries character for character. No assertion was widened.
  • b. risk-gate: T2 / 142 lines / 11 files / generated 5 — matches the implementer's number; total diff 163 lines, still inside 250 lines / 12 files.
  • c. plugins/social/client.js hunk shape: with -U0 it is two hunk headers (@@ -4004,0 +4005,3 @@ for const note, @@ -4006,2 +4009,3 @@ for the two drawn lines); with -U3 it is the single @@ -4002,9 +4002,13 @@, +6−2. Content and total match the spec, so this is not an INC.
  • d. i18n.js is one @@ -352,0 +353,5 @@ (1 comment + 4 keys), as specced.

Scope: the only plugins/social/client.js change is in PausedChat (:4005-:4011 — note, the fs-label title, the fs-draft sentence pair). Untouched: :58, :555-:566, :3097, :3862, the 5 s poll, handle/paused guards, role="status", data-flybot="chat-paused", fs-hold/fs-label/fs-draft, CSS. core/src/client/i18n.js is +5−0 inserted after 'Not sent: delivery failed' and before '{from} → {to}'; cut 27's :331-:336 and HOST_ZH are not touched. The four keys are literal: 聊天已暂停; Bot Social 暂停了与这个 Bot 的上一次聊天。; …({reason})。 with full-width parentheses; {note}请重新发送消息:这会开始一段新聊天。 with no space after {note}. Bot Social's reason is still passed through untranslated.

Baselines are 12 / 9 / 46 (plugins 12, template 9, missing 46; missing-zh 2): Chat paused left the missing-entries pins and {} Send your message again… left the template pins, nothing else moved; all five total lines (sharing-page:148, add-friend:119, friend-settings:152, sharing-rooms:126, room-auto-send:105) read [12, 9, 46]. No regression: social 757/757 (main 752, +5), the social i18n files 45/45, core five 39/39, changelog.mjs check clean, check-mojibake.mjs --check 0 hits, build-client --check rc 0, ds-bot-patches check (10 patches apply, core == ds-bot + patches) and canonical (generate is a no-op), and both patches/ds-bot/files/test/ mirrors byte-identical to core/test/. Checks at this head: all success except enqueue-guard: failure, whose only reason is no Verifier report names the tip 574bc690b221 (this PASS is that report), plus the superseded cancelled and environment skipped runs.

Body: Fixes #3238 + Part of #3114, no Fixes #3114; no Policy-sign: and no hand-set risk:T* (labels: agent-pr). This PR should land before #3237/#3240, which regenerate core/client.js and patches/ds-bot/0008-client-bundle.patch; their owners rerun build-client/generate afterwards.

@github-actions github-actions Bot added the pass label Nov 20, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 83b1556 Nov 20, 2026
18 of 19 checks passed
@Birfy
Birfy deleted the dev/3114-paused-chat-zh branch November 20, 2026 01:41
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#3114 Cut 28:好友私聊暂停卡的中文文案

1 participant