mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix: desktop settings UX overhaul & IPv4-safe fetch for sidecar
- Show "Staged" status/pill for buffered secrets instead of "Missing" - Add macOS Edit menu (Cmd+C/V/X/Z) for WKWebView clipboard support - Raise settings window when main gains focus (prevent hide-behind) - Fix Cloudflare verification to probe Radar API (not token/verify) - Fix EIA verification URL to valid v2 endpoint - Force IPv4 globally: monkey-patch fetch() to avoid IPv6 ETIMEDOUT on government APIs (EIA, NASA FIRMS) with broken AAAA records - Soft-pass on network errors during secret verification (don't block save) - Add desktopRequiredSecrets to skip relay URLs on desktop - Cross-window sync for secrets and feature toggles via localStorage events - Add @tauri-apps/cli devDependency
This commit is contained in:
@@ -382,7 +382,18 @@ fn build_app_menu(handle: &AppHandle) -> tauri::Result<Menu<tauri::Wry>> {
|
||||
&[&about_item, &help_separator, &github_item, &devtools_item],
|
||||
)?;
|
||||
|
||||
Menu::with_items(handle, &[&file_menu, &help_menu])
|
||||
let edit_menu = {
|
||||
let undo = PredefinedMenuItem::undo(handle, None)?;
|
||||
let redo = PredefinedMenuItem::redo(handle, None)?;
|
||||
let sep1 = PredefinedMenuItem::separator(handle)?;
|
||||
let cut = PredefinedMenuItem::cut(handle, None)?;
|
||||
let copy = PredefinedMenuItem::copy(handle, None)?;
|
||||
let paste = PredefinedMenuItem::paste(handle, None)?;
|
||||
let select_all = PredefinedMenuItem::select_all(handle, None)?;
|
||||
Submenu::with_items(handle, "Edit", true, &[&undo, &redo, &sep1, &cut, ©, &paste, &select_all])?
|
||||
};
|
||||
|
||||
Menu::with_items(handle, &[&file_menu, &edit_menu, &help_menu])
|
||||
}
|
||||
|
||||
fn handle_menu_event(app: &AppHandle, event: tauri::menu::MenuEvent) {
|
||||
@@ -626,6 +637,17 @@ fn main() {
|
||||
let _ = w.set_focus();
|
||||
}
|
||||
}
|
||||
// Raise settings window when main window gains focus so it doesn't hide behind
|
||||
RunEvent::WindowEvent {
|
||||
label,
|
||||
event: WindowEvent::Focused(true),
|
||||
..
|
||||
} if label == "main" => {
|
||||
if let Some(sw) = app.get_webview_window("settings") {
|
||||
let _ = sw.show();
|
||||
let _ = sw.set_focus();
|
||||
}
|
||||
}
|
||||
RunEvent::ExitRequested { .. } | RunEvent::Exit => {
|
||||
stop_local_api(app);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user