theopenconversationkit / tock

Tock, the open source conversational AI toolkit.
https://doc.tock.ai
Apache License 2.0
475 stars 127 forks source link

[Web] Allow sending an image's width and height #1380

Open Fabilin opened 2 years ago

Fabilin commented 2 years ago

Large images currently cause resizing issues in tock-react-kit once they fully load (most apparent being the scrollbar jumping up). Specifying the width and height when sending an image from the server would ensure the corresponding img tags get the right size from the start.

francoisno commented 2 years ago

Hello @Fabilin good idea. As long as it remains optional of course.

How would you implement this:

francoisno commented 2 years ago

cc @pi-2r @correi-f @elebescond

Fabilin commented 2 years ago

I had not considered setting the dimensions through CSS, it is true that this would allow for a lot more flexibility, and possibly responsiveness as well.

On the other hand, here are the benefits I can think of from specifying size for the HTML attributes :

For these reasons I would still recommend setting the HTML width and height, be it only for simplicity's sake.

I believe image size should be (optionally) specified for each image sent by the bot's backend; tock-react-kit already has options to set CSS overrides for all images displayed in the conversation.