Skip to content

feat: message images #152

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Conversation

codegod100
Copy link
Contributor

@codegod100 codegod100 commented Apr 8, 2025

added message image functionality back in

@codegod100 codegod100 marked this pull request as draft April 8, 2025 22:06
@codegod100 codegod100 force-pushed the message-images branch 4 times, most recently from 1cca237 to 78aa4f7 Compare April 9, 2025 01:28
@codegod100 codegod100 marked this pull request as ready for review April 9, 2025 01:29
@codegod100
Copy link
Contributor Author

codegod100 commented Apr 9, 2025

there is some debug stuff in here was trying to troubleshoot some message issues

@zicklag
Copy link
Contributor

zicklag commented Apr 10, 2025

Still catching up on stuff, will try to get to this soon.

@codegod100 codegod100 marked this pull request as draft April 12, 2025 04:44
@codegod100
Copy link
Contributor Author

changing to draft, gonna refactor this to do one thing. too much stuff in here.

@codegod100
Copy link
Contributor Author

updated

@codegod100 codegod100 marked this pull request as ready for review April 12, 2025 07:13
@michaelwschultz michaelwschultz self-requested a review April 15, 2025 07:29
@michaelwschultz michaelwschultz moved this to Todo in Roomy Apr 15, 2025
@michaelwschultz michaelwschultz moved this from Todo to In Progress in Roomy Apr 15, 2025
@codegod100
Copy link
Contributor Author

updated to remove conflict

@michaelwschultz
Copy link
Collaborator

Going to take a look at this in a bit.

Copy link
Collaborator

@michaelwschultz michaelwschultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Radical! This is a great addition. Having a little more polish on the image that's added to your input would be great. We could also follow this up with another PR to do that. Thanks so much. You really are a @codegod100.

@codegod100
Copy link
Contributor Author

thanks for feedback, i'll work on suggestions

@michaelwschultz michaelwschultz changed the title message images feat: message images Apr 17, 2025
@michaelwschultz michaelwschultz moved this from In Progress to In Review in Roomy Apr 17, 2025
@codegod100 codegod100 force-pushed the message-images branch 2 times, most recently from e5cb56f to 3938a72 Compare April 17, 2025 22:31
@codegod100
Copy link
Contributor Author

fixed issues and added drag-and-drop

@michaelwschultz
Copy link
Collaborator

You're wild. I'll take a look tomorrow evening.

@codegod100
Copy link
Contributor Author

hold off on review i need to make sure this doesn't conflict with main now that other pr merged

@codegod100
Copy link
Contributor Author

ok issues resolved

Copy link
Collaborator

@michaelwschultz michaelwschultz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome addition @codegod100. I think this looks really good and behaves much nicer now. There are a few ideas I have for enhancements down the line that I'll turn into an issue if you want to take a look later on.

let isDragOver = $state(false);

// Consolidated image file processing logic
async function processImageFile(file: File, input?: HTMLInputElement) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't help but wonder if we should call processImageFile after the user submits the message and just show the image in the browser beforehand. I guess I'm worried about uploading a bunch of images and storing them that are never attached to a message. Probably fine for now but perhaps worth a comment to clean up "dangling images" later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm worried about uploading a bunch of images and storing them that are never attached to a message

I'm having some difficulty parsing this statement. do you mean, someone uploads an image and then in message input field they backspace and delete the image from the message?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly. So they never actually post it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could render the image in the browser, locally, without uploading it, until they submit the message is what I was trying to say.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the upside is if they do that, the image doesn't go anywhere except into their own pds. we don't store the images in our crdt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally happy with this being a refactor later, or something we deal with in some other way. We could even have a cron that takes care of cleaning things up from time to time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they upload an image and don't use it I don't see why we need to clean it up? if they really care that much can't they use something like https://pdsls.dev? Having a task on our end that manages their pds seems a little out of scope

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could render the image in the browser, locally, without uploading it, until they submit the message is what I was trying to say.

i understand now, i can refactor this for sure

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they upload an image and don't use it I don't see why we need to clean it up? if they really care that much can't they use something like https://pdsls.dev? Having a task on our end that manages their pds seems a little out of scope

Ah! I didn't realize we weren't storing it. Then great! No need for the clean up. Especially since we shouldn't just be randomly removing things from people's PDSs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were gonna store in CRDT but many reasons to use pds instead. Top two were csam moderation and CDN

@codegod100
Copy link
Contributor Author

ok refactored to only upload image after submit

@codegod100
Copy link
Contributor Author

resolved merge conflicts, fixed regression

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the lock file was deleted. deno install again, but it might have some significant changes. Might need to revert this commit instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants