Skip to content

Commit 641faf1

Browse files
authored
Read the missing decision file in the window's language (#3114) (#3264)
Written-by: Dev Fixes #3263 Part of #3114 Owner: Dev Reviewer: Reviewer Docs-not-needed: one literal swapped for t(); the dictionary entry already exists. ## What changed Before: in a zh window a decided meeting whose decision file is gone drew the bare English literal `decision file gone` in the Project board's record section. After: the same cell draws `t('decision file gone')`, so a zh window reads 「决策文件已不在」, while an English window is byte for byte unchanged. The dictionary entry already existed (`core/src/client/i18n.js:1602`, written by #1767), so `i18n.js` has 0 changed lines here. Only the third argument of the one `bt-project-missing` span changed (`core/src/client/project-board.js:651`, +1/−1). The row still reads `data-status="decided"`; the question, the `@speaker`, `bt-project-missing`'s CSS and prop, `meeting.status` (`:663`) and `meeting.advance.reason` (`:661`) are untouched; `core/src/host/**` is not touched — the host still answers `path: ''` and the row still disappears only when the meeting does. A non-empty path is still drawn as it came, never translated. ## Verification at the tip Tip SHA: `59e307580c973d515e891b2dfbe4529511273a6f` (tree `695ba8aa7df2b7c8a660fad26a41a40c39eec246`) Ran at this tip: ```text $ cd core && TZ=UTC node --test test/project-board-view.test.js # tests 38 / pass 38 / fail 0 $ cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js # tests 41 / pass 41 / fail 0 $ cd core && node -e 'for (const [f,w] of [["test/i18n-plugins.baseline.json",12],["test/i18n-template-draws.baseline.json",9],["test/i18n-missing-entries.baseline.json",46]]) { const n = JSON.parse(require("fs").readFileSync(f,"utf8")).entries.length; console.log(f, n, n===w?"ok":"MISMATCH") }' i18n-plugins 12 ok / i18n-template-draws 9 ok / i18n-missing-entries 46 ok $ node core/scripts/build-client.mjs --check # rc 0 $ node scripts/ds-bot-patches.mjs check # ok 10 patches apply cleanly; ok core/ equals ds-bot/ + patches/ds-bot/ (pin skipped: no git here) $ node .github/scripts/changelog.mjs check # 15 fragment(s) are well formed $ node .github/scripts/check-mojibake.mjs --check # 0 U+FFFD in 1784 text files $ grep -n 'decision file gone' core/src/client/project-board.js | grep -v "t('decision file gone')" | wc -l # 0 $ node --input-type=module -e 'import{createGate,loadRules}from"./.github/scripts/risk-gate.mjs";const r=createGate(loadRules("./.github/agent/risk-rules.json")).judge([{filename:"core/src/client/project-board.js",additions:1,deletions:1},{filename:"core/test/project-board-view.test.js",additions:34,deletions:0},{filename:"changelog.d/3114-cut-34-decision-file-gone.fixed.md",additions:1,deletions:0},{filename:"core/client.js",additions:1,deletions:1},{filename:"patches/ds-bot/0008-client-bundle.patch",additions:1,deletions:1},{filename:"patches/ds-bot/files/src/client/project-board.js",additions:1,deletions:1},{filename:"patches/ds-bot/files/test/project-board-view.test.js",additions:34,deletions:0}]);console.log(r.tier,r.why.length,r.lines,r.files,r.generated)' $ printf 'core/src/host/store.js\ncore/src/client/about.js\ncore/src/client/project-board.js\n' | grep -cE '^(core/src/host/|core/src/client/about\.js$|core/src/client/capability-settings\.js$|patches/ds-bot/topics\.json$|core/test/i18n-.*\.baseline\.json$)' ``` Every command above was run on a tree byte-equal to the tip; the red-first run is recorded in the PR comment and in `red.txt`/`red-full.log`. Red first — only the test added, `core/src/client/project-board.js` at the merge base: - `cd core && TZ=UTC node --test test/project-board-view.test.js` → `# tests 38 / # pass 37 / # fail 1`; case 38 expected `决策文件已不在`, actual `decision file gone`. Clean main on the same file is 37/37/0. At the tip: - same command → `# tests 38 / # pass 38 / # fail 0`. - the five i18n gates (`test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js`) → `41 / 41 / 0`; the three baselines `12 / 9 / 46` ok. - `cd core && npm run build` regenerated `core/client.js`; `node scripts/ds-bot-patches.mjs generate` twice (idempotent, zero diff the second time); `canonical` → `ok patches/ds-bot/ is what generate writes (generate is a no-op)`; `check` → three `ok` lines; `node core/scripts/build-client.mjs --check` → rc 0; `git status --porcelain` empty. - `node .github/scripts/changelog.mjs check` → 15 well-formed fragments; `node .github/scripts/check-mojibake.mjs --check` → rc 0, 0 occurrences of U+FFFD in 1784 text files; `ARCH_DOCS_BASE=origin/main node core/scripts/check-arch-docs.mjs` → `arch-docs: OK (7 changed file(s))`. - the risk gate on the seven changed paths → `T1 0 37 3 4`; hand-written budget 37 lines / 3 files; `patches/ds-bot/topics.json` untouched; `core/src/client/i18n.js` untouched; the forbidden surface is 0 (`core/src/host/` 0), with a positive control that returns 2 on host/about/project-board. Not run (and why): the full `TZ=UTC npm run verify`. This box has only `esbuild` in the shared `core/node_modules` symlink (no `@deepseek-ai/*` harness packages, and `npm ci` would replace that symlink), so the core suite cannot start here; CI at this tip carries the full suite. ## Checkpoint <!-- flybot:checkpoint --> ```json { "pr": 3264, "claim": "Dev", "issue": 3263, "summary": "In a zh window a decided meeting whose decision file is gone now reads 「决策文件已不在」 instead of the English decision file gone; an English window is unchanged. The only product change: the third argument of the one bt-project-missing span, now t('decision file gone'); the dictionary entry already existed, so i18n.js has no changed line and core/src/host/** is untouched. One test (the 38th) covers a missing path in both windows and a present path that is never translated: red first 38/37/1, after the fix 38/38/0. The client bundle and the three patch artifacts were regenerated, not hand-edited.", "files": [ "core/src/client/project-board.js", "core/test/project-board-view.test.js", "changelog.d/3114-cut-34-decision-file-gone.fixed.md", "core/client.js", "patches/ds-bot/0008-client-bundle.patch", "patches/ds-bot/files/src/client/project-board.js", "patches/ds-bot/files/test/project-board-view.test.js" ], "checks": { "ran": "project-board-view red 38/37/1 then green 38/38/0 + five i18n gates 41/41/0 + baselines 12/9/46 + npm run build + ds-bot-patches generate/canonical/check + build-client --check + changelog 15 + mojibake 1784 + arch-docs + risk gate T1 0 37 3 4", "result": "green", "at": "59e307580c973d515e891b2dfbe4529511273a6f" }, "next": "none — ready for review" } ``` <!-- /flybot:checkpoint -->
1 parent 422a672 commit 641faf1

