Responsive Shelves

TalkNew features

Join LibraryThing to post.

Responsive Shelves

1knerd.knitter
Apr 23, 8:36 am

We've rolled out a new book shelf component across several pages on LibraryThing — starting with tagmash and a few other discovery pages. It's a ground-up rewrite of the shelf code that's been running (mostly unchanged) for over a decade, and we think it's a meaningful improvement.


The old shelves calculated how many books to fit by doing math against a hardcoded pixel budget at render time. This worked reasonably well on the screen sizes of 2010, but on phones, wide monitors, or anything in between, it often got the math wrong — covers would get cut off on the right side, or you'd get awkward gaps where another book almost fit. The new shelves use CSS grid and let the browser handle layout, so books always fill the available space correctly at any width.


Here's what's new or improved:



  • Responsive layout — the grid reflows correctly on phones, tablets, wide monitors, and everything in between. No more cut-off covers on the right edge.

  • Drag to resize
    NEW! You can now control how many rows you see ANY place we use these new shelf views.
    Just grab the handle at the bottom-right corner and drag to show more (or fewer) rows.
    Your preference is saved so it sticks across visits. On home page modules,
    dragging saves directly to that module's settings — the same as if you'd gone into the
    module preferences and changed the row count there.

  • Smart Pagination — prev/next controls let you page through long result sets even if you change the size of the view and the number of items on screen changes.

  • Filter bar — many pages like tagmash now have a cleaner filter bar with Publication date and Media type dropdowns, replacing the old pillbox UI that didn't adapt well on small screens.

  • "Have it" checkmarks — the green checkmarks showing which books are in your library are still there, now with slightly cleaner rendering.


If you spot anything odd let us know here.


(The work for this feature was done by @conceptDawg)

2SandraArdnas
Apr 23, 9:00 am

Oh, the glory, the Recently Added homepage module no longer has random gaps between covers. It bugged my like a pebble in my shoe, haha. Played around with resizing, works great. Thank you

3bnielsen
Apr 23, 9:03 am

Really nice. Thank you! I'll second >2 SandraArdnas:

4keristars
Apr 23, 9:08 am

Neat! I liked the way the "recently added" module on the home page did a slight overlap of covers, then realized it's because the size setting is adjusting the amount of space around the covers. Unexpected side effects on mobile, maybe?

I've attached screencaps of Tiny, Medium, and XXL settings.

i like the new system in that module!

5SandraArdnas
Apr 23, 9:18 am

BTW, is there a reason why Cover/List buttons on tag pages are a dropdown, rather than next to each other as in Recently Added? It makes it clearer there's two options and faster to change.

6rarm
Edited: Apr 23, 9:44 am

I like this but on my homepage in "Recent Automatic Recommendations" and "Recent Automatic Recommendations" (and other similiar modules) it overrides my "Number of books to show in titles mode" setting (which is set to 10) to show 50 titles when I select list.

7conceptDawg
Edited: Apr 23, 10:27 am

>5 SandraArdnas: The big reason is to save space. It works better on all page sizes and browser sizes, and it keeps it consistent. And most people are not switching back and forth very often. They leave it on onw view style.

8conceptDawg
Apr 23, 10:27 am

>6 rarm: ah, that's probably just a bug. We'll get that fixed.

9conceptDawg
Apr 23, 11:01 am

>4 keristars: that's actually a bug. It should be in a clean grid. It's likely just because that browser that you're using doesn't read part of our CSS styling, I suspect nested CSS. Can you tell me what browser you're using?

10conceptDawg
Apr 23, 12:56 pm

>4 keristars: you should be seeing a clean grid now, or at least in the next few minutes.
>6 rarm: the list settings should now be respected. Your lists should be showing the correct number of items, and pagination should work too.

11norabelle414
Apr 23, 1:34 pm

Can you roll this out to my physical shelves of paper books, please? :-)

12anglemark
Apr 23, 1:38 pm

It's full of span tag translation problems, looks very ugly.

13knerd.knitter
Apr 23, 1:44 pm

14knerd.knitter
Apr 23, 2:02 pm

15SandraArdnas
Apr 23, 2:26 pm

>7 conceptDawg: I don't think us veterans care, we generally prefer one or the other and stick to it. I asked because this way it's not obvious to those new/newish there's a choice. You need to notice the arrow and check it out to realize you can view it s a list if you prefer.

16kleh
Edited: Apr 23, 2:29 pm

I came here to complain I could no longer "show all" of a series, but discovered the super "Drag to resize" option which replaces it.
This is great, but not self-evident on first viewing.

17kleh
Edited: Apr 23, 2:29 pm

This message has been deleted by its author.

18keristars
Edited: Apr 23, 2:39 pm

>9 conceptDawg: I'm using Vivaldi for Android, I think 1 version out of date.*

I *like* the overlap, I think it's cute skumorphism! (and still showing overlapped when i refresh the homepage)

* waiting to update on my phone until the version on my tablet gets some features back that i use heavily

19conceptDawg
Apr 23, 5:18 pm

>16 kleh: but you did discover it. Which underscores the ability to discover it. 😊

20conceptDawg
Apr 23, 5:19 pm

>12 anglemark: fixing those

21ianreads
Apr 23, 5:32 pm

>18 keristars: I had the same (initial) reaction! It was giving infinite book stack vibes. And a little reminiscent of Apple's cover flow.

22kleh
Apr 24, 2:22 am

>19 conceptDawg: And I see we now have "Show All" back. Perfect!

23tallpaul
Apr 24, 1:56 pm

>9 conceptDawg: I am also seeing this in Waterfox 1.2.2, AS: 149.0, OS: Android 15 (rebranded Firefox stable, more or less). But only on recently added, not recommendations

24conceptDawg
May 8, 5:08 pm

>23 tallpaul: Thanks. I'll check on that. Likely that browser also not using more modern CSS layout standards. Not a bug, per se, but I can fall back to not using those rules without too much trouble.

25tallpaul
May 12, 4:50 pm

>24 conceptDawg: Looks good now