Skip to content

Read the room-invite preview card's lead, people and countdown in the window's language (#3114) - #3250

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-room-invite-card-zh
Nov 20, 2026
Merged

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

Conversation

@Birfy

@Birfy Birfy commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #3249
Part of #3114

Written-by: Dev
Owner: Dev
Reviewer: Reviewer
Tier: T1 (computed by risk-gate over these 9 paths: why [], lines 118 files 4 generated 5; no risk:T* label written)
Base: faf7792

Docs-not-needed: a dictionary entry plus five draw points in one component, no architecture change.

What changed

The card drawn under the face-to-face panel's Group invite link box was English down to its last word in a zh window: Lead: Chief, 3 / 8 in the room, 1:05 left to join, the Clear button, and — when the card has nothing else to show — Face-to-face room, Open while the room is open and This link has expired. All seven draw points in core/src/client/room-invite-preview.js now go through t(), and the dictionary gains five entries: Lead: {lead}, {members} in the room, {members} / {max} in the room, This link has expired, Open while the room is open. The four sentences the dictionary already had — {time} left to join, Face-to-face room, Join, Clear — are reused, not duplicated.

The people line is built at draw time, not in the preview object: invitePreviewOf now also returns the members / maxMembers numbers (null when the server sent none), and people keeps exactly today's English sentence. The plugin stores the whole preview in its invite state (plugins/social/client.js:1728), so a sentence translated there would freeze at the language that was active when the reply arrived; a card already on screen now follows a language switch, and the English window is byte-for-byte what it was.

This link has expired is deliberately its own key: the dictionary's This link has expired. carries a full stop the card never drew, so borrowing it would have changed the English sentence.

Before / after at this tip (zh window, one card): Lead: Chief → 总负责人:Chief; 3 / 8 in the room → 房间里 3 / 8 人; 1:05 left to join → 还剩 1:05 可加入; foot Clear / Join → 清空 / 加入; nameless card Face-to-face room → 面对面房间; Open while the room is open → 房间开着的时候都能加入; This link has expired → 这条链接已过期. The room name, the member counts and the m:ss digits come from the server and are copied through untouched.

Bundle lane: core/client.js and the five patches/ds-bot/ paths are generated (npm run build in core/, then node scripts/ds-bot-patches.mjs generate, twice, then canonical); nothing under patches/ was hand-edited and patches/ds-bot/topics.json did not move (the two upstream files this cut edits are i18n.js and the already-registered test).

Red first (only the test added, sources untouched)

$ cd core && TZ=UTC node --test test/room-invite-preview.test.js

not ok 6  #3114 cut 30: a zh window reads the lead, the people and the deadline in Chinese
  + 'Lead: Chief'  - '总负责人:Chief'
not ok 7  #3114 cut 30: the nameless fallback and the two clock answers read Chinese too
  + 'Face-to-face room'  - '面对面房间'
not ok 8  #3114 cut 30: the room name, the counts and the clock the server sent stay as they came
  + '3 / 8 in the room'  - '房间里 3 / 8 人'
not ok 9  #3114 cut 30: a card built in English follows a language switch when it is drawn
  + 'Lead: Chief'  - '总负责人:Chief'
ok 1..5  (the five #876 cases: today's English, all still pass)
# tests 9 / # pass 5 / # fail 4

The four new cases live in the existing core/test/room-invite-preview.test.js (89 → 153 lines, 5 → 9 examples); the five #876 cases are untouched, and they still pin the English sentences word for word.

Verification at the tip

Tip SHA: 34a7ca906f256e5b2ce3da47cd2fe294f349156b (tree b2fef6647cae3ae12638b52d8665284d156072bc; the local commit c86cdc0adaaa4ae6a9cb21794aa52e9f850f5421 has the same tree, and every reading below ran on it).

Ran:

  • the new file after the fix → # tests 9 / # pass 9 / # fail 0; the five #876 examples still green with their English assertions
  • core/test/i18n.test.js (the "every literal the client translates has a Chinese entry" gate) → # tests 3 / # pass 3 / # fail 0
  • full core suite (npm test in core/, DSH_HARNESS pointed at an installed harness) → # tests 3380 / # pass 3379 / # fail 0 / # skipped 1 (the pre-existing skip)
  • plugins/social suite (npm test there, same harness) → # tests 758 / # pass 758 / # fail 0 — the 16 face-link-preview English assertions still hold, which is the second lock on "the English card did not change"
  • node core/scripts/build-client.mjs --check → 0; git diff --exit-code -- core/client.js → 0
  • node scripts/ds-bot-patches.mjs check → 0, three lines: ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5), 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/; a real generate was then a no-op and canonical printed ok patches/ds-bot/ is what generate writes (generate is a no-op)
  • npm --prefix core run lint → 91 warnings and 0 errors; ARCH_DOCS_BASE=<base> npm --prefix core run arch-docs → arch-docs: OK (9 changed file(s)) (the commit and this body each carry the Docs-not-needed: line)
  • node .github/scripts/changelog.mjs check → 0, changelog: 11 fragment(s) in changelog.d/ are well formed
  • node .github/scripts/check-mojibake.mjs --check → 0, ok — 0 occurrences of U+FFFD in 1777 text file(s)
  • three baselines unchanged: 12 / 9 / 46; grep -rl "[12, 9, 46]" plugins/social/test/*.js | wc -l → 6
  • git diff --name-only <base>...HEAD | grep -c '^plugins/' → 0; grep -c face-link-preview plugins/social/test/social.test.js → 42, the same count as on the base
  • git diff --numstat <base>...HEAD over the hand-written paths → 118 4 (T1 limit 400 lines / 20 files); risk-gate → tier T1 | why [] | lines 118 files 4 generated 5

Not run (and why):

  • npm run verify at the repo root: the root has no package-lock.json in the tree, so npm ci refuses (can only install with an existing package-lock.json), and the root includes the other plugin suites and the interop/live-e2e suites. This diff touches no file outside core/src/client/**, core/test/**, the generated bundle/patches and one changelog fragment, so I ran the affected suites and the gates above instead. plane, plugins/{tree,timeline,workflow,project} and the .github/policy/interop suites were not run; none of their files changed.
  • no browser click-through: the acceptance here is the drawn sentence set, asserted by the nine unit cases and the plugin's own English assertions.

Checkpoint

{
  "pr": 3250,
  "claim": "Dev",
  "issue": 3249,
  "summary": "The face-to-face room's pasted-invite preview card still spoke English in a zh window across all seven of its draw points. They now go through the client dictionary, with five new entries and four reused ones. The people line is built when the card is drawn from the member counts, so the preview a plugin stores keeps its English sentence and a card already on screen follows a language switch. The English card is unchanged, which the five older unit examples and the plugin's own assertions both pin.",
  "files": [
    "core/src/client/room-invite-preview.js",
    "core/src/client/i18n.js",
    "core/test/room-invite-preview.test.js",
    "core/client.js",
    "patches/ds-bot/0001-core-fixes.patch",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/src/client/room-invite-preview.js",
    "patches/ds-bot/files/test/room-invite-preview.test.js",
    "changelog.d/3114-room-invite-card-zh.fixed.md"
  ],
  "checks": {
    "ran": "room-invite-preview 9/9, i18n 3/3, full core suite 3380, plugins/social 758, build-client --check, ds-bot-patches generate/check/canonical, core lint + arch-docs, changelog check, mojibake check",
    "result": "green",
    "at": "34a7ca906f256e5b2ce3da47cd2fe294f349156b"
  },
  "next": "none — ready for review"
}

The card pasted into the face-to-face panel drew every word in English. Its
lead line, people line, countdown, two clock answers, Clear button and the
nameless fallback now come from the client dictionary, and the counts travel
beside the English sentence so a stored preview stays untranslated and a
language switch is honoured at draw time.

Docs-not-needed: a dictionary entry plus five draw points in one component, no architecture change.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 20, 2026
@Birfy Birfy self-assigned this Nov 20, 2026
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 34a7ca9
Written-by: Reviewer
Attestation: 34a7ca9 role=Reviewer

Ran at this tip:

$ (cd core && npm ci --include=dev)
$ node core/scripts/build-client.mjs --check   # rc=0
$ 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 generate is a no-op
$ (cd red && TZ=UTC node --test test/room-invite-preview.test.js)   # base i18n.js + room-invite-preview.js, tip tests
# tests 9  # pass 5  # fail 4
$ (cd core && TZ=UTC node --test test/room-invite-preview.test.js)
# tests 9  # pass 9  # fail 0
$ (cd core && TZ=UTC node --test test/i18n.test.js)
# tests 3  # pass 3  # fail 0
$ (cd core && DSH_HARNESS=/opt/flybot TZ=UTC npm test)
# tests 3365  # pass 3356  # fail 7
$ node .github/scripts/changelog.mjs check      # rc=0, 11 fragments well formed
$ node .github/scripts/check-mojibake.mjs --check   # rc=0, 0 occurrences of U+FFFD
$ grep -c "joinLabel = t('Join'), clearLabel = t('Clear')" core/src/client/room-invite-preview.js   # 1
$ git diff --no-index --name-only base/ tip/ | grep -c '^b/plugins/'   # 0

Red first, taken on this tip's tree with only the two changed sources put back to base faf77929 and the new tests kept: # tests 9 / # pass 5 / # fail 4, and the four failures are exactly the new ones — expected '总负责人:Chief' / actual 'Lead: Chief', expected '面对面房间' / actual 'Face-to-face room', expected '房间里 3 / 8 人' / actual '3 / 8 in the room', and the language-switch case failing on the same lead line. The five older examples stay green on that red tree, so the English card is untouched. With the implementation back: 9 / 9 / 0.

Points checked:

  1. Both countdown exits changed. inviteCountdown (core/src/client/room-invite-preview.js:73) and inviteCountdownAt (:127) both route Open while the room is open, This link has expired and {time} left to join through t(...); the m:ss digits are still the server's, and the expiry line in zh reads 还剩 1:05 可加入. The joinLabel/clearLabel defaults are translated at :95 (one hit).
  2. Nothing translated is stored in the preview. invitePreviewOf still returns the English people sentence and adds only the numeric members / maxMembers; the people line is built in invitePeople at draw time. Test 3 asserts card.people === '3 / 8 in the room' while the same card draws 房间里 3 / 8 人, and test 4 walks en → zh → en on one stored card, getting Lead: Chief / 总负责人:Chief / Lead: Chief.
  3. English byte-identical. The five pre-existing examples in core/test/room-invite-preview.test.js are unchanged and pass on the red tree; plugins/ is not in the diff at all (0), so the plugin-side English assertions are untouched.
  4. Dictionary gate. Five new keys (Lead: {lead}, {members} in the room, {members} / {max} in the room, This link has expired, Open while the room is open) — the last two are deliberately separate from the …expired. entry so the card does not gain a full stop the English card never had. test/i18n.test.js is 3/3, so no missing entry and no unused entry; the three baselines are unchanged at 12 / 9 / 46.
  5. Generated trees agree. build-client.mjs --check rc 0, ds-bot-patches check reports core/ equals ds-bot/ + patches/ds-bot/, canonical reports generate is a no-op — nothing hand-edited in core/client.js or the patch mirrors.
  6. Full suite. On this tip npm test is 3365 tests / 3356 pass / 7 fail, and the seven are the known environmental set: activity-row-host, client-cut-sites, composer-label, header-effects, read-page, thinking-row (the harness jsdom route, TypeError: The "path" argument must be of type string) plus check-arch-docs empty diff passes (cannot diff against HEAD). I ran those seven files on base faf77929 at the same setup and got the identical 13 tests / 6 pass / 7 fail, so they reproduce off this diff and are not caused by it.
  7. Changelog and mojibake. Both gates rc 0; the fragment names one issue #3114 and describes the behaviour, not the code.

Scope matches the PR body: 9 files, +284/−47, all under core/, patches/ds-bot/ and changelog.d/, with plugins/ at 0 — T1, no risk:T* needed. enqueue-guard, merge-gate, policy-sign, tests-ok and risk tier (report only) are green on this tip; the only non-success runs are two duplicate cancelled jobs and the two skipped ones.

No changes requested; nothing to fix. Enqueuing.

@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 cc885ca Nov 20, 2026
17 of 19 checks passed
@Birfy
Birfy deleted the dev/3114-room-invite-card-zh branch November 20, 2026 06:04
@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.

面对面房间邀请预览卡按窗口语言显示(Cut 30)

1 participant