guyfedwards / nom

RSS reader for the terminal
GNU General Public License v3.0
372 stars 25 forks source link

Refreshes are a bit buggy #65

Closed kanielrkirby closed 5 months ago

kanielrkirby commented 7 months ago

It seems that 1, refreshes block the app completely until they're done (which can take up to ~5 seconds), and 2, if you refresh when in the filtered view, your list becomes completely empty.

For point 1, I think it should probably be possible to put the logic for refreshing inside a goroutine, and set an internal variable for "refreshing" or something similar, so that the app doesn't compeletely stop for several seconds.

For point 2, I think the Filter Function just needs to trigger again, but I'm not 100% sure on how to force that. We might just run ResetFilter() if nothing else, so that the user isn't greeted with a completely blank page just from running refresh.

guyfedwards commented 7 months ago
  1. Not sure what the best solution is here. The fetching itself is concurrent but fetching all the feeds blocks the UI update. We could set a 'refreshing' status message which at least gives feedback about it happening, or we could async all of the refresh call but then have to figure out how to get the updated items into the UI without it feeling janky/jumping around/messing with selected index etc. I would favour showing a message for now vs having to reconcile the list but we might be able to have it display nicely, or have another keypress to udpate the UI once the background fetching has finished
  2. This seems like the same state is happening as when going filtered > article > esc. Resetting the filter is probably a quick win here until we figure out the root cause. (doing some quick debugging I can see the model state is still 'filter applied' when showing the 'No items found.' message