SmilyOrg / photofield

Experimental fast photo viewer.
MIT License
398 stars 7 forks source link

Refreshing the view can be way more complicated than it should be #81

Open SmilyOrg opened 8 months ago

SmilyOrg commented 8 months ago

Describe the bug There are various ways to refresh various "caches", e.g. rescanning, reindexing, refreshing the page, refreshing the layout, etc. It's been like this due to some implementation difficulties and for debugging, but it's just dumb.

To Reproduce Various caches fail in various ways.

Expected behavior Ideally the user should care exactly 0% about this, all of it is just a workaround for lacking implementation. However realistically, it's hard to get rid of all of the "refresh buttons" without a lot of effort, so here's a ranked list of which buttons should really not even exist and which ones are common enough to be acceptable for some more time.

  1. Refresh layout. Very dumb and should not exist. This should be handled by tracking all the dependencies and their staleness and automatically refreshing stale layouts. image

  2. Reindexing metadata/colors/etc. Somewhat dumb and usually not needed already, but could be improved. Mostly used when new features are added that aren't picked up automatically. image

  3. Rescanning files. Somewhat less egregious as the two examples above. Should be solved by #73, but implementation is tricky. image

  4. Reloading the page for updated. Updating generally doesn't even need a reload, but it's usually foiled by the three points above, so it's the least urgent to fix.