fix(workflow): scope clean-cycle reset to phases

This commit is contained in:
pku-xht
2026-08-12 01:09:03 +08:00
parent 1b91e5b4fe
commit 33112b4957
2 changed files with 2 additions and 20 deletions

View File

@@ -85,7 +85,7 @@ function ManualDisclosure(props: StatusDisclosureProps) {
}
function StatusDisclosure({ cleanCycleKey, requiresExpansion, ...props }: StatusDisclosureProps & {
readonly cleanCycleKey: number
readonly cleanCycleKey?: number | undefined
readonly requiresExpansion: boolean
}) {
if (!requiresExpansion) return <ManualDisclosure key={cleanCycleKey} {...props} />
@@ -139,7 +139,6 @@ function RunHeader({ children, count, name, requiresExpansion, status, t }: {
<StatusDisclosure
icon={<IconChevronRightOutline14 />}
title={t('run.title', { name })}
cleanCycleKey={count}
requiresExpansion={requiresExpansion}
expandOnRowClick
previewChevron={false}

View File

@@ -377,7 +377,7 @@ describe('WorkflowRunPanel', () => {
expect(screen.queryByText('未分阶段')).toBeNull()
})
it('refolds when a complete activity cycle arrives as one clean update', () => {
it('refolds a phase when a complete activity cycle arrives as one clean update', () => {
const firstMember = {
seq: 1, label: 'first', childId: 'child-1' as SessionId, status: 'completed' as const,
}
@@ -397,23 +397,6 @@ describe('WorkflowRunPanel', () => {
expect(screen.getByRole('button', { name: /未分阶段/ }).getAttribute('aria-expanded')).toBe('false')
expect(screen.queryByText('first')).toBeNull()
expect(screen.queryByText('second')).toBeNull()
phaseView.unmount()
const workflowClean: WorkflowRunChatData = {
name: 'workflow-cycle', status: 'completed',
phases: [phase({ members: [firstMember] })],
}
const workflowView = render(<WorkflowRunPanel {...panelProps(workflowClean)} />)
fireEvent.click(screen.getByRole('button', { name: /^workflow-cycle/ }))
expect(screen.getByText('未分阶段')).toBeTruthy()
workflowView.rerender(<WorkflowRunPanel {...panelProps({
...workflowClean,
phases: [phase({ members: [firstMember, {
seq: 2, label: 'second', childId: 'child-2' as SessionId, status: 'completed',
}] })],
})} />)
expect(screen.getByRole('button', { name: /^workflow-cycle/ }).getAttribute('aria-expanded')).toBe('false')
expect(screen.queryByText('未分阶段')).toBeNull()
})
it('derives the zero-member running and completed states from the current run status', () => {