diff --git a/changelog.d/3114-cut-36-running-status.fixed.md b/changelog.d/3114-cut-36-running-status.fixed.md new file mode 100644 index 000000000..2b6bf5306 --- /dev/null +++ b/changelog.d/3114-cut-36-running-status.fixed.md @@ -0,0 +1 @@ +A running task on the Project board now reads `claimed` / `working` in Chinese instead of the host task ids ([#3114](https://github.com/ThinkFlowLab/FlyBot/issues/3114)). diff --git a/core/client.js b/core/client.js index 8cf35e3b4..159f7e1d6 100644 --- a/core/client.js +++ b/core/client.js @@ -1656,6 +1656,10 @@ var ZH = { // so the ids that read emits are keys of their own (#1813). running: "运行中", stalled: "已停滞", + // The running table's Status column reads the host task ids through the same lookup (#3114); + // `claimed` and `working` are the only two states that table can hold. + claimed: "已认领", + working: "进行中", // 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: "待讨论", diff --git a/core/src/client/i18n.js b/core/src/client/i18n.js index 4e92e04e1..3ec14522d 100644 --- a/core/src/client/i18n.js +++ b/core/src/client/i18n.js @@ -1613,6 +1613,10 @@ const ZH = { // so the ids that read emits are keys of their own (#1813). running: '运行中', stalled: '已停滞', + // The running table's Status column reads the host task ids through the same lookup (#3114); + // `claimed` and `working` are the only two states that table can hold. + claimed: '已认领', + working: '进行中', // 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: '待讨论', diff --git a/core/test/project-board-view.test.js b/core/test/project-board-view.test.js index 622d3fef6..ea91db4ef 100644 --- a/core/test/project-board-view.test.js +++ b/core/test/project-board-view.test.js @@ -1107,3 +1107,28 @@ test('#3114 cut 35: a meeting still open, deliberating or blocked reads its stat off() } }) + +// #3114 cut 36: the running table's Status column already reads `t(row.status)`; the two states the +// host actually emits had no dictionary keys, so a zh window drew `claimed` / `working` bare. +const runningRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows: [], canManage: false, decisions: { dir: '/team/flybot', files: [] }, meetings: { decided: [], pending: [], reason: '' }, + metrics: { + ok: true, metrics: {}, running: [ + { id: 'task-c', title: 'Claim it', status: 'claimed', who: 'Dev', sinceMs: 1000, source: 'group', lastActivityAt: 1 }, + { id: 'task-w', title: 'Work it', status: 'working', who: 'Dev', sinceMs: 2000, source: 'bot', lastActivityAt: 1 }, + { id: 'task-h', title: 'Hold it', status: 'on-hold', who: 'Dev', sinceMs: 3000, source: 'workflow', lastActivityAt: 1 }, + ], + }, +}) +// The Status span is picked by its class alone; `data-task-id` stays the host id and is not the copy. +const runningStatuses = () => all(ProjectBoardPane(runningRecord())) + .filter(node => node.props?.className === 'bt-project-running-status').map(textOf) +test('#3114 cut 36: a running task reads its status in the window language', () => { + assert.deepEqual(runningStatuses(), ['claimed', 'working', 'on-hold'], 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.deepEqual(runningStatuses(), ['已认领', '进行中', 'on-hold'], 'the two in-flight states read in the window language; an unknown id stays as it came') + } finally { + off() + } +}) diff --git a/patches/ds-bot/0001-core-fixes.patch b/patches/ds-bot/0001-core-fixes.patch index 2b96a9523..eaa4227c6 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,99 @@ const ZH = { +@@ -838,6 +838,103 @@ const ZH = { 'Up one level': '上一级', 'No folders inside.': '里面没有文件夹。', 'Some folders are not shown.': '还有一些文件夹没有显示。', @@ -1971,6 +1971,10 @@ 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 running table's Status column reads the host task ids through the same lookup (#3114); ++ // `claimed` and `working` are the only two states that table can hold. ++ claimed: '已认领', ++ working: '进行中', + // 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: '待讨论', diff --git a/patches/ds-bot/0008-client-bundle.patch b/patches/ds-bot/0008-client-bundle.patch index 01be6fc0c..3d85c63ed 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,100 @@ var ZH = { +@@ -887,7 +887,104 @@ var ZH = { "Use this folder": "使用这个文件夹", "Up one level": "上一级", "No folders inside.": "里面没有文件夹。", @@ -1226,6 +1226,10 @@ diff --git a/client.js b/client.js + // so the ids that read emits are keys of their own (#1813). + running: "运行中", + stalled: "已停滞", ++ // The running table's Status column reads the host task ids through the same lookup (#3114); ++ // `claimed` and `working` are the only two states that table can hold. ++ claimed: "已认领", ++ working: "进行中", + // 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: "待讨论", 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 622d3fef6..ea91db4ef 100644 --- a/patches/ds-bot/files/test/project-board-view.test.js +++ b/patches/ds-bot/files/test/project-board-view.test.js @@ -1107,3 +1107,28 @@ test('#3114 cut 35: a meeting still open, deliberating or blocked reads its stat off() } }) + +// #3114 cut 36: the running table's Status column already reads `t(row.status)`; the two states the +// host actually emits had no dictionary keys, so a zh window drew `claimed` / `working` bare. +const runningRecord = () => ({ + project: { id: 'project-1', name: 'FlyBot' }, rows: [], canManage: false, decisions: { dir: '/team/flybot', files: [] }, meetings: { decided: [], pending: [], reason: '' }, + metrics: { + ok: true, metrics: {}, running: [ + { id: 'task-c', title: 'Claim it', status: 'claimed', who: 'Dev', sinceMs: 1000, source: 'group', lastActivityAt: 1 }, + { id: 'task-w', title: 'Work it', status: 'working', who: 'Dev', sinceMs: 2000, source: 'bot', lastActivityAt: 1 }, + { id: 'task-h', title: 'Hold it', status: 'on-hold', who: 'Dev', sinceMs: 3000, source: 'workflow', lastActivityAt: 1 }, + ], + }, +}) +// The Status span is picked by its class alone; `data-task-id` stays the host id and is not the copy. +const runningStatuses = () => all(ProjectBoardPane(runningRecord())) + .filter(node => node.props?.className === 'bt-project-running-status').map(textOf) +test('#3114 cut 36: a running task reads its status in the window language', () => { + assert.deepEqual(runningStatuses(), ['claimed', 'working', 'on-hold'], 'an English window is unchanged') + const off = installLocale(fakeLocale('zh')) + try { + assert.deepEqual(runningStatuses(), ['已认领', '进行中', 'on-hold'], 'the two in-flight states read in the window language; an unknown id stays as it came') + } finally { + off() + } +})