Play sound only when action needed from the user#3065
Play sound only when action needed from the user#3065mrubens merged 2 commits intoRooCodeInc:mainfrom
Conversation
|
mrubens
left a comment
There was a problem hiding this comment.
Looks great, thank you for the cleanup! I'll just try it out locally and then merge.
mrubens
left a comment
There was a problem hiding this comment.
One thing I noticed is that it's no longer playing a sound when asking a question. Seems like we should probably handle that?
|
I would also check non-retried API errors and non-auto-approved MCP |
Nice catch! I found this and will update |
Good call! Just checked the logic on the code I deleted again. I'll have a update shortly to address all this and the logic will (imho) but much cleaner 👨🍳 💋 |
|
@mrubens sorry about those cases I missed - if you could retest again in the same way I think I've got them all now - at least all the ones that used to be handled by that deleted "sound only" section |
|
Nice, thank you! |
Context
Looking at #2190 I wanted to make sure that sounds only play when action is needed from the user.
There already was some logic around
!isAutoApprovedbut in my testing, I found that to be lacking. Sometimes I would get the same sound played back to back, and there over all was a lot of sounds happening - some of which shouldn't be there.Implementation
In looking at
ChatView.tsxI found that there were two sections where we calledplaySound:In the large case statement where we handle the incoming last messages based on type
And then again further down in the streaming section which duplicated some of that case statement. I think this might have been a previous attempt to only play sounds when coming back and needing user input, but this resulted in often getting TWO sounds played
Additionally, most of the statements in the "main" case statement already were properly checking if we needed user input using
!isAutoApproved.Thus, I decided to remove that logic, which in my testing got rid of a lot of the double sounds. However, I was still sometimes getting double sounds on tool use or at completion of a task.
I found this to be when we get only a "partial" message back and are waiting for the final message to enable user interaction. Thus, I also added a check for
!isPartialaround these sounds - which is also what handles things likesetTextAreaDisabledandsetEnableButtons. Thus, this new sound logic matches how we enable/disable buttons and other user interactions and should more closely mimic that working logicCloses #2190
Screenshots
How to Test
Get in Touch
My discord handle is
olearycrewImportant
Refines sound notification logic in
ChatView.tsxto play sounds only when user action is required, addressing issue #2190.playSoundlogic inChatView.tsxto include!isPartialcheck fortool,browser_action_launch,command, andcompletion_resultcases.This description was created by
for 7dd9bdc. You can customize this summary. It will automatically update as commits are pushed.