-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add avatar image support #1486
Add avatar image support #1486
Conversation
Pull Request Test Coverage Report for Build 621
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending nitpick update!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6dbea77
to
99a698e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if motivation for the fromUser
prop is bit more brittle than it needs to be. Perhaps Avatar and Bubble could take a variant
-like prop that would scale a bit better than a boolean option, or (and my preference) could we extract the business logic from Avatar and Bubble and have the callers provide the information they expect to be used like the labels or the image source.
Happy to discuss further.
f8e0a0d
to
6966d29
Compare
6966d29
to
ffdc846
Compare
@cwhitten please let me know if the fixes incorporated are good or not. Feel free to grab me to discuss about them. 😄 |
The release branch does not have this feature working, when is the next release? |
@msekkappan Please keep an eye out for a release today! Thank you for your patience. :) |
@corinagum @compulim This is what I used to load my bot. I tried to add styleOptions but it is not working. How can I add the bot avatar using this way to implement? Thanks
|
@khmerforce are you using v4 of Web Chat? What CDN or NPM version are you using? |
@corinagum thank you for replying. https://blog.botframework.com/2017/10/11/customize-web-chat-websites/ this is what I use in order to customize the WebChat. I am trying to add your implementation in it but it is not working. |
@khmerforce it looks like you are using v3 of Web Chat from that article. In order to implement the style options made available in this PR, you will need to use Web Chat v4. Please feel free to look at our samples on this repo to learn about v4 and to decide if upgrading is realistic for your project. :) If you have further questions about v4 please feel free to file an issue! |
@corinagum sorry but is there a way I can access the CSS file? like v3? "https://cdn.botframework.com/botframework-webchat/latest/botchat.css" Thanks. Because I want to put the chat header and change the button shape, etc. |
@khmerforce please see the comments in this issue: #1466 (comment) |
Thanks for this. I may not be trying hard to find how,but is there a way to customize the background color of the avatar instead of hacking it around? |
Hi Corinagum, I'm using the master branch cdn and the avatar is not displaying. Is it displaying for you? Thanks |
@khmerforce they are working for me on this sample: https://microsoft.github.io/BotFramework-WebChat/04.b.display-user-bot-images-styling/ |
@corinagum Thank you for the reply but yes I get a warning message. I use <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script> Warning message: |
It sounds like you are using the old method for avatar initials. Please verify that your styleOptions object looks like the below:
and that you are adding the object to the renderWebChat function in your If you are still having this issue, please try a hard refresh on the browser. |
@corinagum, If a developer does not wants to use an Avatar Image or Initial with new Web Chat 4 then the message boxes/bubbles look just blunt with no call out. Which was there in v3 and looked great even without avatar icon. I would suggest we should allow something like this in v4, so in case we don't want to show Avatar Icon or Initial then there could be a style option to enable call out like Message Bubble. |
Hi @mutanttech, please see #1658 :) You can track the issue there and add input if you'd like. |
Design considerations
background-image
for avatar image, and downscale/center benefit frombackground-size: cover
aria-hidden
elementChangelog
Added
styleOptions.botAvatarImage
andstyleOptions.userAvatarImage
, in PR #1486Changed
botAvatarImage
anduserAvatarImage
tostyleOptions.botAvatarImage
andstyleOptions.userAvatarImage
respectively, in PR #1486Removed
botAvatarImage
anduserAvatarImage
props, as they are moved insidestyleOptions
, in PR #1486Samples
How to use