Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/3114-cut-36-running-status.fixed.md
Original file line number Diff line number Diff line change
@@ -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)).
4 changes: 4 additions & 0 deletions core/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: "待讨论",
Expand Down
4 changes: 4 additions & 0 deletions core/src/client/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '待讨论',
Expand Down
25 changes: 25 additions & 0 deletions core/test/project-board-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
6 changes: 5 additions & 1 deletion patches/ds-bot/0001-core-fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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.': '还有一些文件夹没有显示。',
Expand All @@ -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: '待讨论',
Expand Down
6 changes: 5 additions & 1 deletion patches/ds-bot/0008-client-bundle.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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.": "里面没有文件夹。",
Expand All @@ -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: "待讨论",
Expand Down
25 changes: 25 additions & 0 deletions patches/ds-bot/files/test/project-board-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
})
Loading