-
Notifications
You must be signed in to change notification settings - Fork 23
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
update(FilePreview): Open image preview in high quality #1698
update(FilePreview): Open image preview in high quality #1698
Conversation
…and delete them when program starts
… profile and banner has been saved on temp_files now
… after close crop element
…on-when-viewing-image-in-chat' into 1692-taskchat-show-full-resolution-when-viewing-image-in-chat
UI Automated Test Results Summary for MacOS/Windows484 tests 432 ✅ 2h 19m 4s ⏱️ Results for commit 482a31c. ♻️ This comment has been updated with latest results. |
UI Automated Tests execution is complete! You can find the test results report here |
While testing I ran into something weird on Windows When I try to open the preview, it wont show the image. This doesnt seem to happen with all images though. Like in the screen recording from my PC you can see I am able to open some that were sent to me earlier in chat. Sometimes if I go up and preview those old images and come back to the new ones they will all the sudden appear fine. I replicated this on my PC and on my Windows VM as well. Although on the VM no matter how many times I tried, the image would never preview Windows PC: 20240111-0019-20.3637802.mp4Windows VM: Screen.Recording.2024-01-10.at.7.48.12.PM.mov |
…on-when-viewing-image-in-chat' into 1692-taskchat-show-full-resolution-when-viewing-image-in-chat
cx.use_hook(|| { | ||
cx.spawn(async move { | ||
// This will be run once the component is mounted | ||
std::future::ready::<()>(()).await; |
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.
Just curious, does the task need to yield first before calling create
?
src: format_args!("{}", if temp_dir.exists() | ||
{ temp_file_path_as_string} | ||
else {large_thumbnail} ), |
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.
You may be able to avoid using format_args
(or format
) if both variables are strings.
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.
Good point, I will fix it.
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.
Gravacao.do.ecra.2024-01-16.as.19.25.14.mov
you can fast forward the video to the end 😂
its always reproducible on this branch i couldn't reproduce on dev
macOS, m1
let me know if you need the image
cx.spawn(async move { | ||
// This will be run once the component is mounted | ||
std::future::ready::<()>(()).await; | ||
create(); |
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.
Something ive overlooked here is that youre calling this in a async task. While im not sure what the context behind it might be for every use case, if blocking functions are called, it might be best to spawn a blocking task here so it does not block the executor by using tokio::task::spawn_blocking
Closing this PR. Preview Video Files is already doing what this PR does and even better. |
What this PR does 📖
1. If user click to preview an image from chat or storage, it will download that file, and load its path for user see it on maximum quality.
2. Those images have been downloaded in a temp_dir directory inside .uplink folder, and now cropped images from profile and banner as well.
3. Each time user see a preview of image, and closes modal, it will delete that image from local folder.
4. Each time uplink runs again, it will delete all temp_files dir.
Which issue(s) this PR fixes 🔨
Special notes for reviewers 🗒️
Additional comments 🎤