7 files changed

Lines changed: 73 additions & 4 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A decided meeting whose decision file is gone now says so in a Chinese window instead of drawing the English words `decision file gone` ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)).

‎core/client.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12835,7 +12835,7 @@ function ProjectBoardRecord({ record, projectId, call: call4 }) {
1283512835
proxyRow(meeting),
1283612836
// A decided meeting whose file is gone still reads as decided; the missing path says so
1283712837
// instead of the row disappearing with the file.
12838-
meeting.path === "" ? (0, import_react23.createElement)("span", { className: "bt-project-missing" }, "decision file gone") : (0, import_react23.createElement)("span", { className: "bt-project-path" }, meeting.path)
12838+
meeting.path === "" ? (0, import_react23.createElement)("span", { className: "bt-project-missing" }, t("decision file gone")) : (0, import_react23.createElement)("span", { className: "bt-project-path" }, meeting.path)
1283912839
));
1284012840
const pendingRows = meetings.pending.map((meeting) => (0, import_react23.createElement)(
1284112841
"div",

‎core/src/client/project-board.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ function ProjectBoardRecord({ record, projectId, call }) {
648648
// A decided meeting whose file is gone still reads as decided; the missing path says so
649649
// instead of the row disappearing with the file.
650650
meeting.path === ''
651-
? h('span', { className: 'bt-project-missing' }, 'decision file gone')
651+
? h('span', { className: 'bt-project-missing' }, t('decision file gone'))
652652
: h('span', { className: 'bt-project-path' }, meeting.path)))
653653
// #1831: a pending decision card carries its level, who it is addressed to, and — for a severe
654654
// card — the host's own refusal to advance it. The words are the host's; the badge only says

‎core/test/project-board-view.test.js‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,3 +1035,37 @@ test('#2041: the overlay hands the board its own read, so a row opens through it
10351035
assert.deepEqual(plain(asked), [{ name: 'project-decision', payload: { id: 'project-1', path } }], 'the overlay own read carried the ask')
10361036
assert.match(textIn(redraw()), /Opened through the overlay/, 'the answer is drawn under the row')
10371037
})
1038+
1039+
// #3114 cut 34: a decided meeting whose decision file is gone says so in the window's language. The
1040+
// question, the speaker and a present path are host data; only the page's own line is a dictionary key.
1041+
const goneRecord = () => ({
1042+
project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] },
1043+
meetings: {
1044+
decided: [
1045+
{ id: 'meeting-d', date: '2026-10-30', question: 'Which board carries the record?', owner: 'Chief', path: '' },
1046+
{ id: 'meeting-e', date: '2026-10-31', question: 'Which board carries the next record?', owner: 'Chief', path: 'decisions/2026-10-31-next.md' },
1047+
],
1048+
pending: [], reason: '',
1049+
},
1050+
})
1051+
// `.bt-project-missing` is drawn on the team block too (`Not set`), so the row is found by its status.
1052+
const spanIn = (id, className) => {
1053+
const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided' && node.props?.key === `meeting:${id}`)
1054+
return all(row).find(node => node.props?.className === className)
1055+
}
1056+
1057+
test('#3114 cut 34: a decided meeting whose file is gone reads in the window language', () => {
1058+
assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), 'decision file gone', 'an English window is unchanged')
1059+
const off = installLocale(fakeLocale('zh'))
1060+
try {
1061+
assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), '决策文件已不在', 'a zh window reads the line in Chinese')
1062+
assert.equal(textOf(spanIn('meeting-e', 'bt-project-path')), 'decisions/2026-10-31-next.md', 'a zh window never translates a path')
1063+
const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided')
1064+
assert.equal(row.props['data-status'], 'decided', 'the row still reads decided')
1065+
assert.match(textOf(row), /Which board carries the record\?/, 'the question is host data and stays')
1066+
assert.match(textOf(row), /@Chief/, 'the speaker stays as the host named it')
1067+
assert.match(textOf(row), /决策文件已不在/)
1068+
} finally {
1069+
off()
1070+
}
1071+
})

