backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

Image Library view: Better number of items per page #4375

Open ghost opened 4 years ago

ghost commented 4 years ago

In the Image Library view, 20 thumbnail images are shown by default. These are displayed in a responsive grid, so the number of columns depends on the user's screen/window size.

For example, here's what it looks like on my screen: image It looks weird that the bottom row isn't filled...

Now I know this is because we need to specify a set number of images, and so the last row will be often only partially filled (depending on the number of columns). However I believe we can optimise the number of images displayed to have the least amount of empty last rows as possible.

I made a spreadsheet to calculate the number of columns a given number of images would fill completely for different widths. Here're the results: image

The numbers down the left side are the number of images in the view (e.g. the pager setting). The numbers across the top are columns (different screen sizes would have different columns). The check marks show which number of images would completely fill which columns (e.g. 10 is divisible by 2, 5 & 10). The numbers down the right are simply a count of the check marks for each row.

The current number of images (20) is highlighted yellow. There are 4 column widths where the bottom row is completely filled.

I've highlighted the 24 images in green as I believe that might be a better number to use. It has 6 columns that are filled (which means less columns that aren't). Obviously there's no perfect answer (unless we're able to make a paging system that dynamically moves images to the next page that don't fit in the current screen width), but using 24 images in the Image Library will look less weird than 20.

ghost commented 4 years ago

PR: https://github.com/backdrop/backdrop/pull/3123

laryn commented 4 years ago

Do we also need an update hook to make all default provided views consistent?

Also suggested elsewhere that if we ever get exposed filters working in this view, it might be good to make this customizable: https://github.com/backdrop/backdrop-issues/issues/3293#issuecomment-477205687

jenlampton commented 4 years ago

Do we also need an update hook to make all default provided views consistent?

That's a good idea. But we should check to see if the current view has (ever) been modified, and if so leave it as-is. Only config default views should be updated.

Code review: currently looks great, but we should include that update hook.

klonos commented 4 years ago

This is a small change and also really close to finish. Just needs that update hook.

ghost commented 3 years ago

I'd personally be more interested in something like this instead: https://github.com/backdrop/backdrop-issues/issues/4560#issuecomment-725975563

indigoxela commented 2 years ago

Seems like this PR is in state "needs work" since 2020, but the initial PR provider lost interest. So, there's currently nobody actively working on it - is that correct? Time to remove the milestone.

ghost commented 2 years ago

I previously added a branch to the core repo with my PR changes, which was naughty. So I've deleted it. Need to start again with a branch in my personal fork (or someone else can take over).