-
Notifications
You must be signed in to change notification settings - Fork 452
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
Improve previews for guests + GIF support #4472
Conversation
9a6f158
to
98ea8bf
Compare
|
98ea8bf
to
6cadf89
Compare
|
6cadf89
to
fc78669
Compare
src/components/MessagesList/MessagesGroup/Message/MessagePart/FilePreview.vue
Outdated
Show resolved
Hide resolved
|
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.
@skjnldsv the height will always be the same. For the width I added max-width: 100% so it doesn't become wider than the chat window. Not sure if we need more. Thanks for the approval, I'll squash. |
6156257
to
2d77bfd
Compare
Very nice @PVince81! :) Tiny enhancements which would make it look even better (but you decide whether to do it here or in a separate pull request):
|
@jancborchardt also see related discussion about renaming files before upload. If we remove the display name then renaming the files is maybe not needed any more: #3543 |
|
Instead of cropping the previews in the conversation to a square, they are now using a limited height but their width is computed based on aspect ratio. This is done by passing different arguments to the previews endpoint so it delivers a preview with the matching size. Adjusted styles around the preview to make it look better. Expanded image preview height to 384 as it looks better. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Use direct URL for small GIFS. Added preview support for guest mode. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Added app setting and capability "max-gif-size". Added new import for @nextcloud/capabilities. Signed-off-by: Vincent Petry <vincent@nextcloud.com> Co-authored-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Note: to test sidebar mode need to merge with #4291 and upload the files through the regular talk view.
|
Makes it possible to resize both previews and GIFs in a responsive manner, keeping the ratio and everything visible. Added border radius to make it look even nicer. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2d77bfd
to
7c26560
Compare
The issue was that sometimes the height is anyway the one we got from the preview, but sometimes when we render the real image like a GIF, we need max-height. With the latest commit the image resizing and keeping the ratio is solved, both in the sidebar and also regular chat view. @skjnldsv mind having another glance with your GIF collection and play with the resize ? |
@@ -4919,6 +4919,7 @@ | |||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", | |||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", | |||
"dev": true, | |||
"optional": true, |
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.
what was it with the optional again to not get it in and out again all the time?
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.
no idea, this got set automatically when installing the new package
I see this too sometimes on our instance, I guess this happens when generating the preview takes too long or errors on first attempt or something. But it's a server issue |
But the mime icon is really small now, no? |
Well the icon you see there is the placeholder icon in case of an error I think. because the mimetype icon of svg is the image icon. |
here's a fix for the icon height: #4537 |
and here the play button to make it clearer that it can be played: #4538 |
As this touched the same code, I've gathered them into a single PR.
Enhancements
Improve preview cropping
Chat previews now expanded with aspect ratio
Instead of cropping the previews in the conversation to a square, they are now using a limited height but their width is computed based on aspect ratio. This is done by passing different arguments to the previews endpoint so it delivers a preview with the matching size.
Also expanded image preview height to 384 as it looks better.
Fixes #3746
Render GIFs directly
Use direct URL to render GIFs (animated!) when they have a small size.
The maximum size is configurable with
occ config:app:set spreed max-gif-size --value=X
and exposed as the capabilityspreed.config.previews.max-gif-size
Fixes #1805
Add support for guest previews
Guest users can now directly see images in the chat, and small GIFs are animated as well!
Fixes #4471