Skip to content

feat: show progress in install button#179

Draft
azdanov wants to merge 1 commit intoCachyOS:developfrom
azdanov:add-installer-button-feedback
Draft

feat: show progress in install button#179
azdanov wants to merge 1 commit intoCachyOS:developfrom
azdanov:add-installer-button-feedback

Conversation

@azdanov
Copy link
Member

@azdanov azdanov commented Mar 5, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the installer launch flow to provide user-visible progress feedback via the “install” button label while pre-flight ISO checks run and while the installer is being started.

Changes:

  • Updates the install button label to “Checking...” before running ISO checks.
  • Restores the original localized label when checks fail or after the installer exits.
  • Updates the install button label to “Launching installer...” when starting the installer process.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 135 to +137
let install_btn: gtk::Button = builder.object("install").unwrap();
install_btn.set_sensitive(false);
install_btn.set_label("Checking...");
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These set_label(...) calls happen inside a std::thread::spawn worker thread. GTK widgets are not thread-safe; updating the button label from a non-main thread can cause crashes or undefined behavior. Route UI updates back to the main loop (e.g., via glib::MainContext/channel, glib::idle_add_local, or glib::timeout_add_local) and only mutate GTK widgets there.

Copilot uses AI. Check for mistakes.
Comment on lines +137 to 152
install_btn.set_label("Checking...");

let ui_comp = crate::gui::GUI::new(window_ref.clone());
let checks = [connectivity_check, edition_compat_check, outdated_version_check];
if !checks.iter().all(|x| x(&ui_comp, message.clone())) {
// if any check failed, return
info!("Some ISO check failed!");
install_btn.set_sensitive(true);
install_btn.set_label(&fl!("button-installer-label"));
return;
}

// Spawning child process
info!("ISO checks passed! Starting Installer..");
install_btn.set_label("Launching installer...");
let mut child = Exec::cmd("/usr/local/bin/calamares-online.sh")
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new button status texts are hard-coded English strings ("Checking...", "Launching installer...") while the default installer label uses fl!(...). To keep the UI fully localizable, add new Fluent keys for these states and use fl!() here as well.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants