diff --git a/changelog.d/3114-cut-34-decision-file-gone.fixed.md b/changelog.d/3114-cut-34-decision-file-gone.fixed.md new file mode 100644 index 000000000..c068f7490 --- /dev/null +++ b/changelog.d/3114-cut-34-decision-file-gone.fixed.md @@ -0,0 +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)). diff --git a/core/client.js b/core/client.js index 1a6be9caa..c3f94f34e 100644 --- a/core/client.js +++ b/core/client.js @@ -12835,7 +12835,7 @@ function ProjectBoardRecord({ record, projectId, call: call4 }) { proxyRow(meeting), // A decided meeting whose file is gone still reads as decided; the missing path says so // instead of the row disappearing with the file. - 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) + 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) )); const pendingRows = meetings.pending.map((meeting) => (0, import_react23.createElement)( "div", diff --git a/core/src/client/project-board.js b/core/src/client/project-board.js index 3029cb50a..78e294832 100644 --- a/core/src/client/project-board.js +++ b/core/src/client/project-board.js @@ -648,7 +648,7 @@ function ProjectBoardRecord({ record, projectId, call }) { // A decided meeting whose file is gone still reads as decided; the missing path says so // instead of the row disappearing with the file. meeting.path === '' - ? h('span', { className: 'bt-project-missing' }, 'decision file gone') + ? h('span', { className: 'bt-project-missing' }, t('decision file gone')) : h('span', { className: 'bt-project-path' }, meeting.path))) // #1831: a pending decision card carries its level, who it is addressed to, and — for a severe // card — the host's own refusal to advance it. The words are the host's; the badge only says diff --git a/core/test/project-board-view.test.js b/core/test/project-board-view.test.js index f2e64326e..fd62e0ef6 100644 --- a/core/test/project-board-view.test.js +++ b/core/test/project-board-view.test.js @@ -1035,3 +1035,37 @@ test('#2041: the overlay hands the board its own read, so a row opens through it assert.deepEqual(plain(asked), [{ name: 'project-decision', payload: { id: 'project-1', path } }], 'the overlay own read carried the ask') assert.match(textIn(redraw()), /Opened through the overlay/, 'the answer is drawn under the row') }) + +// #3114 cut 34: a decided meeting whose decision file is gone says so in the window's language. The +// question, the speaker and a present path are host data; only the page's own line is a dictionary key. +const goneRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] }, + meetings: { + decided: [ + { id: 'meeting-d', date: '2026-10-30', question: 'Which board carries the record?', owner: 'Chief', path: '' }, + { id: 'meeting-e', date: '2026-10-31', question: 'Which board carries the next record?', owner: 'Chief', path: 'decisions/2026-10-31-next.md' }, + ], + pending: [], reason: '', + }, +}) +// `.bt-project-missing` is drawn on the team block too (`Not set`), so the row is found by its status. +const spanIn = (id, className) => { + const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided' && node.props?.key === `meeting:${id}`) + return all(row).find(node => node.props?.className === className) +} + +test('#3114 cut 34: a decided meeting whose file is gone reads in the window language', () => { + assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), 'decision file gone', 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), '决策文件已不在', 'a zh window reads the line in Chinese') + assert.equal(textOf(spanIn('meeting-e', 'bt-project-path')), 'decisions/2026-10-31-next.md', 'a zh window never translates a path') + const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided') + assert.equal(row.props['data-status'], 'decided', 'the row still reads decided') + assert.match(textOf(row), /Which board carries the record\?/, 'the question is host data and stays') + assert.match(textOf(row), /@Chief/, 'the speaker stays as the host named it') + assert.match(textOf(row), /决策文件已不在/) + } finally { + off() + } +}) diff --git a/patches/ds-bot/0008-client-bundle.patch b/patches/ds-bot/0008-client-bundle.patch index 8613ead3d..da0e0f38f 100644 --- a/patches/ds-bot/0008-client-bundle.patch +++ b/patches/ds-bot/0008-client-bundle.patch @@ -16303,7 +16303,7 @@ diff --git a/client.js b/client.js + proxyRow(meeting), + // A decided meeting whose file is gone still reads as decided; the missing path says so + // instead of the row disappearing with the file. -+ 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) ++ 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) + )); + const pendingRows = meetings.pending.map((meeting) => (0, import_react23.createElement)( + "div", diff --git a/patches/ds-bot/files/src/client/project-board.js b/patches/ds-bot/files/src/client/project-board.js index 3029cb50a..78e294832 100644 --- a/patches/ds-bot/files/src/client/project-board.js +++ b/patches/ds-bot/files/src/client/project-board.js @@ -648,7 +648,7 @@ function ProjectBoardRecord({ record, projectId, call }) { // A decided meeting whose file is gone still reads as decided; the missing path says so // instead of the row disappearing with the file. meeting.path === '' - ? h('span', { className: 'bt-project-missing' }, 'decision file gone') + ? h('span', { className: 'bt-project-missing' }, t('decision file gone')) : h('span', { className: 'bt-project-path' }, meeting.path))) // #1831: a pending decision card carries its level, who it is addressed to, and — for a severe // card — the host's own refusal to advance it. The words are the host's; the badge only says diff --git a/patches/ds-bot/files/test/project-board-view.test.js b/patches/ds-bot/files/test/project-board-view.test.js index f2e64326e..fd62e0ef6 100644 --- a/patches/ds-bot/files/test/project-board-view.test.js +++ b/patches/ds-bot/files/test/project-board-view.test.js @@ -1035,3 +1035,37 @@ test('#2041: the overlay hands the board its own read, so a row opens through it assert.deepEqual(plain(asked), [{ name: 'project-decision', payload: { id: 'project-1', path } }], 'the overlay own read carried the ask') assert.match(textIn(redraw()), /Opened through the overlay/, 'the answer is drawn under the row') }) + +// #3114 cut 34: a decided meeting whose decision file is gone says so in the window's language. The +// question, the speaker and a present path are host data; only the page's own line is a dictionary key. +const goneRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] }, + meetings: { + decided: [ + { id: 'meeting-d', date: '2026-10-30', question: 'Which board carries the record?', owner: 'Chief', path: '' }, + { id: 'meeting-e', date: '2026-10-31', question: 'Which board carries the next record?', owner: 'Chief', path: 'decisions/2026-10-31-next.md' }, + ], + pending: [], reason: '', + }, +}) +// `.bt-project-missing` is drawn on the team block too (`Not set`), so the row is found by its status. +const spanIn = (id, className) => { + const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided' && node.props?.key === `meeting:${id}`) + return all(row).find(node => node.props?.className === className) +} + +test('#3114 cut 34: a decided meeting whose file is gone reads in the window language', () => { + assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), 'decision file gone', 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.equal(textOf(spanIn('meeting-d', 'bt-project-missing')), '决策文件已不在', 'a zh window reads the line in Chinese') + assert.equal(textOf(spanIn('meeting-e', 'bt-project-path')), 'decisions/2026-10-31-next.md', 'a zh window never translates a path') + const row = all(ProjectBoardPane(goneRecord())).find(node => node.props?.['data-status'] === 'decided') + assert.equal(row.props['data-status'], 'decided', 'the row still reads decided') + assert.match(textOf(row), /Which board carries the record\?/, 'the question is host data and stays') + assert.match(textOf(row), /@Chief/, 'the speaker stays as the host named it') + assert.match(textOf(row), /决策文件已不在/) + } finally { + off() + } +})