siskin-im icon indicating copy to clipboard operation
siskin-im copied to clipboard

Fix: Clipped chat attachment previews.

Open levitatingpineapple opened this issue 2 years ago • 3 comments

Motivation

When sending images and video the previews are getting clipped, and some of the content is not visible. This is mostly apparent on larger devices like an iPad or M1 Mac:

Approach

Adjust constraints so that the size of the preview would be determined by the intrinsicContentSize instead. This way we can leverage the logic Apple already has in place for determining the preview's dimensions. The cat is now visible 🐈

Testing

• Looked at few other message types and everything looked normal. Let me know, if there is something specific tis could break.

levitatingpineapple avatar May 20 '22 18:05 levitatingpineapple

Those constraints were added for small form factor devices, ie. iPhone, and small iPad, as with very high images it was hard to scroll them. Maybe with time, Apple changed its implementation and it is now scaled in a different way.

I would not consider the issue with size on M1 macs as important as we have BeagleIM for macOS, which is in my opinion a better XMPP client for macOS than running SiskinIM on macOS.

hantu85 avatar May 20 '22 18:05 hantu85

Those constraints were added for small form factor devices, ie. iPhone, and small iPad, as with very high images it was hard to scroll them. Maybe with time, Apple changed its implementation and it is now scaled in a different way.

I would not consider the issue with size on M1 macs as important as we have BeagleIM for macOS, which is in my opinion a better XMPP client for macOS than running SiskinIM on macOS.

That's understandable. Currently the maximum height is 600pt from the system. How about keeping the height constraint, but not stretching the previews to the trailing edge? This way the small devices would keep reasonably sized previews, while still being able to see the preview on a larger device.

levitatingpineapple avatar May 20 '22 19:05 levitatingpineapple

I will need to think about it for a while and make a few experiments on my own to check the results. Alternatively, we may consider checking the preview image ratio and act on that. Give me some time to check that.

hantu85 avatar May 20 '22 19:05 hantu85