Search: Add additional view type using pig.js #1089
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to create a new feature that was requested in #85. The ask of issue #85 was to use pig.js to create a feed that is a lot easier to scroll through all the images with better performance. The result turned out pretty nice. The page loads 1500+ images I have almost instantly and I can freely scroll to any position of the huge stack of pictures, then the page fluently lazy load the requested part of the page smoothly.
Check this demo to see how smooth it is.
https://drive.google.com/file/d/1Gku6aWRzShX4Ciz3xg68XHIvDCGv_Y8v/view?usp=sharing
Here's a few implementation highlights:
/photos
page in terms of 1. how it handles the filters/url params 2. all the actions on an opened imagediv
s as many as the number of batches then converts each div into apig.js
object so it can prevent a dom object from being humongous.onClick
due to the limitationpig.js
has. The library does not provide any other event handler options. You can still like and the rest of actions by opening the image by clicking on it.The page is accessible at
/instant
and I intentionally skipped adding the page in the menu to leave it on to the maintainers to decide how we want to utilize or even improve/develop this page in a long run.This is my first contribution to PhotoPrism and I fell in love with the project as I was trying and working on it. Great work, and big thanks to all the efforts on this fantastic project.