Fix cloud features staying off after login when the setup wizard was closed

Reported on #15239: after signing in to Orca Cloud on a fresh install, no sync
prompt appears and File > Sync Presets is greyed out with nothing to explain why.

CAUSE. AppConfig::get_stealth_mode() returns true whenever `firstguide/finish` is
unset, and that flag is written in exactly one place — GuideFrame::SaveProfile(),
i.e. only when the setup wizard is COMPLETED. Closing the wizard is what people do
today to reach the login (the wizard never offers it, which is #15239 itself), so a
new user ends up permanently in a stealth mode they never chose. Every cloud gate
keyed on get_stealth_mode() then switches off silently, including:

  * GUI_App::on_user_login_handle(), which returns EARLY on stealth — so the whole
    post-login flow is skipped: preset migration, plugin fetch, user-preset load and
    show_sync_dialog(). That is the missing sync prompt.
  * the Sync Presets item in both the top menu and the File menu, whose enable
    lambda was `is_user_login() && !get_stealth_mode()`. That is the greyed item.

The result is indistinguishable from real Stealth mode, and nothing in the UI says
so, because the one place that DOES explain it — the "Quit Stealth Mode" dialog in
handle_web_request() — only covers the homepage login commands.

FIX, two parts.

1. The pre-wizard value is a DEFAULT for "the user has not been asked yet", not a
   setting, so it must not survive the user answering. Signing in to a cloud account
   is that answer. AppConfig now carries a session-only `m_cloud_logged_in` mirrored
   from the network agent (on login, on logout, and at agent start so a restored
   session counts), and get_stealth_mode() consults it before falling back to the
   pre-wizard default. An explicit Stealth mode setting is untouched and still wins:
   a user who turned it on deliberately stays offline whether or not they sign in.

2. Sync Presets no longer greys itself out. Both refusal paths already had a message
   to show — "You must be logged in…" and now one for Stealth mode naming the
   Preferences toggle — and the enable lambda was making both unreachable. A disabled
   item that cannot say why is the reason this took a bug report to find.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommaso Bianchi
2026-08-15 21:14:35 +02:00
co-authored by Claude Opus 5
parent 8e5d0d195c
commit 7d313159df
4 changed files with 50 additions and 8 deletions
+22 -6
View File
@@ -3402,14 +3402,22 @@ void MainFrame::init_menubar_as_editor()
info_dlg.ShowModal();
return;
}
if (wxGetApp().app_config->get_stealth_mode()) {
MessageDialog info_dlg(this,
_L("Stealth mode is on, so Orca Cloud syncing is switched off. "
"Turn Stealth mode off in Preferences to sync your presets."),
_L("Sync Presets"), wxOK | wxICON_INFORMATION);
info_dlg.ShowModal();
return;
}
if (m_plater)
m_plater->get_notification_manager()->push_notification(
into_u8(_L("Syncing presets from cloud\u2026")));
wxGetApp().restart_sync_user_preset();
}, "", nullptr,
[this]() {
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
}, this);
// Stays ENABLED whatever the cloud state: both refusals above name their reason, and a
// greyed-out item names none. A user who could not sync had no way to find out why.
[]() { return true; }, this);
top_menu->AppendSeparator();
append_menu_item(
@@ -3539,14 +3547,22 @@ void MainFrame::init_menubar_as_editor()
info_dlg.ShowModal();
return;
}
if (wxGetApp().app_config->get_stealth_mode()) {
MessageDialog info_dlg(this,
_L("Stealth mode is on, so Orca Cloud syncing is switched off. "
"Turn Stealth mode off in Preferences to sync your presets."),
_L("Sync Presets"), wxOK | wxICON_INFORMATION);
info_dlg.ShowModal();
return;
}
if (m_plater)
m_plater->get_notification_manager()->push_notification(
into_u8(_L("Syncing presets from cloud\u2026")));
wxGetApp().restart_sync_user_preset();
}, "", nullptr,
[this]() {
return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
}, this);
// Stays ENABLED whatever the cloud state: both refusals above name their reason, and a
// greyed-out item names none. A user who could not sync had no way to find out why.
[]() { return true; }, this);
fileMenu->AppendSeparator();
append_menu_item(