agg23 / Sila

MIT License
14 stars 6 forks source link

Add main window resizing support #13

Open n8chur opened 8 months ago

n8chur commented 8 months ago

Motivation

When I first opened Sila I attempted to resize the height of the main window to display more content but was unable to since the window currently has a fixed size.

Changes

Video https://github.com/agg23/Sila/assets/671271/33c7b62e-bbf0-4334-bde8-9901ce7f5005
agg23 commented 8 months ago

Thanks for the contribution. I purposefully locked the size of the main window, as I didn't like how the grid elements looked during resize. From your video it looks like .adaptive helped, though I'm still not sure that this is the right change to make.

n8chur commented 8 months ago

OK, no worries—feel free to close this out if you're not enthusiastic about the change! Happy to iterate on it if you have suggestions for improvements.

Thanks for your consideration.

agg23 commented 8 months ago

I don’t mean to demean your contribution. I’m willing to entertain opinions. I didn’t think there was much use in allowing resizing since it looked bad, will worsen perf (which is already poor on visionOS in general), and I’m not really sure why a person would want to see more.

n8chur commented 8 months ago

No offense taken!

Do you mean that it looks bad during the window resizing, or after the window has been resized to certain sizes? Would it help if the transition of size and position of items during resize was animated?

What's the performance issue? Is it the potential impact of scrolling a grid with adaptive items, or the performance during resizing, or something else?

n8chur commented 8 months ago

On top of personal preference for more vertical space when vertically scrolling content, not being able to resize a window for this type of content (e.g. a grid/list of items) feels slightly out of place on this platform IMO. Most native Apple apps with similar content allow resizing the window to different aspect ratios and sizes.

I think it makes sense to restrict the aspect ratio/size for windows that exclusively present one piece of media such that it fits the content (like the video stream), but since the content browsing window is separate if seems like a good fit for being resizable to me.

Totally fine deferring to your preference here of course! I don't mean to push this suggestion on you.

agg23 commented 8 months ago

Do you mean that it looks bad during the window resizing, or after the window has been resized to certain sizes? Would it help if the transition of size and position of items during resize was animated?

I don't like how the grid elements change in size and proportion. We could lock the aspect ratio, but that will only help so much, and it will decrease the amount of space you gain by resizing the window.

Additionally, I don't like the effect the elements changing display. They squish or grow and it looks like some kind of weird bounce animation, where they will spring back to original positions, but they don't. This may be largely alleviated by a locked AR, I'm not sure.

I notice that the Apple TV app locks AR on the window, locking the element AR as well, which maybe is the solution here (though it sounds like you don't like that).

What's the performance issue? Is it the potential impact of scrolling a grid with adaptive items, or the performance during resizing, or something else?

There's two issues.

  1. visionOS handles scrolling via pinch extremely poorly. In every app with scrolling (including Apple apps), I have observed stuttering while scrolling when using pinch. Strangely this does not seem to occur when using a trackpad. It's not the pinch gesture itself stuttering, as you can throw the ScrollView and still have the stutters.
  2. For some reason Vision does not like the tiled image display. Something about my rendering or fetching of images seems to be heavy, and even though I'm using Nuke to manage that and recycle old images, if you load enough images across multiple pages (Popular and Categories), switching between the pages can be slow, with a bit of a stutter when starting to scroll.

For all these reasons, I considered it not worth my time to investigate when I really just wanted to ship. I still don't think that it's very beneficial to display more stream buttons on screen at once, as it quickly becomes visually overwhelming.

n8chur commented 8 months ago

locking the element AR as well, which maybe is the solution here (though it sounds like you don't like that).

I think locking the aspect ratio of the elements within the grid makes sense! Happy to iterate on that if you change your mind.

I considered it not worth my time to investigate when I really just wanted to ship. I still don't think that it's very beneficial to display more stream buttons on screen at once, as it quickly becomes visually overwhelming.

No worries—feel free to close this out if you'd prefer not to explore this further.

Thanks again for your consideration!

agg23 commented 8 months ago

I did some experiments. I think I'm mostly OK with what you've done here; I would just like to avoid the information overload state that you can easily get into (with many columns visible simultaneously):

image

In this scenario, ideally the grid items would expand to fill the same 4 columns. I'm not sure if this is possible though.


I also discovered the obvious (in retrospect) that locking aspect ratio doesn't work unless you make your text size also adaptive, as otherwise the ratio of the button taken up by the text changes as the button resizes.