Skip to content

Read the Bot tree's sidebar in the window's language (#3114) - #3213

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

Birfy merged 1 commit into
mainfrom
dev/3114-tree-sidebar-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3212
Owner: Dev
Reviewer: Reviewer
Part of #3114
Tier: T2

Checkpoint

{
  "pr": 3213,
  "claim": "Dev",
  "issue": 3212,
  "summary": "The Bot tree's sidebar drew the Archived Bots group, each row's status tag and the reorganization notice as bare English in a zh window. The plugin now routes that copy through a local tr() that reads the window translator and keeps today's English, placeholders included, when the host has none. Twelve zh entries join 'Bot tree' in core/src/client/i18n.js, and the three i18n baselines lose the eleven pins that held these draws. #3112 may add the same keys; whichever lands second keeps both blocks and drops its own duplicate.",
  "files": [
    "plugins/tree/client.js",
    "plugins/tree/test/sidebar-i18n.test.js",
    "core/src/client/i18n.js",
    "core/test/i18n-plugins.baseline.json",
    "core/test/i18n-template-draws.baseline.json",
    "core/test/i18n-missing-entries.baseline.json",
    "core/test/i18n-missing-entries.test.js",
    "changelog.d/3114-tree-sidebar-zh.changed.md",
    "core/client.js",
    "patches/ds-bot/0001-core-fixes.patch",
    "patches/ds-bot/0008-client-bundle.patch"
  ],
  "checks": {
    "ran": "TZ=UTC npm run verify; the tree sidebar i18n test; core i18n five; ds-bot-patches check + canonical",
    "result": "green",
    "at": "0904df4fc87e57defae13e77dfa7402a59cef6e2"
  },
  "next": "none — ready for review"
}

What changed

The Bot tree's sidebar copy that draws by default — the Archived (N) / Archived bots group, the five row status tags (archived, archived · merged into X, retired, idle, outside the tree), the reorganization notice (Tree reorganized, Tree reorganization undone, and N more, Kept: …, Undo, Dismiss) and the right-click Copy invite link — now goes through a tr() added to plugins/tree/client.js. Twelve zh entries were added after 'Bot tree' in core/src/client/i18n.js; Dismiss, Copy invite link and Bot tree reuse their existing entries. The three i18n baselines lose the eleven English pins for these draws (17/37/155 → 16/34/148; the tree panel's pins 17 → 6).

The tr() here differs from the Social one on purpose: it falls back to the English it was handed and refills the parameters it was given, leaving an unknown placeholder as a placeholder instead of an empty hole.

#3112 (open, not merged) may add the same twelve keys to core/src/client/i18n.js: this cut adds them after 'Bot tree' (line 221) and #3112 adds its block after 'Friend requests' (line 199), so the two do not overlap today. If both land, the side that lands second keeps both blocks and drops its own duplicate keys, then re-runs build-client.mjs → ds-bot-patches.mjs generate → check → canonical.

Docs-not-needed: the tree page describes the panel's structure and slots, not the language its copy is drawn in.

Verification at the tip

Tip SHA: 0904df4

