Skip to content

Commit 4688afe

Browse files
vch9claude
andcommitted
feat(tui): add self-update notification on startup
- Start Self_update_scheduler on TUI startup - Check for octez-manager updates immediately on startup - Show toast notification when update is available - Recommend running 'octez-manager self-update' command - Properly shutdown scheduler on exit Fixes #538 Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 883d027 commit 4688afe

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- TUI now shows notification when octez-manager update is available and recommends running `self-update` command
12+
913
### Changed
1014

1115
- Renamed "linked directories" to "registered directories" (CLI commands: `binaries link``binaries register`, `binaries unlink``binaries unregister`)

src/ui/pages/manager_app.ml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ let run ?page ?(log = false) ?logfile () =
6969
latest_version
7070
current_str)
7171
| _ -> ()) ;
72+
(* Start self-update scheduler to check for octez-manager updates *)
73+
Self_update_scheduler.start () ;
74+
(* Check immediately for octez-manager updates and show notification *)
75+
Background_runner.enqueue (fun () ->
76+
Self_update_scheduler.check_now () ;
77+
if Self_update_scheduler.update_available () then
78+
match Self_update_scheduler.get_latest_version () with
79+
| Some version ->
80+
Context.toast_info
81+
(Printf.sprintf
82+
"octez-manager %s is available. Run 'octez-manager \
83+
self-update' to upgrade."
84+
version)
85+
| None -> ()) ;
7286
let start_name = Option.value ~default:Instances.name page in
7387
let rec loop history current_name =
7488
if !quit_requested then raise Exit
@@ -93,6 +107,7 @@ let run ?page ?(log = false) ?logfile () =
93107
System_metrics_scheduler.shutdown () ;
94108
External_services_scheduler.shutdown () ;
95109
Versions_scheduler.shutdown () ;
110+
Self_update_scheduler.stop () ;
96111
(* Cleanup: kill any active download process *)
97112
Common.kill_active_download () ;
98113
Ok ()

0 commit comments

Comments
 (0)