feat: in-app update notice — checks GitHub releases on startup
Adds a one-shot update check that runs on app boot and pops up a small
"Update Available" window when the GitHub releases API reports a newer
tag than this build's `CARGO_PKG_VERSION`.
- `src/update_check.rs` — async wrapper around a blocking `ureq` GET to
`api.github.com/repos/HakanSeven12/H7CAD/releases/latest`, returns
`Some(version)` when a newer release exists, `None` otherwise (silent
on network / parse failure so a missing connection never blocks
launch).
- `H7CAD::boot` chains a `Task::perform` next to the main-window open
so the check runs in parallel with first-paint.
- New window plumbed like the other floating panels (page setup, about,
etc.): `update_notice_window`/`update_notice_version` state, title
entry, `OsWindowClosed` cleanup, and a `ui::update_notice::view_window`
modal that shows installed vs. latest version plus "Later" /
"Open Release Page" buttons. Open routes through `open::that` to the
releases URL and dismisses the modal.
Dependency: adds `ureq = { version = "2", default-features = false,
features = ["tls"] }` — the smallest blocking HTTP client + TLS combo
that doesn't drag in an async runtime.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
de37ee04bf
commit
86f5ba7b62
10 changed files with 388 additions and 2 deletions
|
|
@ -190,6 +190,13 @@ impl H7CAD {
|
|||
if Some(window_id) == self.about_window {
|
||||
return crate::ui::about::view_window();
|
||||
}
|
||||
if Some(window_id) == self.update_notice_window {
|
||||
let latest = self
|
||||
.update_notice_version
|
||||
.as_deref()
|
||||
.unwrap_or("?");
|
||||
return crate::ui::update_notice::view_window(latest);
|
||||
}
|
||||
if Some(window_id) == self.unsaved_dialog_window {
|
||||
let tab_name = match &self.pending_close {
|
||||
Some(super::PendingClose::Tab(idx)) => self
|
||||
|
|
|
|||
Loading…
Reference in a new issue