Ran:

  • cd plugins/tree && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sidebar-i18n.test.js → 3/3/0 (red first, with only the test added and plugins/tree/client.js still at base: 3/0/3)
  • cd plugins/tree && … --test test/*.test.js → 152/152/0
  • cd core && node --test test/i18n-plugins.test.js test/i18n-template-draws.test.js test/i18n-missing-entries.test.js test/i18n-plugins-missing-zh.test.js test/i18n.test.js → 39/39/0
  • cd core && node scripts/build-client.mjs --check → exit 0
  • node scripts/ds-bot-patches.mjs check → ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70, ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; canonical → ok patches/ds-bot/ is what generate writes
  • node .github/scripts/check-mojibake.mjs --check → mojibake: ok — 0 occurrences of U+FFFD
  • node .github/scripts/changelog.mjs check → changelog: 14 fragment(s) in changelog.d/ are well formed
  • TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0 (core 3354/3354, social 686/686, tree 152/152, and the rest green)

Not run:

  • only the sidebar copy that draws by default is covered; the tree's off-by-default TreeView segment (sidebarSection: true) keeps its six draws in the baselines (Bot tree, Copy invite link title, Collapse {}, Copy invite link for {}, Tree, No child bots yet…)
  • the Social/Face backlog stays in the three baselines
  • no real browser: the Chinese sidebar is read out of the rendered tree in the test, not clicked in a window
  • #3112's appearance/header/history work is untouched, so the duplicate-key order above is a plan, not a measured merge

The Archived Bots group, the row status tags and the reorganization
notice drew bare English in a zh window. They now go through tr() with
twelve new zh entries, and the three i18n baselines lose the eleven pins
that held those draws.

Part of #3114
Docs-not-needed: the tree page describes the panel's structure and slots, not the language its copy is drawn in.
@Birfy

Birfy commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at 0904df4
Written-by: Reviewer
Attestation: 0904df4 role=Reviewer

Ran at this tip:

$ node _3213_cmp.mjs   # GET compare f436255...0904df4 -> 15 files, +193/-43
$ cp f436255.../plugins/tree/client.js plugins/tree/client.js && cd plugins/tree && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sidebar-i18n.test.js   # red first
# tests 3  # pass 1  # fail 2
$ cd plugins/tree && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/sidebar-i18n.test.js
# tests 3  # pass 3  # fail 0
$ cd plugins/tree && TZ=UTC TMPDIR=/data/flybot-tmp DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test test/*.test.js
# tests 152  # pass 152  # fail 0
$ cd core && TZ=UTC TMPDIR=/data/flybot-tmp node --test test/i18n-plugins.test.js test/i18n-template-draws.test.js test/i18n-missing-entries.test.js test/i18n-plugins-missing-zh.test.js test/i18n.test.js
# tests 39  # pass 39  # fail 0
$ node core/scripts/build-client.mjs --check   # exit 0
$ node scripts/ds-bot-patches.mjs check        # ok 10 patches apply cleanly in order / 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)
$ node .github/scripts/changelog.mjs check     # 14 fragment(s) well formed
$ node .github/scripts/check-mojibake.mjs --check  # ok - 0 occurrences of U+FFFD

Tier: T2 (plugins/** is in the T2 paths; the repo's risk-gate could not run here — it shells out to gh, absent on this box — so this is the path rule applied to the 15-file list, not a gate run).

What I checked at this tip

  • Scope is exactly the brief: 15 paths, +193/-43. Hand-written 8 = +146/-27 = 173 (tree/client.js 22/13, i18n.js 14/0, baselines 0/1 + 1/4 + 0/7, i18n-missing-entries.test.js 2/2, new sidebar-i18n.test.js 106/0, changelog 1/0). Generated 7 = core/client.js 14/0, the two patches 15/1 each, four patches/ds-bot/files/test mirrors 0/7, 2/2, 0/1, 1/4. Nothing else.
  • The twelve keys are verbatim and their zh values match the spec: 'Archived bots' 已归档的 Bot, 'Archived ({count})' 已归档({count}), 'Tree reorganized' Bot 树已重组, 'Tree reorganization undone' 已撤销 Bot 树重组, 'and {count} more' 还有 {count} 条, 'Kept: {names}' 保留:{names}, 'archived · merged into {name}' 已归档 · 并入 {name}, archived 已归档, retired 已退役, idle 空闲, 'outside the tree' 不在树中, Undo 撤销 — each one occurrence in tip, none in base. Reused entries stay single: 'Dismiss' 关闭 (i18n.js:1018), 'Copy invite link' 复制邀请链接 (:205), 'Bot tree' Bot 树 (:221).
  • tr() at plugins/tree/client.js:16 asks globalThis.flybot?.t only when it is a function, otherwise emits the English it was handed and refills known params, leaving an unknown {placeholder} as a placeholder — not social's params?.[key] ?? '' shape (plugins/social/client.js:1021). Test 3 pins the bare-window output: Archived (5), archived · merged into Editor, and 2 more, Undo/Dismiss.
  • Baselines shrink only: 17/37/155 -> 16/34/148; tree/client.js pins 17 -> 6, and the six left are the intended ones (Bot tree, Copy invite link, Collapse {}, Copy invite link for {}, No child bots yet…, Tree). Every baseline diff is deletions plus the one trailing-comma move in i18n-template-draws; no reordering, no hand-added entries.
  • core/test/i18n-missing-entries.test.js changes only :211-212 (Tree reorganized#1/FlyBot plugin layer (ctx.flybot) with social and tree plugins #2 -> Tree and No child bots yet…), semantics untouched.
  • No forbidden path is touched: none of core/src/host, core/src/shared, plugins/social, .github, policy, authz.js, ds-bot/, ds-bot.pin.json, topics.json; core/node_modules is not in the diff either.
  • Generated tree is consistent with the sources: build-client --check exit 0; 10 patches apply in order; core/ equals ds-bot/ + patches/ds-bot/; canonical says generate is a no-op; the four patches/ds-bot/files/test mirrors are byte-identical to core/test.
  • Red first, honestly: with only the changed source reverted (base plugins/tree/client.js, tip test and tip baselines kept) the suite reads # tests 3 / # pass 1 / # fail 2 — both zh draws fail with the English text in the message. The third case stays green on that revert by design: it asserts the no-translator English fallback and the emptied pins, and base already draws English verbatim. So this is 2 red, not the 3 the brief predicted; the revert still turns the cut's behaviour red.
  • CI at this tip (19 check-runs): everything success or skipped except enqueue-guard failure, which is the expected "no PASS yet" state, and one agent-audience cancelled + a duplicate judge from the superseded run. Once this PASS lands enqueue-guard should go green.
  • Add staged Teamily-style chat tools and owner-scoped history search #3112 is still open (dirty, head 1969402), so those twelve keys may coexist: if Add staged Teamily-style chat tools and owner-scoped history search #3112 lands too, the side that lands second keeps both blocks and drops its own duplicate keys, then re-runs build-client -> ds-bot-patches generate/check/canonical. This cut adds its block after 'Bot tree' (line 221) and Add staged Teamily-style chat tools and owner-scoped history search #3112 adds after 'Friend requests' (line 199), so they do not overlap today.

Not run: npm run verify as a whole — it stops at npm --prefix core run lint because no oxlint exists on this box (DSH_HARNESS/dev/harness absent), and arch-docs has no origin/main to diff here; the live-e2e suites are skipped on this kind of change. Every other verify stage is listed above and ran at this tip.

@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 bd924c3 Nov 19, 2026
18 of 19 checks passed
@Birfy
Birfy deleted the dev/3114-tree-sidebar-zh branch November 19, 2026 10:17
@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 树侧栏(归档段 / 状态标签 / 重组通知卡)在中文窗口里仍是英文

1 participant