Web: offer Reload to update when a new deployment is out (#231)

Every half hour the page fetches its own address past the browser's cache; when it loads
another content-hashed build of the app than the running one, the status bar offers "Reload
to update" (the page's unsaved-changes question still guards the reload). Rust only, no
service worker: the browser build has no other update path and none of the desktop's
download code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
jyvikoandClaude Opus 5.5 authored and Irakli Kourtis committed 2026-10-15 01:48:30 -04:00
1 parent 7dd50a3ca4
commit 93b2ae343c
6 files changed
+145 -3

No files matched your search

+3
View File
@@ -391,6 +391,8 @@ pub struct ModelApp {
consent_asked: bool,
/// Checking for and installing updates, when this run may ([`updates`]).
updates: Option<updates::State>,
/// The web app: a new deployment is out, and this reloads the page into it.
reload: Option<Box<dyn Fn()>>,
/// The setup progress the browser marks, and what it was worked out for.
setup: (Option<(u64, u64, bool, bool)>, std::sync::Arc<Vec<fieldcraft_engine::progress::StageState>>),
/// The file opening in the background, and files waiting to open after it.
@@ -481,6 +483,7 @@ impl ModelApp {
usage: None,
consent_asked: false,
updates: None,
reload: None,
setup: (None, std::sync::Arc::default()),
loading: None,
queued: std::collections::VecDeque::new(),