Skip to content

Pool navigation & listing improvements - #732

Draft
po5 wants to merge 45 commits into
rr-:masterfrom
po5:pool-rework
Draft

Pool navigation & listing improvements#732
po5 wants to merge 45 commits into
rr-:masterfrom
po5:pool-rework

Conversation

@po5

@po5 po5 commented Apr 1, 2025

Copy link
Copy Markdown
Collaborator

Building upon #537 with some aspects from #403.
Has been in use for about two years on a mid-sized public instance.

szurupools

image

Notable changes new to this PR:

  • Polished stacked thumbnail display for pool list, with hover/focus animation
  • Allows negating sort:pool
  • Uses the correct pool when overriding navigation
  • Fixed issue where nearby pool posts would take a very long time to resolve
  • No longer makes an extra request to get surrounding pool posts

TODO list:

  • Custom thumbnail functionality for pools (allow setting a post ID to be used as a singular thumbnail)
  • UI for adding, removing, and rearranging posts from a pool
  • Search by pool name instead of ID
  • Fancy display name for pools (may be specific to my use case, but I want separate display names from search tokens)
  • Investigate if the query can be made more efficient

Notes:
Post navigation override seems redundant, we can just have sort:pool in the pool navigator's search links? Should lead to the same sorting.

noirscape and others added 30 commits April 1, 2025 08:04
this implementation was *heavily* cherry-picked from PR rr-#403.
We were always using the first pool the current post belongs to.
po5 added 3 commits April 1, 2025 08:25
This was very slow when any entry was unavailable, such as on
single-post pools, or edges of pools (first/last post).
Also only fetch id. Previously it would get the thumbnail url.
@po5
po5 force-pushed the pool-rework branch 3 times, most recently from a0174fc to 382239f Compare April 2, 2025 23:43
@po5
po5 force-pushed the pool-rework branch 3 times, most recently from 5c7b266 to 64c3a6e Compare April 3, 2025 00:25
@G1org1owo

Copy link
Copy Markdown
Contributor

Tried this in the hope it'd also fix the pool page loading pretty damn slow (and I still have no clue why) and got this when trying to change the pool category of an empty pool:
image
Which causes the "Save changes" button to hang until the page is reloaded.

@po5

po5 commented Jul 17, 2025

Copy link
Copy Markdown
Collaborator Author

Good catch. I'll account for this in a later commit, for now reverting ff788a5 should fix it. But that is the commit that improves pool listing loading performance, lol.

@G1org1owo

G1org1owo commented Jul 17, 2025

Copy link
Copy Markdown
Contributor

Damn, what a world we live in lol

Another one I found when trying to update the content of a post:
image

By having a quick look at occurences for hasPostId in the repo it doesn't seem like anything has changed, no clue about this
Nevermind, I just realized that the error above most likely doesn't mean that posts doesn't have a function hasPostId anymore for some reason, but that posts is now a different kind of object (microposts?), which would mean the above commit is likely the cause for this aswell.

@G1org1owo

Copy link
Copy Markdown
Contributor

Can confirm reverting ff788a5 fixes both issues.

@enzof2003

Copy link
Copy Markdown

I know I'm technically necroposting, but the issue of Uncaught TypeError: t.detail.pool.posts.clear is not a function can be fixed with a rather simple band-aid solution without reverting #ff788a5

In client/js/models/pool.js
get posts() { return this._postsMicro || this._posts; }
Can be replaced by
get posts() { return this._posts; }

Which allow the code to find the correct functions, this is purely a quick fix that I haven't had time to thoroughly test so please be incredibly careful if setting this up on a large production instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants