feat: show failover toggle independently on main page with confirm dialog

Add enableFailoverToggle setting to control failover toggle visibility
on the main page, decoupled from proxy takeover state. First-time
enable shows a ConfirmDialog (same pattern as proxy toggle). The toggle
row is placed in the Auto Failover accordion section in settings.
This commit is contained in:
Jason
2026-03-08 22:25:48 +08:00
parent 6d078e7f33
commit 032a8203fd
7 changed files with 79 additions and 13 deletions
+8
View File
@@ -199,6 +199,12 @@ pub struct AppSettings {
/// User has confirmed the stream check first-run notice
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stream_check_confirmed: Option<bool>,
/// Whether to show the failover toggle independently on the main page
#[serde(default)]
pub enable_failover_toggle: bool,
/// User has confirmed the failover toggle first-run notice
#[serde(default, skip_serializing_if = "Option::is_none")]
pub failover_confirmed: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub language: Option<String>,
@@ -286,6 +292,8 @@ impl Default for AppSettings {
proxy_confirmed: None,
usage_confirmed: None,
stream_check_confirmed: None,
enable_failover_toggle: false,
failover_confirmed: None,
language: None,
visible_apps: None,
claude_config_dir: None,