Skip to content

Commit c7b0560

Browse files
committed
Read a meeting's state in the window's language (#3114)
Docs-not-needed: three dictionary keys and one t() in the Project board; no component structure changes.
1 parent 641faf1 commit c7b0560

9 files changed

Lines changed: 103 additions & 6 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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)).

‎core/client.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,6 +1656,11 @@ var ZH = {
16561656
// so the ids that read emits are keys of their own (#1813).
16571657
running: "运行中",
16581658
stalled: "已停滞",
1659+
// The pending decision card is still open, deliberating or blocked (#3114): the ids the host
1660+
// keys the card by are keys of their own, beside the lease states above.
1661+
open: "待讨论",
1662+
deliberating: "讨论中",
1663+
blocked: "待答复",
16591664
"Projects": "项目",
16601665
"New Project": "新建项目",
16611666
"Project name": "项目名称",
@@ -12846,7 +12851,7 @@ function ProjectBoardRecord({ record, projectId, call: call4 }) {
1284612851
recipientText(meeting.recipients) === null ? null : (0, import_react23.createElement)("span", { className: "bt-project-recipients" }, recipientText(meeting.recipients)),
1284712852
meeting.advance.allowed ? null : (0, import_react23.createElement)("span", { className: "bt-project-paused" }, meeting.advance.reason),
1284812853
proxyRow(meeting),
12849-
(0, import_react23.createElement)("span", { className: "bt-project-status" }, meeting.status)
12854+
(0, import_react23.createElement)("span", { className: "bt-project-status" }, t(meeting.status))
1285012855
));
1285112856
const moreLine = (hidden, key) => hidden > 0 ? (0, import_react23.createElement)("div", { key, className: "bt-project-more" }, t("{count} more not shown", { count: hidden })) : null;
1285212857
const emptyLine = (state) => text(state?.host) !== "" ? hostText(state.host) : t(state?.key ?? "", state?.params);

‎core/src/client/i18n.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,6 +1613,11 @@ const ZH = {
16131613
// so the ids that read emits are keys of their own (#1813).
16141614
running: '运行中',
16151615
stalled: '已停滞',
1616+
// The pending decision card is still open, deliberating or blocked (#3114): the ids the host
1617+
// keys the card by are keys of their own, beside the lease states above.
1618+
open: '待讨论',
1619+
deliberating: '讨论中',
1620+
blocked: '待答复',
16161621
'Projects': '项目',
16171622
'New Project': '新建项目',
16181623
'Project name': '项目名称',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ function ProjectBoardRecord({ record, projectId, call }) {
660660
recipientText(meeting.recipients) === null ? null : h('span', { className: 'bt-project-recipients' }, recipientText(meeting.recipients)),
661661
meeting.advance.allowed ? null : h('span', { className: 'bt-project-paused' }, meeting.advance.reason),
662662
proxyRow(meeting),
663-
h('span', { className: 'bt-project-status' }, meeting.status)))
663+
h('span', { className: 'bt-project-status' }, t(meeting.status))))
664664
// #2021: one line under a capped list says how many rows the host left out. A host that sends no
665665
// total, or one that matches the rows drawn, renders nothing at all.
666666
const moreLine = (hidden, key) => (hidden > 0

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,3 +1069,41 @@ test('#3114 cut 34: a decided meeting whose file is gone reads in the window lan
10691069
off()
10701070
}
10711071
})
1072+
1073+
// #3114 cut 35: a meeting still open, deliberating or blocked drew the host id on the Project
1074+
// board. The three ids are keys of their own, the same shape `running` / `stalled` already uses.
1075+
// Only the drawn state is the page's copy: `data-status`, the question and the level stay the
1076+
// host's own, and a status the client cannot name is drawn as it came, never guessed.
1077+
const pendingRecord = () => ({
1078+
project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] },
1079+
meetings: {
1080+
decided: [],
1081+
pending: [
1082+
{ id: 'meeting-a', date: '2026-10-30', question: 'Which board carries the record?', status: 'open', level: 'ordinary' },
1083+
{ id: 'meeting-b', date: '2026-10-31', question: 'Should the board page?', status: 'deliberating', level: 'major' },
1084+
{ id: 'meeting-c', date: '2026-11-01', question: 'Which stream carries it?', status: 'blocked', level: 'severe', blockingQuestion: 'Which stream carries it?' },
1085+
{ id: 'meeting-d', date: '2026-11-02', question: 'Which board carries the next record?', status: 'on-hold', level: 'ordinary' },
1086+
], reason: '',
1087+
},
1088+
})
1089+
// `.bt-project-status` is drawn once per pending row, so the row is found by its key and the span by its class.
1090+
const pendingRow = id => all(ProjectBoardPane(pendingRecord())).find(node => node.props?.key === `meeting:${id}`)
1091+
const statusOf = id => textOf(all(pendingRow(id)).find(node => node.props?.className === 'bt-project-status'))
1092+
1093+
test('#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language', () => {
1094+
assert.equal(statusOf('meeting-c'), 'blocked', 'an English window is unchanged')
1095+
const off = installLocale(fakeLocale('zh'))
1096+
try {
1097+
assert.equal(statusOf('meeting-a'), '待讨论', 'an open meeting reads its state in Chinese')
1098+
assert.equal(statusOf('meeting-b'), '讨论中', 'a deliberating meeting reads its state in Chinese')
1099+
assert.equal(statusOf('meeting-c'), '待答复', 'a blocked meeting reads its state in Chinese')
1100+
assert.equal(statusOf('meeting-d'), 'on-hold', 'a status the client cannot name is drawn as it came')
1101+
const statuses = ['meeting-a', 'meeting-b', 'meeting-c', 'meeting-d'].map(id => pendingRow(id).props['data-status'])
1102+
assert.deepEqual(statuses, ['open', 'deliberating', 'blocked', 'on-hold'], 'the attribute stays the host id')
1103+
const blocked = pendingRow('meeting-c')
1104+
assert.match(textOf(blocked), /Which stream carries it\?/, 'the host blocking question stays as it came')
1105+
assert.match(textOf(blocked), /严重/, 'the level still reads in the window language')
1106+
} finally {
1107+
off()
1108+
}
1109+
})

