From 030f50f90d7f7e20dc3f1ed910e6ffde6f04da23 Mon Sep 17 00:00:00 2001 From: forkless Date: Wed, 3 Jun 2026 02:05:42 +0200 Subject: [PATCH] notify user on startup when migrations complete, remind to clean old files --- src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4027be0..6d5e6f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,23 +160,34 @@ fn run_app(terminal: &mut Terminal) -> Result<()> { crate::config::ensure_dir(crate::config::backups_saves_dir()); crate::config::ensure_dir(crate::config::backups_config_dir()); + // Track whether any migrations occurred for the startup status message + let mut migrated_something = false; + // Migrate old transaction.log into logs/ directory if guard::migrate_old_log() { guard::log_action("MIGRATE", "old transaction.log moved to logs/", "OK", &app.log_path)?; + migrated_something = true; } // Clean up stale config.ini from v0.3.0 and earlier if crate::config::cleanup_stale_config() { guard::log_action("MIGRATE", "old config.ini removed", "SAFE", &app.log_path)?; + migrated_something = true; } // Migrate old directory-tree backups to tar.gz if let Ok(n) = ops::migrate_old_backups() { if n > 0 { guard::log_action("MIGRATE", &format!("{n} old backup(s) migrated to tar.gz, originals in NotAlterra_Backups/ untouched"), "OK", &app.log_path)?; + migrated_something = true; } } + // Notify the user about completed migrations + if migrated_something { + app.set_status("Data migrated from previous version. Old files remain — delete manually if desired.", tui::StatusStyle::Info); + } + // Quick check of common save locations (current user only, no profile scans) if app.save_folder.is_none() { if let Some(path) = discovery::quick_discover() {