pigallery2
pigallery2 copied to clipboard
Feature request: store filters in local storage
Is your feature request related to a problem? Please describe. I'd like for PiGallery to preserve the filters I previously set when I come back to the page. The particular reason here being to maintain a filter that drops photos with no date info, since they get sorted to the top (an unrelated issue). I can solve this by having the filters persisted in local storage.
Describe the solution you'd like Whenever filters are updated, persist those changes to local storage. When the page is loaded, pull that filter from local storage if present.
Describe alternatives you've considered
- User-level server side persistence of filters This is super heavy-handed and complex
- Use url-query parameters This isn't nuts, but it doesn't fully do what I want (come back to where I was when I navigate to http://mygallery), and it's more heavy-handed and represents a significantly larger change
I was thinking adding the 2nd alternative to the app. So when you share a folder it would possible to share the actual view that you are looking at.
Alternative 3 would be to use pg2conf
files: src/common/PG2ConfMap.ts
User creates a *.pgconf file in the directory. That file auto goes to the client side and the client can read it and do something based in that.
I'm not 100% I want this feature in the app, but I'm not super against it. I see that you started working on some implementation. Can you please put this behind some flag (config) and make it disabled by default.
I'm doing something similar with sorting, if you want some pointers: https://github.com/bpatrik/pigallery2/blob/fc75be1b25f012b721c44238cac38d5f253cd2ac/src/frontend/app/ui/gallery/navigator/sorting.service.ts#L60-L67 There is GalleryCacheService that interacts with local storage.
I'm not 100% I want this feature in the app, but I'm not super against it. I see that you started working on some implementation. Can you please put this behind some flag (config) and make it disabled by default.
Yeah, if/when I actually get to any behavior changes I'll config-flag it.
I'm doing something similar with sorting, if you want some pointers: https://github.com/bpatrik/pigallery2/blob/fc75be1b25f012b721c44238cac38d5f253cd2ac/src/frontend/app/ui/gallery/navigator/sorting.service.ts#L60-L67
Yes, behaviorally this is essentially what I was imagining for filters.
There is one more thing that worth considering when implementing this feature. I plan to add the following features sometime in the future:
- filter photos on the server side (like hide some photos for certain users) This would also unblock sharing search results
- Auto hide photos on the UI. I want to merge raw and edited photos to one directory and auto hide (in the client side filter tab) raw photos. It would be basically a special filter that would be on by default.