‎patches/ds-bot/0001-core-fixes.patch‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
19461946
'Working folder': '工作文件夹',
19471947
'Working folder: {folder}': '工作文件夹:{folder}',
19481948
Folder: '文件夹',
1949-
@@ -838,6 +838,94 @@ const ZH = {
1949+
@@ -838,6 +838,99 @@ const ZH = {
19501950
'Up one level': '上一级',
19511951
'No folders inside.': '里面没有文件夹。',
19521952
'Some folders are not shown.': '还有一些文件夹没有显示。',
@@ -1971,6 +1971,11 @@ diff --git a/src/client/i18n.js b/src/client/i18n.js
19711971
+ // so the ids that read emits are keys of their own (#1813).
19721972
+ running: '运行中',
19731973
+ stalled: '已停滞',
1974+
+ // The pending decision card is still open, deliberating or blocked (#3114): the ids the host
1975+
+ // keys the card by are keys of their own, beside the lease states above.
1976+
+ open: '待讨论',
1977+
+ deliberating: '讨论中',
1978+
+ blocked: '待答复',
19741979
+ 'Projects': '项目',
19751980
+ 'New Project': '新建项目',
19761981
+ 'Project name': '项目名称',

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ diff --git a/client.js b/client.js
11991199
"Working folder": "工作文件夹",
12001200
"Working folder: {folder}": "工作文件夹:{folder}",
12011201
Folder: "文件夹",
1202-
@@ -887,7 +887,95 @@ var ZH = {
1202+
@@ -887,7 +887,100 @@ var ZH = {
12031203
"Use this folder": "使用这个文件夹",
12041204
"Up one level": "上一级",
12051205
"No folders inside.": "里面没有文件夹。",
@@ -1226,6 +1226,11 @@ diff --git a/client.js b/client.js
12261226
+ // so the ids that read emits are keys of their own (#1813).
12271227
+ running: "运行中",
12281228
+ stalled: "已停滞",
1229+
+ // The pending decision card is still open, deliberating or blocked (#3114): the ids the host
1230+
+ // keys the card by are keys of their own, beside the lease states above.
1231+
+ open: "待讨论",
1232+
+ deliberating: "讨论中",
1233+
+ blocked: "待答复",
12291234
+ "Projects": "项目",
12301235
+ "New Project": "新建项目",
12311236
+ "Project name": "项目名称",
@@ -16314,7 +16319,7 @@ diff --git a/client.js b/client.js
1631416319
+ recipientText(meeting.recipients) === null ? null : (0, import_react23.createElement)("span", { className: "bt-project-recipients" }, recipientText(meeting.recipients)),
1631516320
+ meeting.advance.allowed ? null : (0, import_react23.createElement)("span", { className: "bt-project-paused" }, meeting.advance.reason),
1631616321
+ proxyRow(meeting),
16317-
+ (0, import_react23.createElement)("span", { className: "bt-project-status" }, meeting.status)
16322+
+ (0, import_react23.createElement)("span", { className: "bt-project-status" }, t(meeting.status))
1631816323
+ ));
1631916324
+ const moreLine = (hidden, key) => hidden > 0 ? (0, import_react23.createElement)("div", { key, className: "bt-project-more" }, t("{count} more not shown", { count: hidden })) : null;
1632016325
+ const emptyLine = (state) => text(state?.host) !== "" ? hostText(state.host) : t(state?.key ?? "", state?.params);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ function ProjectBoardRecord({ record, projectId, call }) {
660660
recipientText(meeting.recipients) === null ? null : h('span', { className: 'bt-project-recipients' }, recipientText(meeting.recipients)),
661661
meeting.advance.allowed ? null : h('span', { className: 'bt-project-paused' }, meeting.advance.reason),
662662
proxyRow(meeting),
663-
h('span', { className: 'bt-project-status' }, meeting.status)))
663+
h('span', { className: 'bt-project-status' }, t(meeting.status))))
664664
// #2021: one line under a capped list says how many rows the host left out. A host that sends no
665665
// total, or one that matches the rows drawn, renders nothing at all.
666666
const moreLine = (hidden, key) => (hidden > 0

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,3 +1069,41 @@ test('#3114 cut 34: a decided meeting whose file is gone reads in the window lan
10691069
off()
10701070
}
10711071
})
1072+
1073+
// #3114 cut 35: a meeting still open, deliberating or blocked drew the host id on the Project
1074+
// board. The three ids are keys of their own, the same shape `running` / `stalled` already uses.
1075+
// Only the drawn state is the page's copy: `data-status`, the question and the level stay the
1076+
// host's own, and a status the client cannot name is drawn as it came, never guessed.
1077+
const pendingRecord = () => ({
1078+
project: { id: 'project-1', name: 'FlyBot' }, rows, canManage: false, decisions: { dir: '/team/flybot', files: [] },
1079+
meetings: {
1080+
decided: [],
1081+
pending: [
1082+
{ id: 'meeting-a', date: '2026-10-30', question: 'Which board carries the record?', status: 'open', level: 'ordinary' },
1083+
{ id: 'meeting-b', date: '2026-10-31', question: 'Should the board page?', status: 'deliberating', level: 'major' },
1084+
{ id: 'meeting-c', date: '2026-11-01', question: 'Which stream carries it?', status: 'blocked', level: 'severe', blockingQuestion: 'Which stream carries it?' },
1085+
{ id: 'meeting-d', date: '2026-11-02', question: 'Which board carries the next record?', status: 'on-hold', level: 'ordinary' },
1086+
], reason: '',
1087+
},
1088+
})
1089+
// `.bt-project-status` is drawn once per pending row, so the row is found by its key and the span by its class.
1090+
const pendingRow = id => all(ProjectBoardPane(pendingRecord())).find(node => node.props?.key === `meeting:${id}`)
1091+
const statusOf = id => textOf(all(pendingRow(id)).find(node => node.props?.className === 'bt-project-status'))
1092+
1093+
test('#3114 cut 35: a meeting still open, deliberating or blocked reads its state in the window language', () => {
1094+
assert.equal(statusOf('meeting-c'), 'blocked', 'an English window is unchanged')
1095+
const off = installLocale(fakeLocale('zh'))
1096+
try {
1097+
assert.equal(statusOf('meeting-a'), '待讨论', 'an open meeting reads its state in Chinese')
1098+
assert.equal(statusOf('meeting-b'), '讨论中', 'a deliberating meeting reads its state in Chinese')
1099+
assert.equal(statusOf('meeting-c'), '待答复', 'a blocked meeting reads its state in Chinese')
1100+
assert.equal(statusOf('meeting-d'), 'on-hold', 'a status the client cannot name is drawn as it came')
1101+
const statuses = ['meeting-a', 'meeting-b', 'meeting-c', 'meeting-d'].map(id => pendingRow(id).props['data-status'])
1102+
assert.deepEqual(statuses, ['open', 'deliberating', 'blocked', 'on-hold'], 'the attribute stays the host id')
1103+
const blocked = pendingRow('meeting-c')
1104+
assert.match(textOf(blocked), /Which stream carries it\?/, 'the host blocking question stays as it came')
1105+
assert.match(textOf(blocked), /严重/, 'the level still reads in the window language')
1106+
} finally {
1107+
off()
1108+
}
1109+
})

0 commit comments

Comments
 (0)