Skip to content

Read the Bot Sharing page in the window's language (#3114) - #3216

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

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

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3215
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T2
Docs-not-needed: the two cards keep their layout, state and server calls; this cut lands twenty-three zh dictionary entries and routes existing literals through the tr() at plugins/social/client.js:1018, so docs/subsystems/social.md and docs/subsystems/core-client.md describe structure that does not change.

What changed

A Bot's Sharing page now follows the window's language. People with access draws its note, its empty hint, the Auto-send switch and state (labels, title, accessible name), Revoke / Revoking…, the inline "Revoke …? They lose this Bot in N rooms." question (singular and plural) and its fallback noun in Chinese; Share with a friend draws its title, its one-click hint, Loading friends…, the empty hint, Share / Sharing… and the removed-row reason in Chinese — with no translator the cards keep today's English word for word.

Verification at the tip

Tip SHA: 3c0a142
Ran: cd plugins/social && node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js (3/3/0 at this tip; 3/0/3 with the implementation reverted); cd plugins/social && node --import ./test/resolve.mjs --test "test/*.test.js" (723/723/0); node --test core/test/i18n-*.test.js (31/31/0); node core/scripts/build-client.mjs --check; node scripts/ds-bot-patches.mjs check and canonical; TZ=UTC npm run verify at the branch (exit 0, arch-docs OK against a local origin/main ref at the base).
Not run: no real browser on this box, so nobody has looked at a Chinese Sharing page in a window — the render is read from the component tree in the test instead. This cut covers only the two cards on Bot detail → Sharing; Social's other screens and the timeline / tree / workflow draws keep their baselines. The duplicate-key ordering with #3112 (cut 18's two share cards) is not exercised: both cuts add keys only. npm ci needed NODE_ENV=development: this box exports NODE_ENV=production, which omits esbuild and makes build-client.mjs fail with MODULE_NOT_FOUND (environment, not the change).

Checkpoint

{
  "pr": 3216,
  "claim": "Dev",
  "issue": 3215,
  "summary": "The two cards a Bot's Sharing page draws now read in the window's language. People with access covers the note, the empty hint, the Auto-send switch and state, Revoke / Revoking…, and the inline revoke question in both singular and plural. Share with a friend covers its title, hint, loading and empty lines, its buttons, and the removed-row reason. Twenty-three zh entries land and the two i18n baselines lose the twenty-three pins those draws held; a window without a 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-page-i18n.test.js", "changelog.d/3215-sharing-page-i18n.fixed.md"],
  "checks": { "ran": "npm run verify (TZ=UTC)", "result": "green", "at": "3c0a1426766a4e83f5d57fb5d3cbce2edac4fba7" },
  "next": "none — ready for review"
}

The two cards a Bot's Sharing page draws — People with access and Share
with a friend — drew thirteen positions as bare English in a zh window.
They now go through the social panel's tr(), with twenty-three new zh
entries (including the singular room sentence and the fallback noun), and
the i18n baselines lose the twenty-three pins those draws held.

Fixes #3215
Part of #3114
Docs-not-needed: the subsystem pages describe the panel's structure and slots, not the language its copy is drawn in.
@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 3c0a142
Written-by: Reviewer
Attestation: 3c0a142 role=Reviewer

Ran at this tip:

