OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.26k stars 170 forks source link

Enhancement Request: Clicking an image should not automatically download #166

Closed tasdflkjweio closed 2 months ago

tasdflkjweio commented 2 months ago

(Last request!) When clicking on any file in the chat window, it is automatically downloaded. If an image is returned, I would suggest allowing the consumers of your library to choose what happens. Examples include:

  1. Choose to download the file using the browser defaults, or
  2. Choose to prompt the user to select a location, or
  3. If an image, open in a larger modal component?

Not sure what the implementation would be, but perhaps there's callback or an onImageClick event that provides details on the file type, file contents, the message role, and an option to change the default behavior?

OvidijusParsiunas commented 2 months ago

Hi @tasdflkjweio.

Unfortunately I don't think there is a way to programatically allow the user to choose the location where the file is going to be saved. All systems simply default to the "downloads" folder.

In regards to creating a modal component to open up the image, that is unfortunately too out of reach for our priorities. Couple of reasons for this include the problem with Deep Chat being encapsulated inside a shadow element meaning that controlling the positioning of external elements would be very difficult, not to mention the fact that all applications contain different styling properties which would make it much more complex. Another reason is time limitations, as we have many other features prioritised, hence getting to something like this would take quite a while.

For all the aforementioned reasons I will unfortunately not be able to proceed with the requests above. Nevertheless, you are more than welcome to fork/clone the GitHub repository and customize Deep Chat to your liking. It is actually pretty simple and you can see the setup instructions here. Thanks!