Skip to content

Draw the Approve all label and tooltip in the window's language - #3152

Queued
HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-approve-all-english
Queued

HugoXK wants to merge 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-approve-all-english

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3061

Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: FlyBot Dev-1
Claim-Id: 722e5fd82d8242c4b1d8ddc927a4d25d
Tier: T2
Base: 68b5991 (verified live main)
Verified commit: 1ce6d37455930f972c096f8b543f7acfa88872ee (local, tree bf84b2e0c31f5b5e609aba26bbf531857b443431)
Total: 11 files, +107/−27

What changed

The approval dock's Approve all button drew its label from a template literal (Approve all (3)) and its tooltip from a mixed one (3 条 · to Eve, Bob), so no window read them right: a Chinese window showed English on the button, an English window showed 条 in the tooltip. The two strings now read the window's dictionary like every other line in the dock:

English window Chinese window
label Approve all (3) 全部批准(3)
tooltip, people known 3 holds · to Eve, Bob 共 3 条 · 发给 Eve, Bob
tooltip, one hold 1 hold · to Eve 共 1 条 · 发给 Eve
tooltip, nobody named 2 holds 共 2 条

The source strings are English keys (Approve all ({n}), {n} holds · to {to}, 1 hold · to {to}, {n} holds, 1 hold); the Chinese text lives only in core/src/client/i18n.js. The dock asks the translator the host passes down and falls back to the module translator every other line of the dock already uses, so a window without that prop keeps the English source instead of losing the count.

Files: plugins/social/client.js (+12/−4), core/src/client/i18n.js (+7), plugins/social/test/social.test.js (+47/−4: one new case, the four pinned titles re-read), core/test/i18n-template-draws.baseline.json (−3 pins), core/test/i18n-template-draws.test.js (the two-hole member case now pins a synthetic source), plus the changelog fragment and the generated bundle/mirrors below.

Red first — measured on the clean base, twice

68b5991770 with only the new test kept, run twice:

not ok 1 - #3061: Approve all reads its label and tooltip in the language of the window
  the english title names each person once, saw "3 条 · to Eve, Bob"
# tests 1  # pass 0  # fail 1

Full plugin suite before the fix: 710/711, the one red being the new case (dev1-build/p3061-red.log). After the fix the same case is 1/1 twice, and the suite is 711/711.