$ TZ=UTC node /tmp/_3216_rt.mjs   # repo .github/scripts/risk-gate.mjs createGate + .github/agent/risk-rules.json over the 11 API files
# tier T2  # lines 250  # files 6  # generated 5
$ cd plugins/social && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/*.test.js
# tests 723  # pass 723  # fail 0
$ cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/i18n-missing-entries.test.js test/i18n-plugins.test.js test/i18n-template-draws.test.js test/i18n.test.js
# tests 31  # pass 31  # fail 0
$ cd plugins/social && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js
# tests 3  # pass 3  # fail 0
$ cd plugins/social && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sharing-page-i18n.test.js   # client.js, core/src/client/i18n.js and the two baselines put back to base bd924c3
# tests 3  # pass 0  # fail 3
$ node core/scripts/build-client.mjs --check
$ node scripts/ds-bot-patches.mjs check
$ node scripts/ds-bot-patches.mjs canonical
$ node .github/scripts/changelog.mjs check
$ node .github/scripts/check-mojibake.mjs --check

Tier, recomputed with the repo's own judge. risk-gate.mjs needs gh, which this box has no copy of, so I imported its exported createGate and fed it the 11 files from GET /pulls/3216/files — same rules file, same code path. Result T2, basis plugins/social/client.js=T2, and by its own arithmetic 250 changed lines in 6 files, 5 generated files excluded. 250 is exactly the cap; nothing over.

Scope: 11 paths, hand-written 250 lines in 6 files, generated 5. Hand-written plugins/social/client.js 22/22, core/src/client/i18n.js 25/0, i18n-missing-entries.baseline.json 0/16, i18n-template-draws.baseline.json 0/7, new plugins/social/test/sharing-page-i18n.test.js 157/0, changelog.d/3215-sharing-page-i18n.fixed.md 1/0 → 205 added + 45 removed = 250. Generated core/client.js 25/0, patches/ds-bot/0001-core-fixes.patch 26/1, 0008-client-bundle.patch 26/1, the two patches/ds-bot/files/test/ mirrors 0/16 and 0/7. Spec A10 said 13 paths; the realised change is 11 (no i18n-plugins touch, no extra patch mirror) — the判据 is "hand-written ≤250 lines / ≤12 files + generated self-consistent", and all three generated gates are green below, so this is not a gap.

Red first. With plugins/social/client.js, core/src/client/i18n.js and the two baselines at base: # tests 3 / # pass 0 / # fail 3, failures are the missing-zh-key kind (expected undefined (Share with a friend), saw [...], and the ratchet test on the 148/34 totals). Detail worth recording: reverting only the two source files leaves 1 pass, because case 3 asserts baseline contents (a data assertion) rather than a render — the 3/0/3 needs the baselines reverted too. Implemented: 3/3/0.

Keys. 23 zh entries land in core/src/client/i18n.js: the 18 spec keys, 'this person': '这个人', and the singular 'Revoke {who}? They lose this Bot in {n} room.' alongside the plural … rooms. (the existing social.test.js assertion needs the singular). People with access is reused from i18n.js:365, not re-added. tr() is the existing implementation at plugins/social/client.js:1018; no second one, and new Function( does not appear in the file.

The 23 pins are gone, and only those. i18n-missing-entries 148 → 132 (16 removed, all plugins/social/client.js: draws: Auto-send, Auto-send on, Auto-send off, Loading friends…, Share with a friend, the two One row per Bot… notes, Nobody has this Bot yet…, No friends left to share with…, One click shares {name} …, Revoke {name}, Revoking…, Sharing…, Share {name} with {who}, Share/Share …), i18n-template-draws 34 → 27 (7 removed: Revoke {}#1/#2, Share {} with {}, Auto-send {} → {}, {}'s replies to {}…#1/#2, One click shares {} …), i18n-plugins untouched 16. Totals exactly 16 / 27 / 132. Deletion-only, no reordering, no hand-added entries — git diff on both files is 0/N.

Generated artefacts. build-client --check exit 0; ds-bot-patches check → ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70, ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/, no differs from, no committed but not produced; canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op); both patches/ds-bot/files/test/ mirrors cmp-identical to core/test/.

No-go zones untouched. Zero hits for ^(core/src/shared/|core/src/host/|\.github/|policy/|ds-bot/|ds-bot\.pin\.json|plugins/social/index\.js|plugins/social/src/), for authz.js, node_modules, topics.json.

Existing assertions. plugins/social 723/723/0; core i18n four 31/31/0; changelog.mjs check 15 fragments well formed; check-mojibake.mjs --check 0 occurrences in 1769 text files.

Overlap with #3112 (still open, dirty at 1969402). Its plugins/social/client.js hunks start at +630, +2188, +2212, +3234, +3260, +3293, +3350 (43 lines, i.e. through ~3393 — inviteControls/AddFriend) and +4318. This cut's hunks are +3652…+3730 (ManageAccess) and +3915…+3974 (ShareWithFriend). No shared line range, so merge order is free and the later PR has no duplicated段 to delete; both only add keys.

CI at this tip (12:09Z, check-runs): 19 checks, 14 success, enqueue-guard: failure ("no Verifier report names the tip 3c0a142") — the expected pre-PASS state, now satisfied by this comment; 2 cancelled are superseded runs of judge and agent-audience; 2 skipped are live · ubuntu and window check. No unexplained failure.

Not run. Full TZ=UTC npm run verify: the tip came as a tarball with no node_modules, and esbuild is only reachable from an older checkout I symlinked into core/node_modules; I ran every target that this change can move (build-client, ds-bot-patches check+canonical, core i18n, social full, changelog, mojibake) rather than the unrelated plane/tree/timeline/workflow/project suites. No real browser on this box, so the Chinese Sharing page has not been seen in a window; the render is read from the component tree.

@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
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Correction from Reviewer: in the PASS above, the 16 removed i18n-missing-entries pins include plugins/social/client.js:Share but NOT plugins/social/client.js:Share (with the trailing space). Spec item 3 said both should stay; in fact Share had to go because Share: '分享' lands in this cut, and the ratchet test refuses a pin whose key is translated, while Share is still drawn with no zh key and therefore stays pinned. Totals are unchanged and still exactly 16 / 27 / 132, and i18n-missing-entries is green at 31/31/0. Verdict stays PASS at 3c0a142.

@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 5b32b96 Nov 19, 2026
18 of 20 checks passed
@Birfy
Birfy deleted the dev/3114-sharing-page-zh branch November 19, 2026 12:30
@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.

Bot 详情 Sharing 面的 People with access 卡在中文窗口仍是英文(cut 20)

1 participant