Conversation
Signed-off-by: Peter Jung <admin@ptr1337.dev>
There was a problem hiding this comment.
Pull request overview
Adds user-facing affordances in the GTK UI by introducing localized tooltips for the “Fixes” actions and providing status text feedback on the installer button while pre-flight ISO checks and installer launch are in progress.
Changes:
- Add Fluent-backed tooltips for Fixes buttons (and related conditional buttons) in the Tweaks/Fixes page.
- Update installer button label to reflect “checking” / “launching” states and restore the default label afterward.
- Add the new tooltip strings to the English Fluent resource file.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/pages/mod.rs |
Sets tooltip text for Fixes/DNS/KWin debug buttons using localized Fluent message IDs. |
src/installer.rs |
Adjusts the install button’s label and enabled state during ISO checks and installer execution. |
i18n/en/cachyos_hello.ftl |
Adds English strings for the newly introduced tooltip message IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let install_btn: gtk::Button = builder.object("install").unwrap(); | ||
| install_btn.set_sensitive(false); | ||
| install_btn.set_label("Checking\u{2026}"); | ||
|
|
There was a problem hiding this comment.
launch_installer runs in a background thread, but it directly calls install_btn.set_sensitive(...) / set_label(...) from that thread. GTK widgets are not thread-safe; UI updates should be marshalled back onto the main loop (e.g., via glib::MainContext::channel, glib::idle_add_local, or MainContext::default().invoke) and only performed on the GTK/main thread.
| install_btn.set_label("Checking\u{2026}"); | ||
|
|
||
| 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_label("Launch installer"); | ||
| install_btn.set_sensitive(true); |
There was a problem hiding this comment.
The install button labels are hard-coded English strings ("Checking…", "Launching installer…", "Launch installer"). This breaks localization and can leave the UI in the wrong language after switch_locale(). Please source these labels from Fluent (fl!(...)), reusing button-installer-label for the default and adding new translation keys for the transient states.
| // Set tooltips. | ||
| removelock_btn.set_tooltip_text(Some(&fl!("remove-lock-tooltip"))); | ||
| reinstall_btn.set_tooltip_text(Some(&fl!("reinstall-tooltip"))); | ||
| resetkeyring_btn.set_tooltip_text(Some(&fl!("reset-keyrings-tooltip"))); | ||
| update_system_btn.set_tooltip_text(Some(&fl!("update-system-tooltip"))); | ||
| remove_orphans_btn.set_tooltip_text(Some(&fl!("remove-orphans-tooltip"))); | ||
| clear_pkgcache_btn.set_tooltip_text(Some(&fl!("clear-pkgcache-tooltip"))); | ||
| rankmirrors_btn.set_tooltip_text(Some(&fl!("rankmirrors-tooltip"))); | ||
| install_gaming_btn.set_tooltip_text(Some(&fl!("install-gaming-tooltip"))); | ||
| install_winboat_btn.set_tooltip_text(Some(&fl!("install-winboat-tooltip"))); |
There was a problem hiding this comment.
Tooltips are set once during widget creation using fl!(...), but the runtime locale switch path (pages::i18n::update_translations) only updates labels, not tooltips. After changing language, these tooltips will remain in the previous language. Consider storing the tooltip message-id per button and updating tooltips in update_translations alongside the labels.
| if Path::new("/usr/bin/nmcli").exists() { | ||
| let dnsserver_btn = create_gtk_button!("dnsserver-title"); | ||
| dnsserver_btn.set_tooltip_text(Some(&fl!("dnsserver-tooltip"))); | ||
| dnsserver_btn.connect_clicked(glib::clone!(@weak builder => move |_| { |
There was a problem hiding this comment.
Same locale-switch issue as the other fixes buttons: this tooltip is initialized once with fl!(...) but isn’t updated by pages::i18n::update_translations, so it can remain in the old language after switch_locale(). Update tooltips during translation refresh as well.
| { | ||
| if pgrep_res.success() { | ||
| let kwinw_debug_btn = create_gtk_button!("show-kwinw-debug-title"); | ||
| kwinw_debug_btn.set_tooltip_text(Some(&fl!("show-kwinw-debug-tooltip"))); |
There was a problem hiding this comment.
Same locale-switch issue as the other fixes buttons: this tooltip is initialized once with fl!(...) but isn’t updated by pages::i18n::update_translations, so it can remain in the old language after switch_locale(). Update tooltips during translation refresh as well.
| kwinw_debug_btn.set_tooltip_text(Some(&fl!("show-kwinw-debug-tooltip"))); | |
| kwinw_debug_btn.set_has_tooltip(true); | |
| kwinw_debug_btn.connect_query_tooltip(|_widget, _x, _y, _keyboard_mode, tooltip| { | |
| tooltip.set_text(Some(&fl!("show-kwinw-debug-tooltip"))); | |
| true | |
| }); |
Signed-off-by: Peter Jung <admin@ptr1337.dev>
Fixes: #177