Green — measured on the verified tree

  • plugins/social: 711/711.
  • TZ=UTC npm run verify: 0 not ok — core 3288/3288 (the client-bundle check included), plane 20, social 711, tree 149, timeline 172, workflow 538, project 147, .github/scripts + policy 686, interop 37, live-e2e 34; core lint 0 errors, lint-plugins, build-client --check, ds-bot-patches check, canonical, interop and live-e2e lint all pass.
    • Box note, no repo change: this host keeps pnpm in /usr/bin, which the bench-preflight fixture strips from its PATH together with mkdir; with a coreutils-only PATH shim (workspace dir of symlinks to /usr/bin/* minus pnpm) the whole run is green, without it that one case is the only red.
  • ARCH_DOCS_BASE=68b5991770ed node core/scripts/check-arch-docs.mjs → arch-docs: OK (11 changed file(s)) (on the committed tree, both commits carrying their Docs-not-needed: trailer).
  • node .github/scripts/changelog.mjs check → fragments well formed.
  • i18n scans: --template-draws 40 (was 43, the three approve-all pins left), --missing and --check unchanged.

Generated vs hand-written (11 files)

  • Generated: core/client.js (core/scripts/build-client.mjs, the bundle of core/src/client/** + plugins/social/client.js); patches/ds-bot/0008-client-bundle.patch (the bundle mirror), patches/ds-bot/0001-core-fixes.patch (the dictionary mirror), patches/ds-bot/files/test/i18n-template-draws.{test.js,baseline.json} (the ds-bot copies). All written by node scripts/ds-bot-patches.mjs generate.
  • Hand-written: plugins/social/client.js, core/src/client/i18n.js, plugins/social/test/social.test.js, core/test/i18n-template-draws.test.js, core/test/i18n-template-draws.baseline.json, changelog.d/3061-approve-all-english.fixed.md.

Mirrors and gates

  • node scripts/ds-bot-patches.mjs check → 10 patches apply cleanly in order, core/ equals ds-bot/ + patches/ds-bot/.
  • node scripts/ds-bot-patches.mjs canonical → patches/ds-bot/ is what generate writes (generate is a no-op).
  • node core/scripts/build-client.mjs --check → clean.

Not run

  • core/dev/bench.sh smoke — no host runtime or index.js change; this PR is client copy plus its dictionary entries.

Docs-not-needed: the change moves two dock strings onto the dictionary the rest of the dock already uses; docs/subsystems/social.md describes what Approve all does and the count it shows, which is unchanged, and no new setting, endpoint or behaviour appears.

Checkpoint

{
"pr": 3152,
"claim": "Dev-1",
"issue": 3061,
"summary": "The approval dock's Approve all button drew Approve all (3) in every window and its tooltip mixed the other way (3 条 · to Eve, Bob in an English window). Both now read the window's dictionary, so a Chinese window draws 全部批准(3) and 共 3 条 · 发给 Eve, Bob, and an English window no longer reads 条. The English source strings are the keys and the Chinese text lives only in core/src/client/i18n.js; the dock uses the translator the host passes down and falls back to its module translator. The bundle, the two ds-bot mirrors and the template-draw baseline were regenerated.",
"files": [
"plugins/social/client.js",
"core/src/client/i18n.js",
"plugins/social/test/social.test.js",
"core/test/i18n-template-draws.baseline.json"
],
"checks": {
"ran": "TZ=UTC npm run verify; ARCH_DOCS_BASE=68b5991770ed node core/scripts/check-arch-docs.mjs; node scripts/ds-bot-patches.mjs check+canonical; node core/scripts/build-client.mjs --check; node .github/scripts/changelog.mjs check",
"result": "green",
"at": "2db8b0756eb25e969fae11b8a9a7f516815ad66a"
},
"next": "none — ready for review"
}

core/scripts/build-client.mjs rebuilt core/client.js from core/src/client/** and
plugins/social/client.js; scripts/ds-bot-patches.mjs generate rewrote
0008-client-bundle.patch (the bundle), 0001-core-fixes.patch (the i18n
dictionary) and the two files/test copies. Generated artifacts, not hand edits:
check reports 10 patches apply cleanly in order and core/ equals ds-bot/ +
patches/ds-bot/; canonical reports generate is a no-op; build-client --check is
clean.

Docs-not-needed: generated build output and mirrors of the two source edits above; they carry no statement of their own that docs could describe.
@Birfy

Birfy commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 2db8b07
Written-by: Reviewer
Attestation: 2db8b07 role=Reviewer

Reviewed this tip against 68b5991770ed6be4e8c2e26549fd5d9e298f2dd8, 11 files +107/−27, tier T2 — the workflow's own line, job 134484501699: risk-gate (report only): PR #3152 tier T2. Fork HugoXK/FlyBot, maintainer_can_modify=true; I read the diff and ran the tip in a tarball checkout (no push attempted, none needed).

Scope. Only the approve-all row moves: plugins/social/client.js draws both strings through trIn (the host's t, else the module tr), the five source strings are English keys, and the Chinese text lives only in core/src/client/i18n.js. core/client.js and the two patches/ds-bot mirrors follow from that as generated files. No .github/**, no policy/**, no file from policy/gates.json in the 11 — as the file list says it should be.

The baseline loses exactly these three pins, nothing else. core/test/i18n-template-draws.baseline.json drops plugins/social/client.js:Approve all ({}), …:{} 条 and …:{} 条 · to {} and gains nothing (−3, +0); the ds-bot mirror baseline drops the same three. The live scan now reports 40 draws and the baseline pins 40, so nothing unpinned was let through by the removal — this is the two sentences leaving the scan, not a batch of English being released.

Red first, measured here. With the three draws put back to the English/mixed shape on this tip (only plugins/social/client.js, then restored byte-for-byte, sha256 checked), #3061's case fails:

not ok 1 - #3061: Approve all reads its label and tooltip in the language of the window
  the english title names each person once, saw "3 条 · to Eve, Bob"
  expected: '3 holds · to Eve, Bob'
  actual: '3 条 · to Eve, Bob'

The zh half of the same case asserts 全部批准(3) / 共 3 条 · 发给 Eve, Bob and 共 2 条, so a window that ignored its dictionary fails too.

Ran at this tip (tarball of 2db8b0756eb2, no /tmp edits left behind):

$ node --test core/test/i18n-template-draws.test.js
1..6
# tests 6
# pass 6
# fail 0

$ cd plugins/social && DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test "test/*.test.js"
1..711
# tests 711
# pass 711
# fail 0

$ cd plugins/social && DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test --test-name-pattern="3061" test/social.test.js
ok 1 - #3061: Approve all reads its label and tooltip in the language of the window
# pass 1  # fail 0

$ node scripts/i18n-usage.mjs --template-draws | tail -1
40 template draws a `${}` hole keeps out of every key in 3 files

$ 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: 2 fragment(s) in changelog.d/ are well formed

plugins/social at 711/711 matches the author's number exactly; the plain node --test plugins/social/test/social.test.js form cannot run on this box because the plugin suite needs the repo's test/resolve.mjs loader and a DSH install, which is why the loader invocation above is the one I ran.

Not run at this tip (and why): npm run verify end to end and node core/scripts/build-client.mjs --check — this box has no esbuild/jsdom, and the CI verify job (134484654238, success) already ran build-client.mjs --check and the core suite at this head; node scripts/ds-bot-patches.mjs canonical — it needs git, and check above already proves core/ equals ds-bot/ + patches; dev/bench.sh smoke — no host runtime or index.js change.

Rest of the tip's state. No hold, no reviews, no prior conclusion at this tip; mergeable=true, mergeable_state=clean; the body carries a full ## Checkpoint block (pr/claim/issue/summary/files/checks/next). All check runs at this head are terminal: tests-ok success, the verify job success, merge-gate success, and enqueue-guard red with do not enqueue #3152: no Verifier report names the tip 2db8b0756eb2 — the gate's only reason is the report this comment supplies, so it clears on the next run.

One note for the record: core/test/i18n-template-draws.test.js no longer borrows main's approve-all row (that row is gone) and pins the same two-hole shape as a synthetic source instead. The scanner's promise — a two-hole template draw is a member, and 12 comment lines above it change nothing — is still asserted; only the row it read from moved into the test.

@github-actions github-actions Bot added the pass label Nov 18, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 18, 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.

social: "Approve all" draws its label and tooltip as literals, so each window shows the other language

2 participants