rr- / szurubooru

Image board engine, Danbooru-style.
GNU General Public License v3.0
665 stars 175 forks source link

Address comments from PR #403 Improve pool navigation/browsing #650

Open dekarrin opened 2 months ago

dekarrin commented 2 months ago

This takes the commits introduced in PR #403, which appears to be abandoned by the contributor, and applies the suggestions in that PR and updates the code to fix merge conflicts and broken tests that occurred as a result of master branch diverging from the PR. It includes the original changes from that PR. In addition, I re-arranged the Dockerfile for server to make caching a little easier (mostly, doing package installs prior to any COPYs to stop 0.5GB images from being generated on every code change), and to add a default BUILDPLATFORM build arg so that it does not need to be explicitly passed via buildargs. Those additions can be pulled out and discussed separately (or wholesale rejected) but I figured I'd keep them in this PR and see if they would be helpful to others.

In addition, this includes the following changes, copied verbatim from PR #403:

Related to #380.

  1. Implements sort:pool for post searches, which will sort the results by the order defined by the pool: named token in the same search query.

  2. Modifies the previous/next post order for the post view if a pool: named token is in the current query.

  3. Adds a grid-based view for the pools list page, showing up to the first three posts in each pool. 1

  4. Implements pool navigators. They allow navigating to the first/last/next/previous post in each pool the post belongs to. The current pool active in the search query will get bolded/placed at the top. 2

po5 commented 2 months ago

My fork includes a bunch of styling fixes for pool thumbnails, a bugfix for pool navigation, and a performance optimization for nearby posts serialization.
Filter for commit messages containing pool.

dekarrin commented 2 months ago

Oh, nice! @po5 does that render the changes in this branch redundant? I can close this PR if that's the case, no need to pollute an already dense PR list.

po5 commented 2 months ago

I haven't submitted my pool-related changes yet so feel free to cherry pick.