window: persist article list and open article across restarts

On shutdown the full article list (including current read/unread state)
and the ID of the open article are saved to
~/.local/share/net.jeena.FeedTheMonkey/cache.json.

On next launch:
- The cached articles are loaded into the list immediately, before any
  network request, so the sidebar is populated and the previously open
  article is visible without waiting for the server.
- The article content is injected into the WebView once its base HTML
  finishes loading (LoadEvent::Finished), avoiding a race where
  window.setArticle() did not yet exist.
- A background refresh then fetches fresh data from the server; if the
  previously open article still exists its selection is preserved,
  otherwise the first item is selected.
- Network errors during a background refresh show a toast instead of
  replacing the visible article list with an error page.
This commit is contained in:
Jeena 2026-03-21 01:13:09 +00:00
parent 8fd52dd8a0
commit 183191727b
4 changed files with 309 additions and 32 deletions

View file

@ -1,5 +1,8 @@
mod api;
mod app;
mod cache;
mod filters;
mod preferences_dialog;
mod article_row;
mod credentials;
mod login_dialog;