stream-chat-react icon indicating copy to clipboard operation
stream-chat-react copied to clipboard

Parity between Flutter and Web custom attachments

Open AustralianSpy opened this issue 2 years ago • 7 comments

Please select which package this feature is related to

stream_chat

Which platforms would this feature impact?

Web

Is your feature request related to a problem?

The custom attachment functionality on web is not parallel with Flutter, which is causing a lot of pain for a multi-platform application.

Describe the solution that you'd like

It would be nice if more props were exposed, as in Flutter, to customize the behavior of attachments on web. In particular, trying to accommodate an attachment preview caused further issues down the line when trying to send the message, and there is no ideal way to store a custom attachment in state (so it can be altered or cleared) before it is sent.

Describe alternatives that you have considered

Custom attachments require quite a bit of back-dooring on web: an extra context provider to maintain awareness of a custom attachment being to be consumed by multiple components, abuse of Cards as a catch-all for custom attachment types, and abuse of the imageUploads functionality to allow for thumbnail previews of the attachment. While cumbersome, most of this did indeed work, but the solution began to fall apart when trying to add attachment previews as it altered the data being sent.

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

AustralianSpy avatar May 16 '23 18:05 AustralianSpy

Hey @AustralianSpy, can you share a small reproducible project where we can verify the issue and test the changes directly?

xsahil03x avatar May 16 '23 18:05 xsahil03x

@xsahil03x The project in question is incredibly large, so I've broken out the components I've altered so you can get a better sense of what I've attempted. https://github.com/AustralianSpy/stream-web-customization-example

AustralianSpy avatar May 16 '23 19:05 AustralianSpy

Hey @AustralianSpy, I think this should be an issue for StreamChatReact instead. Let me know so I can transfer this to that repo.

xsahil03x avatar May 16 '23 20:05 xsahil03x

@xsahil03x Whoops, you're absolutely right, please do!

AustralianSpy avatar May 17 '23 00:05 AustralianSpy

cc: @MartinCupela

xsahil03x avatar May 17 '23 08:05 xsahil03x

@AustralianSpy thank you for bringing this up. We will let our product team to take a look into how this request fits in our future plans.

MartinCupela avatar May 17 '23 15:05 MartinCupela

@MartinCupela Thank you!

AustralianSpy avatar May 18 '23 14:05 AustralianSpy

Possibility add custom attachments has been added with [email protected].

MartinCupela avatar May 27 '24 15:05 MartinCupela