‎patches/ds-bot/0008-client-bundle.patch‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16303,7 +16303,7 @@ diff --git a/client.js b/client.js
1630316303
+ proxyRow(meeting),
1630416304
+ // A decided meeting whose file is gone still reads as decided; the missing path says so
1630516305
+ // instead of the row disappearing with the file.
16306-
+ meeting.path === "" ? (0, import_react23.createElement)("span", { className: "bt-project-missing" }, "decision file gone") : (0, import_react23.createElement)("span", { className: "bt-project-path" }, meeting.path)
16306+
+ meeting.path === "" ? (0, import_react23.createElement)("span", { className: "bt-project-missing" }, t("decision file gone")) : (0, import_react23.createElement)("span", { className: "bt-project-path" }, meeting.path)
1630716307
+ ));
1630816308
+ const pendingRows = meetings.pending.map((meeting) => (0, import_react23.createElement)(
1630916309
+ "div",

‎patches/ds-bot/files/src/client/project-board.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ function ProjectBoardRecord({ record, projectId, call }) {
648648
// A decided meeting whose file is gone still reads as decided; the missing path says so
649649
// instead of the row disappearing with the file.
650650
meeting.path === ''
651-
? h('span', { className: 'bt-project-missing' }, 'decision file gone')
651+
? h('span', { className: 'bt-project-missing' }, t('decision file gone'))
652652
: h('span', { className: 'bt-project-path' }, meeting.path)))
653653
// #1831: a pending decision card carries its level, who it is addressed to, and — for a severe
654654
// card — the host's own refusal to advance it. The words are the host's; the badge only says

‎patches/ds-bot/files/test/project-board-view.test.js‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,3 +1035,37 @@ test('#2041: the overlay hands the board its own read, so a row opens through it
10351035
assert.deepEqual(plain(asked), [{ name: 'project-decision', payload: { id: 'project-1', path } }], 'the overlay own read carried the ask')
10361036
assert.match(textIn(redraw()), /Opened through the overlay/, 'the answer is drawn under the row')
10371037
})
1038+
1039+
// #3114 cut 34: a decided meeting whose decision file is gone says so in the window's language. The
1040+
// question, the speaker and a present path are host data; only the page's own line is a dictionary key.
1041+
const goneRecord = () => ({
1042+
project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] },
1043+
meetings: {
1044+
decided: [
1045+
{ id: 'meeting-d', date: '2026-10-30', question: 'Which board carries the record?', owner: 'Chief', path: '' },
1046+
{ id: 'meeting-e', date: '2026-10-31', question: 'Which board carries the next record?', owner: 'Chief', path: 'decisions/2026-10-31-next.md' },
1047+
],
1048+
pending: [], reason: '',
1049+
},
1050+
})
1051+
// `.bt-project-missing` is drawn on the team block too (`Not set`), so the row is found by its status.
1052+
const spanIn = (id, className) => {
1053+
const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided' && node.props?.key === `meeting:${id}`)
1054+
return all(row).find(node => node.props?.className === className)
1055+
}
1056+
1057+
test('#3114 cut 34: a decided meeting whose file is gone reads in the window language', () => {
1058+
assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), 'decision file gone', 'an English window is unchanged')
1059+
const off = installLocale(fakeLocale('zh'))
1060+
try {
1061+
assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), '决策文件已不在', 'a zh window reads the line in Chinese')
1062+
assert.equal(textOf(spanIn('meeting-e', 'bt-project-path')), 'decisions/2026-10-31-next.md', 'a zh window never translates a path')
1063+
const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided')
1064+
assert.equal(row.props['data-status'], 'decided', 'the row still reads decided')
1065+
assert.match(textOf(row), /Which board carries the record\?/, 'the question is host data and stays')
1066+
assert.match(textOf(row), /@Chief/, 'the speaker stays as the host named it')
1067+
assert.match(textOf(row), /决策文件已不在/)
1068+
} finally {
1069+
off()
1070+
}
1071+
})

0 commit comments

Comments
 (0)