-
Notifications
You must be signed in to change notification settings - Fork 12
feat: message images #12
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
Conversation
|
Thanks very much for the pr! Rose already had some code which just came out last night (as it was just testing only for now) for an image gallery and seemed to have a clear idea of what that should look like. @roobscoob could you review/leave a note if you think we should merge this 🙂 |
|
Worth noting: currently rendering for the message is done with the But maybe it might make even more sense if instead of the backend deciding what message to render, we actually had an interim shape that was like Still worth discussion with @roobscoob |
|
My take here is that images should be a part of "Content", as should any further message-body related data (including reactions, embeds, further.) #11 Supports message grouping via (effectively) a Not to mention I think a "Content" is more abstract for non-discord platforms, while not losing any functionality on discord itself. @alii a little curious about this:
Why do you think it would make more sense? It's not intuitive for me but I'm curious what you have in mind |
Because then message UI would be consistent between backends, and instead of passing Elements we just pass an Scope-specific struct. Each backend just basically needs to implement a translation layer but the rendering is always done the same. Can discuss further in Scope discord |
roobscoob
left a comment
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.
Discussed in discord, just formalizing here. Ideally chat::Message does not have a get_images(..) and instead Images become a part of DiscordMessageContent (maybe images: DiscordImageContent? to keep your struct?)
| .p_2() | ||
| .child(img(message.get_author().get_icon()).object_fit(gpui::ObjectFit::Fill).bg(rgb(0xFFFFFF)).rounded_full().w_12().h_12()) | ||
| .child(div().flex().flex_col().child(message.get_author().get_display_name()).child(message.get_content())) | ||
| .child(div().flex().flex_col().child(message.get_author().get_display_name()).child(message.get_content()).child(message.get_images())) |
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.
one other thing: this will conflict now that #11 is merged. Changing content should fix this though.
|
I'm closing this for now. I'll create a new PR when I have time to reimplement it (or someone else can do it). |
Image support. Other attachments are filtered out for now.

Sending is also not implemented.