-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat: add image attachment support to chat #2149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Can we make like a regular chat attachment to upload and load seamlessly? 🙇🏼 We don't want to show attachment name, load button etc Also is it possible to send text along with attachments? |
So we don't recommend attachments get autoloaded by default, since it presents somewhat of a security risk. What do you think of adding the ability to automatically load attachments for "Following" conversations that are under a certain size, maybe 100MB?
Not yet, but we can add this soon. |
yea good idea to add only for following users and we can button in requested profiles Also we can explain something like this for users like twitter does instead just showing load button |
Cool, I'll get goin on that. |
Amazing you are great @nakajima 💪👏 |
…ollowing Also introduce caching
Ok, just pushed 528db21. This makes it so that we auto load attachments for convos where you're following the other profile (unless the attachment is greater than 100mb). I also introduced a new cache using indexed db to prevent loading the same attachments multiple times, since it can be a bit expensive. Some screenshots:
|
Co-authored-by: Strek <ssharishkumar@gmail.com>
…lenster into add-attachment-support
@nakajima Loader state will cause CLS, can we keep the same width as warn state for loading card 🙇🏼 ? |
…lenster into add-attachment-support
@nakajima It would be great if you fix the conflicts, I'll merge after that 🚀 🙇🏼 |
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.
…-attachment-support
…-attachment-support
Head branch was pushed to by a user without write access
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 🚨 Potential security issues found in this pull request. To accept the risk, merge this PR and you will not be notified again. Bot CommandsTo ignore an alert, reply with a comment starting with
📜 Install scriptsInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.
🫣 Native codeContains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs. Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings.
Pull request alert summary
📊 Modified Dependency Overview:
|
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.
@nakajima Please fix the conflicts and @
me I'll merge this ASAP 🙇
PS: we migrated to pnpm from yarn
Gonna close this for now! We need to fix the speed issue first, later we can ship more features 🙇🏼 RN it takes 40s to load my inbox 😢 |
@nakajima It would be great if you resolve the conflicts 🙇🏼 |
Closing this and continued here #2845 |
This PR adds support for sending E2E encrypted images in messages.
It uses the newly introduced
Attachment
andRemoteAttachment
content types which you can read more about here: https://xmtp.org/blog/attachments-and-remote-attachments.Screen.Recording.2023-03-22.at.3.56.04.PM.mov
I had to change some of the hardcoded height values that were in the messages area before to accommodate the composer growing when you're about to send an image. I also added a slight background color to the composer because it looked confusing to have a bunch of white space when you had an attachment preview in there. Feel free to change any of that if it doesn't work for you.
Type of change
How should this be tested?
You should be able to add an image by clicking the photo button in the chat view.