Botframework-webchat: Need to increase the timeout for TypingAnimation

Created on 27 May 2019  路  6Comments  路  Source: microsoft/BotFramework-WebChat

@compulim: Please see "How to fix" below, https://github.com/microsoft/BotFramework-WebChat/issues/2031#issuecomment-510964209.

Feature request

I need to increase the timeout of the typing animation shown by the bot. Currently, the bot typing animation disappears after 2 sec or so. I need to increase to 6 sec. I tried following the approach of setting SendTimeout explicitly but it doesn't seem to work.

  window.WebChat.renderWebChat({
                directLine: window.WebChat.createDirectLine({
                    token: params['s'],
                    userID: params['username'],
                    user: {id: params['userid']},          
                }),
                store, username: params['username'],
                userID: params['userid'], **sendTimeout: 60000**,
                styleSet,
                sendTypingIndicator: true,
            },
            document.getElementById("webchat")
        );

Any idea of how can I Increase the timeout for typing Animation.

(Edited by @compulim for code formatting)

Bot Services customer-replied-to customer-reported front-burner

Most helpful comment

Hi!
We need this feature too.
Thanks for your work on it.

All 6 comments

Hi @mathurvarun84, the typing indicator is not currently customizable. After speaking with the team, we are interested in enabling users to modify the duration. This has been added to our backlog. Thank you!

Hi!
We need this feature too.
Thanks for your work on it.

Hi,
This would be very nice feature to have. Looking forward to it.

Hi
i changed this value (3e3) => (6e5)
search this text : ofType("Show_Typing").delay(3e3)
in this file
https://cdn.botframework.com/botframework-webchat/latest/botchat-es5.js

works for me

How to fix

Implementation

  • Today, we use saga to control how long to show typing

    • "How long" is a question on UI, not back end. Thus, the better design is to move it away from saga

  • Tomorrow

    • Use debounce in UI to control how long to show typing

    • Move typing indicator into send box



      • This will greatly reduce code complexity



    • Add typingIndicatorTimeout to styleOptions

Tests

  • Basic test

    • Default value

    • Non-default value

    • New activity from bot come in and it should immediately remove typing indicator

  • Corner cases

    • After the typing indicator "faded away", setting styleOptions.typingIndicatorTimeout to a bigger value should bring it back

https://github.com/microsoft/BotFramework-WebChat/pull/2321 Added a typingAnimationDuration option to the default style options - default is 5000 milliseconds. This feature will be available in Web Chat's next release in October.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

electrobabe picture electrobabe  路  4Comments

compulim picture compulim  路  3Comments

corinagum picture corinagum  路  3Comments

adriantan08 picture adriantan08  路  3Comments

corinagum picture corinagum  路  3Comments