mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-11 22:51:26 +00:00
This commit is contained in:
parent
37619d7850
commit
e4b051bb71
2 changed files with 32 additions and 6 deletions
|
|
@ -348,9 +348,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)
|
||||
|
|
@ -359,9 +356,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)
|
||||
|
|
|
|||
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue