GeopJr / Tuba

Browse the Fediverse
https://tuba.geopjr.dev/
GNU General Public License v3.0
573 stars 61 forks source link

[Request]: Simplify window resizing #1053

Open bragefuglseth opened 4 months ago

bragefuglseth commented 4 months ago

Describe the request

The window currently goes through a lot of different "states" when being resized, with an animation applied when posts are extended/contracted:

  1. Sidebar is visible, posts are cards, no top or bottom bar
  2. Sidebar is visible, posts are extended to the view edges, no top or bottom bar
  3. Sidebar is collpased, posts are cards, top bar
  4. Sidebar is collapsed, posts are extended to the view edges, top bar
  5. Sidebar is collapsed, posts are extended to the view edges, bottom bar

Some of these follow each other pretty closely, making resizing feel messy and laggy.

Here's a screencast showing all of the above:

Skjermopptak fra 2024-07-01 15-10-47.webm

Is it feasible to consolidate all these independent resizing breakpoints into a few higher-level non-animated ones? E.g.:

  1. Sidebar is visible, posts are cards, no top or bottom bar
  2. Sidebar is collapsed, posts are cards, top bar
  3. Sidebar is collpased, posts are extended to the view edges, bottom bar

Some notes on the expanding/contracting animation for posts: It looks cool, but I suspect it's one of the reasons the window lags so much when resizing. It was added while libadwaita itself was using resizing animations widely, but that isn't the case anymore due to technical and design related constraints. Based on this, I don't think dropping the animation now would "hurt" as much as it would have done 1-2 years ago.

All of this is loosely related to #228, but this doesn't require as much design work, and should be a generally lower-hanging fruit for now :slightly_smiling_face:

Implementation Details

GeopJr commented 4 months ago

Sorry I cannot take a deep look into it atm but for more info:

The transition is not entirely at fault here. It's just a little overhead on top of the elephant in the room, the ListBox. Too many items affected when resizing (animations, wrapping, labels with widgets, flexboxes etc etc etc). A recycler view (ListView with probably a lower default) would deal with that but #500 #504 #410 #179 and however many other issues and comments.

3 items, with nothing changes, has no lag. The animation has almost no impact at all

Screencast from 2024-07-01 17-26-31.webm

vs many items with the animation disabled. The animation being off, similarly, has no impact at all

Screencast from 2024-07-01 17-28-10.webm