diff --git a/changelog.d/3114-cut-35-meeting-status.fixed.md b/changelog.d/3114-cut-35-meeting-status.fixed.md new file mode 100644 index 000000000..42e91dc47 --- /dev/null +++ b/changelog.d/3114-cut-35-meeting-status.fixed.md @@ -0,0 +1 @@ +A meeting that is still open, deliberating or blocked now reads that state in Chinese on the Project board instead of the host ids `open` / `deliberating` / `blocked` ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)). diff --git a/core/client.js b/core/client.js index c3f94f34e..8cf35e3b4 100644 --- a/core/client.js +++ b/core/client.js @@ -1656,6 +1656,11 @@ var ZH = { // so the ids that read emits are keys of their own (#1813). running: "运行中", stalled: "已停滞", + // The pending decision card is still open, deliberating or blocked (#3114): the ids the host + // keys the card by are keys of their own, beside the lease states above. + open: "待讨论", + deliberating: "讨论中", + blocked: "待答复", "Projects": "项目", "New Project": "新建项目", "Project name": "项目名称", @@ -12846,7 +12851,7 @@ function ProjectBoardRecord({ record, projectId, call: call4 }) { recipientText(meeting.recipients) === null ? null : (0, import_react23.createElement)("span", { className: "bt-project-recipients" }, recipientText(meeting.recipients)), meeting.advance.allowed ? null : (0, import_react23.createElement)("span", { className: "bt-project-paused" }, meeting.advance.reason), proxyRow(meeting), - (0, import_react23.createElement)("span", { className: "bt-project-status" }, meeting.status) + (0, import_react23.createElement)("span", { className: "bt-project-status" }, t(meeting.status)) )); const moreLine = (hidden, key) => hidden > 0 ? (0, import_react23.createElement)("div", { key, className: "bt-project-more" }, t("{count} more not shown", { count: hidden })) : null; const emptyLine = (state) => text(state?.host) !== "" ? hostText(state.host) : t(state?.key ?? "", state?.params); diff --git a/core/src/client/i18n.js b/core/src/client/i18n.js index b3c8818e6..4e92e04e1 100644 --- a/core/src/client/i18n.js +++ b/core/src/client/i18n.js @@ -1613,6 +1613,11 @@ const ZH = { // so the ids that read emits are keys of their own (#1813). running: '运行中', stalled: '已停滞', + // The pending decision card is still open, deliberating or blocked (#3114): the ids the host + // keys the card by are keys of their own, beside the lease states above. + open: '待讨论', + deliberating: '讨论中', + blocked: '待答复', 'Projects': '项目', 'New Project': '新建项目', 'Project name': '项目名称', diff --git a/core/src/client/project-board.js b/core/src/client/project-board.js index 78e294832..116859362 100644 --- a/core/src/client/project-board.js +++ b/core/src/client/project-board.js @@ -660,7 +660,7 @@ function ProjectBoardRecord({ record, projectId, call }) { recipientText(meeting.recipients) === null ? null : h('span', { className: 'bt-project-recipients' }, recipientText(meeting.recipients)), meeting.advance.allowed ? null : h('span', { className: 'bt-project-paused' }, meeting.advance.reason), proxyRow(meeting), - h('span', { className: 'bt-project-status' }, meeting.status))) + h('span', { className: 'bt-project-status' }, t(meeting.status)))) // #2021: one line under a capped list says how many rows the host left out. A host that sends no // total, or one that matches the rows drawn, renders nothing at all. const moreLine = (hidden, key) => (hidden > 0 diff --git a/core/test/project-board-view.test.js b/core/test/project-board-view.test.js index fd62e0ef6..622d3fef6 100644 --- a/core/test/project-board-view.test.js +++ b/core/test/project-board-view.test.js @@ -1069,3 +1069,41 @@ test('#3114 cut 34: a decided meeting whose file is gone reads in the window lan off() } }) + +// #3114 cut 35: a meeting still open, deliberating or blocked drew the host id on the Project +// board. The three ids are keys of their own, the same shape `running` / `stalled` already uses. +// Only the drawn state is the page's copy: `data-status`, the question and the level stay the +// host's own, and a status the client cannot name is drawn as it came, never guessed. +const pendingRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] }, + meetings: { + decided: [], + pending: [ + { id: 'meeting-a', date: '2026-10-30', question: 'Which board carries the record?', status: 'open', level: 'ordinary' }, + { id: 'meeting-b', date: '2026-10-31', question: 'Should the board page?', status: 'deliberating', level: 'major' }, + { id: 'meeting-c', date: '2026-11-01', question: 'Which stream carries it?', status: 'blocked', level: 'severe', blockingQuestion: 'Which stream carries it?' }, + { id: 'meeting-d', date: '2026-11-02', question: 'Which board carries the next record?', status: 'on-hold', level: 'ordinary' }, + ], reason: '', + }, +}) +// `.bt-project-status` is drawn once per pending row, so the row is found by its key and the span by its class. +const pendingRow = id => all(ProjectBoardPane(pendingRecord())).find(node => node.props?.key === `meeting:${id}`) +const statusOf = id => textOf(all(pendingRow(id)).find(node => node.props?.className === 'bt-project-status')) + +test('#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language', () => { + assert.equal(statusOf('meeting-c'), 'blocked', 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.equal(statusOf('meeting-a'), '待讨论', 'an open meeting reads its state in Chinese') + assert.equal(statusOf('meeting-b'), '讨论中', 'a deliberating meeting reads its state in Chinese') + assert.equal(statusOf('meeting-c'), '待答复', 'a blocked meeting reads its state in Chinese') + assert.equal(statusOf('meeting-d'), 'on-hold', 'a status the client cannot name is drawn as it came') + const statuses = ['meeting-a', 'meeting-b', 'meeting-c', 'meeting-d'].map(id => pendingRow(id).props['data-status']) + assert.deepEqual(statuses, ['open', 'deliberating', 'blocked', 'on-hold'], 'the attribute stays the host id') + const blocked = pendingRow('meeting-c') + assert.match(textOf(blocked), /Which stream carries it\?/, 'the host blocking question stays as it came') + assert.match(textOf(blocked), /严重/, 'the level still reads in the window language') + } finally { + off() + } +}) diff --git a/patches/ds-bot/0001-core-fixes.patch b/patches/ds-bot/0001-core-fixes.patch index aac83ebf9..2b96a9523 100644 --- a/patches/ds-bot/0001-core-fixes.patch +++ b/patches/ds-bot/0001-core-fixes.patch @@ -1946,7 +1946,7 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js 'Working folder': '工作文件夹', 'Working folder: {folder}': '工作文件夹:{folder}', Folder: '文件夹', -@@ -838,6 +838,94 @@ const ZH = { +@@ -838,6 +838,99 @@ const ZH = { 'Up one level': '上一级', 'No folders inside.': '里面没有文件夹。', 'Some folders are not shown.': '还有一些文件夹没有显示。', @@ -1971,6 +1971,11 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js + // so the ids that read emits are keys of their own (#1813). + running: '运行中', + stalled: '已停滞', ++ // The pending decision card is still open, deliberating or blocked (#3114): the ids the host ++ // keys the card by are keys of their own, beside the lease states above. ++ open: '待讨论', ++ deliberating: '讨论中', ++ blocked: '待答复', + 'Projects': '项目', + 'New Project': '新建项目', + 'Project name': '项目名称', diff --git a/patches/ds-bot/0008-client-bundle.patch b/patches/ds-bot/0008-client-bundle.patch index da0e0f38f..01be6fc0c 100644 --- a/patches/ds-bot/0008-client-bundle.patch +++ b/patches/ds-bot/0008-client-bundle.patch @@ -1199,7 +1199,7 @@ diff --git a/client.js b/client.js "Working folder": "工作文件夹", "Working folder: {folder}": "工作文件夹:{folder}", Folder: "文件夹", -@@ -887,7 +887,95 @@ var ZH = { +@@ -887,7 +887,100 @@ var ZH = { "Use this folder": "使用这个文件夹", "Up one level": "上一级", "No folders inside.": "里面没有文件夹。", @@ -1226,6 +1226,11 @@ diff --git a/client.js b/client.js + // so the ids that read emits are keys of their own (#1813). + running: "运行中", + stalled: "已停滞", ++ // The pending decision card is still open, deliberating or blocked (#3114): the ids the host ++ // keys the card by are keys of their own, beside the lease states above. ++ open: "待讨论", ++ deliberating: "讨论中", ++ blocked: "待答复", + "Projects": "项目", + "New Project": "新建项目", + "Project name": "项目名称", @@ -16314,7 +16319,7 @@ diff --git a/client.js b/client.js + recipientText(meeting.recipients) === null ? null : (0, import_react23.createElement)("span", { className: "bt-project-recipients" }, recipientText(meeting.recipients)), + meeting.advance.allowed ? null : (0, import_react23.createElement)("span", { className: "bt-project-paused" }, meeting.advance.reason), + proxyRow(meeting), -+ (0, import_react23.createElement)("span", { className: "bt-project-status" }, meeting.status) ++ (0, import_react23.createElement)("span", { className: "bt-project-status" }, t(meeting.status)) + )); + const moreLine = (hidden, key) => hidden > 0 ? (0, import_react23.createElement)("div", { key, className: "bt-project-more" }, t("{count} more not shown", { count: hidden })) : null; + const emptyLine = (state) => text(state?.host) !== "" ? hostText(state.host) : t(state?.key ?? "", state?.params); diff --git a/patches/ds-bot/files/src/client/project-board.js b/patches/ds-bot/files/src/client/project-board.js index 78e294832..116859362 100644 --- a/patches/ds-bot/files/src/client/project-board.js +++ b/patches/ds-bot/files/src/client/project-board.js @@ -660,7 +660,7 @@ function ProjectBoardRecord({ record, projectId, call }) { recipientText(meeting.recipients) === null ? null : h('span', { className: 'bt-project-recipients' }, recipientText(meeting.recipients)), meeting.advance.allowed ? null : h('span', { className: 'bt-project-paused' }, meeting.advance.reason), proxyRow(meeting), - h('span', { className: 'bt-project-status' }, meeting.status))) + h('span', { className: 'bt-project-status' }, t(meeting.status)))) // #2021: one line under a capped list says how many rows the host left out. A host that sends no // total, or one that matches the rows drawn, renders nothing at all. const moreLine = (hidden, key) => (hidden > 0 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 fd62e0ef6..622d3fef6 100644 --- a/patches/ds-bot/files/test/project-board-view.test.js +++ b/patches/ds-bot/files/test/project-board-view.test.js @@ -1069,3 +1069,41 @@ test('#3114 cut 34: a decided meeting whose file is gone reads in the window lan off() } }) + +// #3114 cut 35: a meeting still open, deliberating or blocked drew the host id on the Project +// board. The three ids are keys of their own, the same shape `running` / `stalled` already uses. +// Only the drawn state is the page's copy: `data-status`, the question and the level stay the +// host's own, and a status the client cannot name is drawn as it came, never guessed. +const pendingRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] }, + meetings: { + decided: [], + pending: [ + { id: 'meeting-a', date: '2026-10-30', question: 'Which board carries the record?', status: 'open', level: 'ordinary' }, + { id: 'meeting-b', date: '2026-10-31', question: 'Should the board page?', status: 'deliberating', level: 'major' }, + { id: 'meeting-c', date: '2026-11-01', question: 'Which stream carries it?', status: 'blocked', level: 'severe', blockingQuestion: 'Which stream carries it?' }, + { id: 'meeting-d', date: '2026-11-02', question: 'Which board carries the next record?', status: 'on-hold', level: 'ordinary' }, + ], reason: '', + }, +}) +// `.bt-project-status` is drawn once per pending row, so the row is found by its key and the span by its class. +const pendingRow = id => all(ProjectBoardPane(pendingRecord())).find(node => node.props?.key === `meeting:${id}`) +const statusOf = id => textOf(all(pendingRow(id)).find(node => node.props?.className === 'bt-project-status')) + +test('#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language', () => { + assert.equal(statusOf('meeting-c'), 'blocked', 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.equal(statusOf('meeting-a'), '待讨论', 'an open meeting reads its state in Chinese') + assert.equal(statusOf('meeting-b'), '讨论中', 'a deliberating meeting reads its state in Chinese') + assert.equal(statusOf('meeting-c'), '待答复', 'a blocked meeting reads its state in Chinese') + assert.equal(statusOf('meeting-d'), 'on-hold', 'a status the client cannot name is drawn as it came') + const statuses = ['meeting-a', 'meeting-b', 'meeting-c', 'meeting-d'].map(id => pendingRow(id).props['data-status']) + assert.deepEqual(statuses, ['open', 'deliberating', 'blocked', 'on-hold'], 'the attribute stays the host id') + const blocked = pendingRow('meeting-c') + assert.match(textOf(blocked), /Which stream carries it\?/, 'the host blocking question stays as it came') + assert.match(textOf(blocked), /严重/, 'the level still reads in the window language') + } finally { + off() + } +})