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
6 changes: 0 additions & 6 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
setSecondaryButtonText(undefined)
break
case "resume_task":
if (!isAutoApproved(lastMessage) && !isPartial) {
playSound("notification")
}
setSendingDisabled(false)
setClineAsk("resume_task")
setEnableButtons(true)
Expand All @@ -356,9 +353,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
setDidClickCancel(false) // special case where we reset the cancel button state
break
case "resume_completed_task":
if (!isPartial) {
playSound("celebration")
}
setSendingDisabled(false)
setClineAsk("resume_completed_task")
setEnableButtons(true)
Expand Down
32 changes: 32 additions & 0 deletions webview-ui/src/components/chat/__tests__/ChatView.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,38 @@ describe("ChatView - Sound Playing Tests", () => {
expect(mockPlayFunction).toHaveBeenCalled()
})
})

it("does not play sound when resuming a task from history", async () => {
renderChatView()
mockPlayFunction.mockClear()

// Send resume_task message
mockPostMessage({
clineMessages: [
{ type: "say", say: "task", ts: Date.now() - 2000, text: "Initial task" },
{ type: "ask", ask: "resume_task", ts: Date.now(), text: "Resume task", partial: false },
],
})

await new Promise((resolve) => setTimeout(resolve, 100))
expect(mockPlayFunction).not.toHaveBeenCalled()
})

it("does not play sound when resuming a completed task from history", async () => {
renderChatView()
mockPlayFunction.mockClear()

// Send resume_completed_task message
mockPostMessage({
clineMessages: [
{ type: "say", say: "task", ts: Date.now() - 2000, text: "Initial task" },
{ type: "ask", ask: "resume_completed_task", ts: Date.now(), text: "Resume completed", partial: false },
],
})

await new Promise((resolve) => setTimeout(resolve, 100))
expect(mockPlayFunction).not.toHaveBeenCalled()
})
})

describe("ChatView - Focus Grabbing Tests", () => {
Expand Down
Loading