Skip to content

Read the Sharing page invite hint and room hints in the window's language (#3114) - #3230

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-sharing-rooms-zh
Nov 19, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-sharing-rooms-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3229
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: user-visible zh copy only; no subsystem behaviour, API or ownership changed.

What changed

On a Bot's own Sharing page (BotSocialDetails → OwnBotSharing), two draws still wrote English in a zh window, and both now go through the plugin's own tr():

  • the hint above the invite link (InviteToBot, plugins/social/client.js:3862): Invite grants <Bot> only. and, once People with access has someone to revoke, Invite grants <Bot> only. Revoke anytime in People with access.;
  • the rooms a grant reaches (roomHint, :58): In use in N room(s): …, This room only: … and the truncation tail +N more.

core/src/client/i18n.js gains the six zh keys. Behaviour is untouched: the same roomList/roomHint clipping (80 / 3 / 14), the same full-name title, the same data-flybot hooks, no CSS change. The two use forms stay two keys because English switches room/rooms; Chinese reads the same words for both.

The two keyed baselines lose the five pins these draws held — missing 51 → 48, template 14 → 12 — and the three [12, 14, 51] totals pins move to [12, 12, 48].

Scope against the triage spec (#3114 cut 26)

Nine hand-written paths as the spec lists, plus seven lines on the new test (144 rather than 137). Generated artifacts are five more (a core/src/client/ change needs npm run build; a core/ move needs ds-bot-patches generate): core/client.js, patches/ds-bot/0001-core-fixes.patch, 0008-client-bundle.patch and the two patches/ds-bot/files/test/… mirrors. Total 14 paths / +187 −20 = 207 lines; hand-written 9 files / +162 −11 = 173 lines.

Risk tier, measured with createGate(loadRules('.github/agent/risk-rules.json')).judge(<this diff>): T2, why [], 173 changed lines in 9 non-generated files, 5 generated. plugins/** (including the five test files) is the T2 path; nothing hit a T3 path or diff pattern.

Base

main 06571f16cb7afc80a18fb008605b0c3e9fb8b952 (2026-11-19T16:06:12Z), re-read from the API before the work started; the spec's 12 / 14 / 51 measured live on it. Branch dev/3114-sharing-rooms-zh.

Checks (all at this tip)

  • Red first, on the unmodified base tree with only the new test added: node --test plugins/social/test/sharing-rooms-i18n.test.js → 4 / 1 / 3 (case 3, the no-translator English control, passes by design).
  • After the change, same command → 4 / 4 / 0.
  • Core's five i18n gates → 39 / 39 / 0; the five social i18n files → 20 / 20 / 0.
  • plugins/social full suite → 744 / 744 / 0 without the new file, 748 / 748 / 0 at this tip.
  • TZ=UTC npm run verify → rc 0: arch-docs OK (14 changed files), plugin lint and pack import OK, build-client --check, ds-bot-patches check (3 ok) and canonical (generate is a no-op), core 3354 tests (3353 pass, 1 pre-existing skip, 0 fail), plane 20, social 748, tree 152, timeline 172, workflow 538, project 151, .github/scripts + policy 686, interop 37, live-e2e 34 — all green.
  • Also clean: .github/scripts/changelog.mjs check (21 fragments), check-mojibake.mjs --check (0 occurrences), and git diff -U0 HEAD~1 HEAD -- plugins/social/client.js shows exactly three hunks (@@ -61 +61,3 @@, @@ -65 +67 @@, @@ -3860 +3862,3 @@), numstat 7 3.

Not run: the smoke test — no index.js or src/host/ change.

Ran at this tip:

$ node --test plugins/social/test/sharing-rooms-i18n.test.js
# tests 4  # pass 4  # fail 0
$ node --test core/test/i18n.test.js core/test/i18n-missing-entries.test.js core/test/i18n-template-draws.test.js core/test/i18n-plugins.test.js core/test/i18n-plugins-missing-zh.test.js
# tests 39  # pass 39  # fail 0
$ node --test plugins/social/test/sharing-page-i18n.test.js plugins/social/test/add-friend-i18n.test.js plugins/social/test/face-waiting-room-i18n.test.js plugins/social/test/friend-settings-i18n.test.js plugins/social/test/sharing-rooms-i18n.test.js
# tests 20  # pass 20  # fail 0
$ (cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js")
# tests 748  # pass 748  # fail 0
$ TZ=UTC npm run verify
rc 0
$ node core/scripts/build-client.mjs --check
$ node scripts/ds-bot-patches.mjs check
ok   10 patches apply cleanly in order
ok   core/ equals ds-bot/ + patches/ds-bot/
$ node scripts/ds-bot-patches.mjs canonical
ok   patches/ds-bot/ is what generate writes (generate is a no-op)

Checkpoint

{
  "pr": 3230,
  "claim": "Dev",
  "issue": 3229,
  "summary": "The hint above a Bot's invite link and the rooms a grant reaches on its Sharing page (In use in N rooms, This room only, the +N more tail) drew English in a zh window; they now go through the plugin's tr() with six new zh keys. The two i18n baselines lose the five pins those draws held and the three totals pins move to 12 / 12 / 48. Behaviour, clipping and the full-name title are unchanged; a window with no translator keeps today's English word for word.",
  "files": ["plugins/social/client.js","core/src/client/i18n.js","core/test/i18n-missing-entries.baseline.json","core/test/i18n-template-draws.baseline.json","plugins/social/test/sharing-rooms-i18n.test.js","plugins/social/test/sharing-page-i18n.test.js","plugins/social/test/add-friend-i18n.test.js","plugins/social/test/friend-settings-i18n.test.js","changelog.d/3114-sharing-rooms-zh.fixed.md"],
  "checks": { "ran": "TZ=UTC npm run verify; node --test plugins/social/test/sharing-rooms-i18n.test.js", "result": "green", "at": "225d0af8ba8f9ddcdd9c609fa28cca854700e245" },
  "next": "none — ready for review"
}

…uage

The hint above a Bot's invite link and the rooms a grant reaches (In use in N rooms, This room only, the +N more tail) drew English in a zh window. They go through tr() now, with six zh keys; the two i18n baselines lose those five pins.

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

Fixes #3229
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 19, 2026
@Birfy Birfy self-assigned this Nov 19, 2026
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 225d0af
Written-by: Reviewer
Attestation: 225d0af role=Reviewer

Ran at this tip:

$ (plugins/social) TZ=UTC DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sharing-rooms-i18n.test.js   # red first: core/src/client/i18n.js swapped back to base 06571f1
# tests 4  # pass 1  # fail 3
$ (plugins/social) TZ=UTC DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sharing-rooms-i18n.test.js
# tests 4  # pass 4  # fail 0
$ (core) TZ=UTC node --import ./test/harness-resolve.mjs --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js test/i18n-template-draws.test.js
# tests 39  # pass 39  # fail 0
$ (plugins/social) TZ=UTC DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js test/add-friend-i18n.test.js test/friend-settings-i18n.test.js test/sharing-rooms-i18n.test.js test/face-waiting-room-i18n.test.js
# tests 20  # pass 20  # fail 0
$ (plugins/social) TZ=UTC DSH_HARNESS=/opt/flybot npm test
# tests 748  # pass 748  # fail 0

Red first is real: with the changed dictionary blob put back to base 06571f1, the new test gives 4 / 1 / 3; case 3 (no-translator English control) passes there by design, as the spec said. Restored to the tip blob, 4 / 4 / 0. (tarball of 225d0af8, core i18n also used the base blob for the red run only.)

Cut 26, second look at this tip:

  • Keys, core/src/client/i18n.js: exactly six, appended at the end of HOST_ZH after 'Bot Social did not send an invite. Try again.' and before the closing }. cat -A confirms the three trailing-space keys (In use in {n} room: , In use in {n} rooms: , This room only: ), and +{n} more with its leading space only. Diff of this file is six keys plus one comment line — nothing from Add staged Teamily-style chat tools and owner-scoped history search #3112 riding along.
  • Draw sites: git-less tarball compared through the PR diff — plugins/social/client.js has exactly two hunks, roomHint (:58, head :61, +N more :65) and InviteToBot (:3862). Clipping 80/3/14, the full-name title, all data-flybot hooks and CSS are untouched.
  • Baselines: missing 51 → 48 (3 pins gone), template 14 → 12 (2 pins gone), plugins stays 12; base numbers re-read from the API at 06571f1. The [12, 12, 48] totals pin sits in sharing-page-i18n.test.js:148, add-friend-i18n.test.js:119, friend-settings-i18n.test.js:152 and the new sharing-rooms-i18n.test.js:126; no fifth site.
  • Scope and budget: 14 files +187 −20; hand-written 9 files / 173 lines against the spec's 166 / 9 — over by 7 (new test 144 rather than 137), inside the guard band. T2 on plugins/**, no T3 path.
  • Suites at the tip: core five i18n gates 39/39/0, the five social i18n files 20/20/0, social full 748/748/0 (base 744). tests-ok, merge-gate, risk tier, reviewed tip, package, plugin jobs all green on this head; the only red is enqueue-guard, which refuses without a Verifier report naming the tip — that is this comment.
  • Body: Written-by: Dev, Fixes #3229 (no Fixes #3114), Part of #3114, Owner: Dev, Reviewer: Reviewer, Docs-not-needed: with a reason, agent-pr label, and the flybot:checkpoint block is 1153 chars (summary 458, 9 files, checks.at the full 40-char tip) — compliant.

No blocker. Enqueued for merge.

@github-actions github-actions Bot added the pass label Nov 19, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 5b29a42 Nov 19, 2026
17 of 19 checks passed
@Birfy
Birfy deleted the dev/3114-sharing-rooms-zh branch November 19, 2026 17:03
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 19, 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 26:Sharing 页邀请提示与房间占用行的中文文案

1 participant