From e201a45dfc487a8592e944cf097dfc7e951312fc Mon Sep 17 00:00:00 2001 From: Wegent Test Date: Mon, 13 Jul 2026 15:30:51 +0800 Subject: [PATCH] fix(wework): resume blocked goals --- wework/src/components/chat/ChatInput.test.tsx | 31 ++++++++++++++++++- .../chat/composer/GoalStatusBar.tsx | 12 +++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/wework/src/components/chat/ChatInput.test.tsx b/wework/src/components/chat/ChatInput.test.tsx index cb45a36f477..537c5febe63 100644 --- a/wework/src/components/chat/ChatInput.test.tsx +++ b/wework/src/components/chat/ChatInput.test.tsx @@ -2400,7 +2400,36 @@ describe('ChatInput', () => { expect(screen.getByTestId('pause-goal-button')).toBeInTheDocument() }) - test.each(['blocked', 'usageLimited', 'budgetLimited'] as const)( + test('offers the resume action for a blocked goal', async () => { + const onResumeGoal = vi.fn() + + render( + + ) + + await userEvent.click(screen.getByTestId('resume-goal-button')) + + expect(onResumeGoal).toHaveBeenCalledTimes(1) + }) + + test.each(['usageLimited', 'budgetLimited'] as const)( 'does not offer the pause action for a %s goal', status => { render( diff --git a/wework/src/components/chat/composer/GoalStatusBar.tsx b/wework/src/components/chat/composer/GoalStatusBar.tsx index 0af80414991..f001e8719ab 100644 --- a/wework/src/components/chat/composer/GoalStatusBar.tsx +++ b/wework/src/components/chat/composer/GoalStatusBar.tsx @@ -40,13 +40,13 @@ export function GoalStatusBar({ [goal, timerKey, timerState] ) const elapsed = formatGoalElapsed(elapsedSeconds) - const paused = goal.status === 'paused' - const canToggle = goal.status === 'active' || paused - const ToggleIcon = paused ? Play : Pause - const toggleLabel = paused + const resumable = goal.status === 'paused' || goal.status === 'blocked' + const canToggle = goal.status === 'active' || resumable + const ToggleIcon = resumable ? Play : Pause + const toggleLabel = resumable ? t('workbench.goal_resume', '继续目标') : t('workbench.goal_pause', '暂停目标') - const toggleAction = paused ? onResumeGoal : onPauseGoal + const toggleAction = resumable ? onResumeGoal : onPauseGoal useEffect(() => { if (goal.status !== 'active') return @@ -87,7 +87,7 @@ export function GoalStatusBar({ {canToggle && (