merge #1026: fix(tasks) keep owned task labels consistent with the board

This commit is contained in:
Menghuan1918 committed 2026-11-08 00:23:29 +08:00
commit 69c32e78c6
2 files changed
+28 -3

No files matched your search

+2 -2
View File
@@ -264,7 +264,7 @@ export function TaskLine(props: {
role="button"
tabIndex={0}
className={css.taskLine}
title={tasks.map(task => `${task.subject}(${t(taskStatusKey(task.status))})`).join('\n')}
title={tasks.map(task => `${task.subject}(${taskStatusLabel(task)})`).join('\n')}
onClick={(event) => {
event.stopPropagation()
props.onOpenTask(primary.id, event.currentTarget)
@@ -278,7 +278,7 @@ export function TaskLine(props: {
>
<span className={css.taskGlyph} aria-hidden="true"><IconChecklistOutlineRegular size={9} /></span>
<span className={css.taskSubject}>{primary.subject}</span>
<span className={css.taskState}>{t(taskStatusKey(primary.status))}</span>
<span className={css.taskState}>{taskStatusLabel(primary)}</span>
{tasks.length > 1 && <span className={css.taskMore}>{`+${tasks.length - 1}`}</span>}
</span>
)
+26 -1
View File
@@ -2,7 +2,8 @@
* Tasks page interaction tests (jsdom): the jobs drawer's auto-collapse at
* the agent-count threshold, the graph/tree view toggle visible in BOTH
* modes, node click → transcript jump, ⓘ → anchored popover, and the
* settled-leaf fold aggregate expanding on click.
* settled-leaf fold aggregate expanding on click. Owned task lines and
* tooltips must use the same blocked-status rule as the team board.
*/
// @vitest-environment jsdom
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
@@ -810,6 +811,28 @@ describe('Tasks page graph interactions and team board', () => {
})
describe('Tasks page: owned tasks, host-primitive controls, draggable output', () => {
it.each([
['pending', false, '阻塞'],
['pending', true, '待办'],
['in_progress', false, '进行中'],
['completed', false, '已完成'],
] as const)('keeps the board, task line and tooltip consistent for %s (ready: %s)', async (status, ready, label) => {
withTeam({ tasks: [teamTask({ status, ready, ownerName: 'writer' })] })
const store = makeStore(snapshotWithChildren(1))
const { container, unmount } = renderRoot(
createElement(SubagentView, { sessionId: 'root', active: true, ctx: makeCtx(store) }),
)
try {
await act(async () => { await Promise.resolve() })
expect(container.querySelector('[data-team-board]')?.textContent).toContain(label)
const taskLine = container.querySelector('[data-graph-node="child-0"] [role="button"]')
expect(taskLine?.textContent).toContain(label)
expect(taskLine?.getAttribute('title')).toBe(`收窄卡片(${label})`)
} finally {
unmount()
}
})
/** A board whose two tasks are both owned by the child agent. */
function teamWithOwnedTask(): void {
withTeam({
@@ -837,6 +860,8 @@ describe('Tasks page: owned tasks, host-primitive controls, draggable output', (
expect(node.textContent).toContain('收窄卡片与图标化')
expect(node.textContent).toContain('进行中')
expect(node.textContent).toContain('+1')
expect(node.querySelector('[role="button"]')?.getAttribute('title'))
.toBe('收窄卡片与图标化(进行中)\n补点击回归(阻塞)')
unmount()
})