Skip to content

Read the room invite card in the window's language (#3114) - #3228

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

Birfy merged 1 commit into
mainfrom
dev/3114-face-invite-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3227
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: same card, same layout and the same host calls; only its copy now goes through tr() and the dictionary gains keys.

What changed

The invite card inside an open face-to-face room (FaceInviteCard, plugins/social/client.js:1139) drew English in a zh window. Each of its six draws now goes through the plugin's own tr():

  • the mint button's Link ready state (the Create link side already used tr());
  • the QR's accessible name (QR code for this room invite) and its hint (Scan to open this room);
  • the clipboard's Copied state (the Copy link side already used tr());
  • the no-deadline line (Anyone with the link can join while the room is open.);
  • the error a mint with no link comes back with (Bot Social did not send an invite. Try again.).

core/src/client/i18n.js gains the five zh keys these drew without one (Copied was already in the dictionary, so it is only wrapped). Behaviour is untouched: the same social/face-invite / social/face-invite-revoke calls, the same data-flybot hooks, no CSS or layout change.

The three baselines lose the four missing pins those draws held and the one bare draw at the copy button: 13 / 14 / 55 → 12 / 14 / 51. The surviving plugins/social/client.js:Copied (the other bare copy button) is renumbered from Copied#2, so the plugin baseline diff is +1/−2.

Scope against the triage spec (#3114 cut 25)

Nine hand-written paths, as the spec lists (+1 line on the new test: 107 rather than 106 — the test file, not the implementation). Generated artifacts are five more, because a change under core/src/client/ requires npm run build (core/client.js) and a core/ move requires ds-bot-patches generate: core/client.js, patches/ds-bot/0001-core-fixes.patch, patches/ds-bot/0008-client-bundle.patch and the two patches/ds-bot/files/test/… mirrors. Total 14 paths / +146 −24 = 170 lines.

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

Base

First read at 15:24Z was main 21c70ef362 (cut 23). While this was in progress cut 24 (#3226) merged and main became c21c210f4390f6cc9808fbd1b6daf81b5a78adb5; the branch was rebuilt from a fresh tarball of that sha, hunks re-applied, baselines re-measured and every test below re-run. So the start here is 13 / 14 / 55 (not the spec's 14 / 18 / 86), and the end is 12 / 14 / 51.

Checks (all at this tip)

  • Red first, on the unmodified base with only the new test added: node --test plugins/social/test/face-invite-card-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 (base after cut 24 is 740); core → 3354 tests, 3353 pass, 1 pre-existing skip, 0 fail.
  • TZ=UTC npm run verify → rc 0 (arch-docs OK, 14 changed files).
  • Also clean: node core/scripts/build-client.mjs --check, node scripts/ds-bot-patches.mjs check and canonical, .github/scripts/changelog.mjs check (20 fragments), .github/scripts/check-mojibake.mjs --check.

Not run: the smoke test — no index.js or src/host/ change. Local re-run note: /tmp on this host is a full 128 MB tmpfs, so the suites were run with TMPDIR=/data/flybot-tmp.

Ran at this tip:

$ node --test plugins/social/test/face-invite-card-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/face-invite-card-i18n.test.js
# tests 20  # pass 20  # fail 0
$ (cd plugins/social && npm test)
# tests 744  # pass 744  # fail 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 .github/scripts/changelog.mjs check
# changelog: 20 fragment(s) in changelog.d/ are well formed

On the unmodified base c21c210f with only the new test added, the same command is 4 / 1 / 3 (case 3, the no-translator English control, passes by design).

Checkpoint

{
"pr": 3228,
"claim": "Dev",
"issue": 3227,
"summary": "The invite card inside an open face-to-face room drew its Link ready button, the QR's name and hint, the Copied state, the no-deadline line and the error a mint with no link returns as bare English in a zh window. Each draw now goes through the plugin's own tr(), and core/src/client/i18n.js gains the five zh keys (Copied was already there). The same host calls, data-flybot hooks and CSS are used, so behaviour is unchanged. The three baselines lose four missing pins and one bare draw: 13/14/55 to 12/14/51.",
"files": [
"plugins/social/client.js",
"core/src/client/i18n.js",
"core/client.js",
"plugins/social/test/face-invite-card-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",
"core/test/i18n-missing-entries.baseline.json",
"core/test/i18n-plugins.baseline.json",
"changelog.d/3114-face-invite-card-i18n.fixed.md",
"patches/ds-bot/0001-core-fixes.patch",
"patches/ds-bot/0008-client-bundle.patch"
],
"checks": {
"ran": "TZ=UTC npm run verify (rc 0); new test 4/4/0 (red 4/1/3); social 744/744/0; core 3354 tests 0 fail",
"result": "green",
"at": "699e1c2d5a90583e9eab6deef976e4b0914a3635"
},
"next": "Reviewer PASS at this tip (T2); enqueue #3228, then merge."
}

The invite card inside an open face-to-face room drew its Link ready button,
the QR's name and hint, the Copied state, the no-deadline line and the error a
mint with no link comes back with as bare English in a zh window. Each draw now
goes through the plugin's own tr(), the dictionary gains the five zh keys, and
the three baselines lose four missing pins and one bare draw.

Fixes #3227.

Docs-not-needed: same card, same layout and the same host calls; only its copy
now goes through tr() and the dictionary gains keys. No owned-path behaviour,
data shape or API changed, so docs/subsystems/social.md and core-client.md stay
as they are.
@Birfy Birfy self-assigned this Nov 19, 2026
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 19, 2026
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 699e1c2
Written-by: Reviewer
Attestation: 699e1c2 role=Reviewer

Ran at this tip:

$ cd core && node --test test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js test/i18n.test.js
# tests 39  # pass 39  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js"
# tests 744  # pass 744  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js test/add-friend-i18n.test.js test/face-waiting-room-i18n.test.js test/friend-settings-i18n.test.js test/face-invite-card-i18n.test.js
# tests 20  # pass 20  # fail 0
$ cd plugins/social && node --import ./test/resolve.mjs --test test/face-invite-card-i18n.test.js   # red tree: base plugins/social/client.js + this test
# tests 4  # pass 1  # fail 3

Red first, then green. On the base tree with only face-invite-card-i18n.test.js added: 4 / 1 / 3 — case 1 (zh draws), case 2 (mint with no link) and case 4 (baselines/dictionary) red, case 3 (no-translator English control) green by design. Same file on this tip: 4 / 4 / 0. Narrower red too: unwrapping just tr('Link ready') on this tip turns case 1 red (4 / 3 / 1), restored and green again.

Suite on this tip: plugins/social full 744 / 744 / 0 against base c21c210f4390f6cc9808fbd1b6daf81b5a78adb5 740 / 740 / 0 — the +4 is exactly the new file (base 740 → tip 744; the spec's 736 was cut 23's number). Core's five i18n gates 39 / 39 / 0; the five social i18n files 20 / 20 / 0. (DSH_HARNESS=/opt/flybot was needed here because core/dev/harness is not checked out in the tarball; the suites are otherwise unchanged.)

Baselines, measured on the tree: i18n-plugins 13 → 12, i18n-template-draws 14 → 14, i18n-missing-entries 55 → 51 — i.e. 13 / 14 / 55 → 12 / 14 / 51. Three pins carry that triple (sharing-page-i18n.test.js:148, add-friend-i18n.test.js:119, friend-settings-i18n.test.js:152) and all three moved; a grep finds no fourth place pinning it.

i18n-plugins.baseline.json +1 / −2 is right, not over-deleted. Diff removes plugins/social/client.js:Copied#1 and :Copied#2 and adds bare :Copied. In this tree the only remaining bare Copied draw is plugins/social/client.js:2321 (copy-my-handle, whose pair 'Copy' is also bare); the invite card's :1203 now goes through tr(), so the bare-draw identity rule renumbers the single survivor Copied#2 → Copied. Two entries for one remaining draw would have been the over-delete.

Scope: 14 paths, +146 / −24, 9 hand-written after dropping the 5 generated ones (core/client.js, the two patches/ds-bot/*.patch, the two patches/ds-bot/files/test/* baselines): plugins/social/client.js +5/−5, core/src/client/i18n.js +6/−0, the two core baselines +0/−4 and +1/−2, the three totals +1/−1 each, face-invite-card-i18n.test.js 107 new lines, changelog.d/3114-face-invite-card-i18n.fixed.md 1 → 137 changed lines / 9 hand-written files, T2 (≤250 / ≤12).

Spec match (#3114 comment 7013314575, cut 25): all six draws wrapped — :1153 mint-with-no-link error, :1185 Link ready, :1199 QR label + hint, :1203 Copied, :1205 no-deadline line. Five zh keys added (Link ready, QR code for this room invite, Scan to open this room, Anyone with the link can join while the room is open., Bot Social did not send an invite. Try again.); Copied already at core/src/client/i18n.js:165 and is only wrapped. Four i18n-missing-entries pins sold, one plugins pin sold, four cases in the new file.

Cut 24 untouched: INVITE_UNSUPPORTED (:992, draws :1187/:1658/:1720) and INVITE_LINK_COPY (:993/:1699) are byte-identical to base — zero hunk touches them. Cuts 21–23 tr()s untouched; room-invite-copy :1330 and group-strip-copy :2402 still as they were. Behaviour: same social/face-invite call, same data-flybot hooks, same state machinery — only the strings pass through tr(), and the one changed Copied draw is the invite card's, the handle copy stays bare.

Check-runs at this tip: 19, all success or skipped, the only failure is enqueue-guard — expected, it is the pre-PASS gate this verdict unblocks.

@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
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 06571f1 Nov 19, 2026
23 checks passed
@Birfy
Birfy deleted the dev/3114-face-invite-zh branch November 19, 2026 16:09
@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 25:房内邀请卡的中文文案

1 participant